var i=0;
for (i=0;i<=5;i++){
document.writeln("<style type='text/css'>.produktbox_detail .bildbox #bild_"+i+" {display:none;}<\/style>");
}
document.writeln("<style type='text/css'>.produktbox_detail .bildbox #bild_0 {display:block;}<\/style>");

for (i=0;i<=5;i++){
document.writeln("<style type='text/css'>.produktbox_detail #bild_beschreibung_"+i+" {display:none;}<\/style>");
}
document.writeln("<style type='text/css'>.produktbox_detail #bild_beschreibung_0 {display:block;}<\/style>");


sfHover = function() {
	var sfEls = document.getElementById("box_sort").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}




var xmlhttp;
var t;
window.clearTimeout(t);

function timing_start(div,id,nr,nr_max)
{
var div = div;
var id = id;

if (nr >= nr_max){
	nr = 1;
}else{
	nr++;
}

if (nr_max!=0){
	var timer = 1;
}

if (nr_max==0){
	nr = 1;
}


timing_http=GetXmlHttpObject();
if (timing_http==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }

display = document.getElementById('display').value;
  
var url="/jscripts/addons/cms/datenbank/get_img.php";
url=url+"?id="+id;
url=url+"&nr="+nr;
url=url+"&display="+display;
url=url+"&sid="+Math.random();

timing_http.onreadystatechange=timing_set_img;
timing_http.div = div;
timing_http.id = id;
timing_http.nr = nr;
timing_http.nr_max = nr_max;

timing_http.timer = timer;

timing_http.open("GET",url,true);
timing_http.send(null);
}

function timing_set_img(){

  if(timing_http.readyState==4){
  
  //alert(timing_http.responseText);
  
  document.getElementById(""+timing_http.div+"").src=timing_http.responseText;
  
  //var t;
  
	if (timing_http.timer==1){
		t = window.setTimeout("timing_start('"+timing_http.div+"',"+timing_http.id+","+timing_http.nr+","+timing_http.nr_max+")",800);
	}
  
  }

}


function timing_stop(div,id,nr,nr_max)
{
	timing_start(div,id,nr,nr_max);
	window.clearTimeout(t);
	
	
}




function display_1(max_reihen,menue,page)
{
var check = document.getElementById('display').value;

//alert(check);
 
 if (check == 2) {
  document.getElementById('display').value = 0;
 }else{
  document.getElementById('display').value = 2;
 }
 
 listing(max_reihen,menue,page);
 
}

function psort_1(max_reihen,menue,page)
{
var check = document.getElementById('psort').value;

//alert(check);
 
 if (check == 2) {
  document.getElementById('psort').value = 0;
 }else{
  document.getElementById('psort').value = 2;
 }
 
 listing(max_reihen,menue,page);
 
}


function msort_1(max_reihen,menue,page)
{

var check = document.getElementById('msort').value;

//alert(check);
 
 if (check == 2) {
  document.getElementById('msort').value = 0;
 }else{
  document.getElementById('msort').value = 2;
 }
 
 listing(max_reihen,menue,page);
 
}


function listing(max_reihen,menue,page)
{


xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }


//alert(location.href);
//href = location.href;
href = location.search;

//alert(href);

psort = document.getElementById('psort').value;
msort = document.getElementById('msort').value;
display = document.getElementById('display').value;

  
var url="/jscripts/addons/cms/datenbank/listing.php";
url=url+"?max_reihen="+max_reihen;
url=url+"&menue="+menue;
url=url+"&page="+page;
url=url+"&psort="+psort;
url=url+"&msort="+msort;
url=url+"&display="+display;
url=url+"&herf="+href;
url=url+"&sid="+Math.random();
//alert (""+url+"");
xmlhttp.onreadystatechange=stateChanged_listing;
xmlhttp.display = display;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);

}

function stateChanged_listing()
{
if (xmlhttp.readyState==4)
{
	
	document.getElementById("listing").innerHTML=xmlhttp.responseText;
	
	
	location="#listing";
	/*/
	location.hash="#listing";
	self.location.href="#listing";	
	/*/
	
	

}
}


function eshop_display_image(menge,i){
	
		focusDiv(''+menge+'','bild','bild_'+i+'');
		focusDiv(''+menge+'','bild_beschreibung','bild_beschreibung_'+i+'');
	}


function eshop_display_versandkosten(){
	
		id = 'versandkosten';
		
		var check = document.getElementById(id);

		if(check!=null){
		
		document.getElementById(id).style.display='none';
		document.getElementById(id).style.position='absolute';
		document.getElementById(id).style.zIndex='3';
		document.getElementById(id).style.top='0px';
		document.getElementById(id).style.left='0px';
		
		}
		
	}

	
function eshop_display_treuepunkte(){
	
		id = 'treuepunkte';
		
		var check = document.getElementById(id);

		if(check!=null){
		
		document.getElementById(id).style.display='none';
		document.getElementById(id).style.position='absolute';
		document.getElementById(id).style.zIndex='3';
		document.getElementById(id).style.top='0px';
		document.getElementById(id).style.left='30em';
		
		}
		
	}
	

function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  // code for IE6, IE5
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;
}


