function korb (a,b){
		Effect.Appear('korb');
		Element.hide($('korbher'));
		Element.show($('korbweg'));
		new Ajax.Updater('korb', 'php/korb.php', { 
		method: 'post',
		asynchronous:true,
		postBody: 'arts=' + a + '&anz=' + b
	});
}
function main (a){
	new Ajax.Updater('main', 'php/main.php', { 
		method: 'post',
		asynchronous:true,
		postBody: 'kat=' + a
	});
	
}

function destroy (){
	new Ajax.Updater('korb', 'php/info.php', { 
		method: 'post',
		asynchronous:true
	});
}	
function make_links() {
	Element.hide($('korbweg'));
	Element.hide($('korb'));
	if (document.getElementsByTagName) {
    var links = document.getElementsByTagName("a");
    for (var i=0; i < links.length; i++) {
      if (links[i].className.match("cont")) {
        links[i].onclick = function() {
          win1(this.getAttribute("href"), this.getAttribute("id"));
          return false;
        };
      }
    }
  }
}
function agbs(URL,Name,params) {
  window.open(URL,Name,params);
}
function korb_close(){
	Effect.Puff('korb', { duration: 0.5 });
	Element.show($('korbher'));
	Element.hide($('korbweg'));
}
function showsl(){
	Element.show($('shl'));
}
function opener(what, where){
	new Ajax.Updater(what, 'php/navi.php', { 
		method: 'post',
		asynchronous: true,
		encoding: 'ISO-8859-1',
		postBody: 'id=' + what + '&lname=' + where,
		onSuccess: function(transport){

	window.setTimeout(function(){
	Effect.BlindDown($(what), {duration: 0.5});
	var lnk = $(where);
	lnk.href = "javascript: zu('"+what+"','"+where+"')";
	},300);
			
		}
	});
		
}
function loading(){
	self.location.replace('http://www.ergocontour.de/?shop=1&inhalt=5&level=2&lname=Online-Shop');
}
function neuladen(){
	window.setInterval("loading()", 5000);
}
function zu(what, where){
	Effect.BlindUp($(what), {duration: 0.5});
	var lnk = $(where);
	lnk.href = "javascript: opener('"+what+"','"+where+"')";
	new Ajax.Updater(what, 'php/navi.php', { 
		method: 'post',
		asynchronous:true,
		postBody: 'id=1'
	});
	
}
function newsout(url, name, bez)
{
  var win = new Window({id: "win" + name, className: "alphacube", resizable: false, draggable: false, width:600, height:375, top:5, left: 1, parent:$('inhalte')}); 
  win.setAjaxContent(url, {asynchronous: true, method: 'post'}); 
  win.setTitle(bez);
  win.setDestroyOnClose(); 
  win.show();
  win.setConstraint(true, {left:0, right:2, bottom:2})
  win.toFront();
  
  
  
}
function mid(){
function Fensterweite () {
  if (window.innerWidth) {
    return window.innerWidth;
  } else if (document.body && document.body.offsetWidth) {
    return document.body.offsetWidth;
  } else {
    return 0;
  }
}
var mi = Fensterweite();
var midde = (mi/2)-490;
$('mitte').setStyle({
   left: midde + 'px'
});

}
function clicked(pic){
window.open("php/bild.php?pic=" + pic,"Bild","width=800, height=600");
}
function news(){
	new Ajax.Updater("inhalte", 'php/news.php', { 
		method: 'post',
		asynchronous:true,
		encoding: 'UTF-8'		
	});
}
function popup(pic){
var win = window.open('popup.php?pic=' + pic ,'popup','width=420, height=600, scrollbars=yes, resizable=yes, status=yes');
}