if (document.images){


	frwdon=new Image(6,5);
    frwdon.src="/templates/"+CSS_STYLE+"/img/arrows/forward_h.gif";
    frwdoff=new Image(6,5);   
    frwdoff.src="/templates/"+CSS_STYLE+"/img/arrows/forward.gif";
    
	frwwon=new Image(6,5);
    frwwon.src="/templates/"+CSS_STYLE+"/img/arrows/forward_w.gif";
    frwwoff=new Image(6,5);   
    frwwoff.src="/templates/"+CSS_STYLE+"/img/arrows/forward.gif";
    
    bckdon=new Image(6,5);
    bckdon.src="/templates/"+CSS_STYLE+"/img/arrows/backward_h.gif";
    bckdoff=new Image(6,5);   
    bckdoff.src="/templates/"+CSS_STYLE+"/img/arrows/backward.gif"; 
    
    
    
	nexton=new Image(17,21);
    nexton.src="/templates/"+CSS_STYLE+"/img/image_functionalities/gallery_next_h.gif";
    nextoff=new Image(17,21);
    nextoff.src="/templates/"+CSS_STYLE+"/img/image_functionalities/gallery_next.gif";
    
    prevon=new Image(17,21);
    prevon.src="/templates/"+CSS_STYLE+"/img/image_functionalities/gallery_prev_h.gif";
    prevoff=new Image(17,21);
    prevoff.src="/templates/"+CSS_STYLE+"/img/image_functionalities/gallery_prev.gif";    
    
    
       
    
    lghbon=new Image(17,21);
    lghbon.src="/templates/"+CSS_STYLE+"/img/image_functionalities/ligthbox_h.gif";
    lghboff=new Image(17,21);
    lghboff.src="/templates/"+CSS_STYLE+"/img/image_functionalities/lightbox.gif";

	crtbon=new Image(17,21);
    crtbon.src="/templates/"+CSS_STYLE+"/img/image_functionalities/cart_h.gif";
    crtboff=new Image(17,21);
    crtboff.src="/templates/"+CSS_STYLE+"/img/image_functionalities/cart.gif";
    
    pullon=new Image(5,8);
    pullon.src="/templates/"+CSS_STYLE+"/img/arrows/pulldown_w.gif";
    pulloff=new Image(5,8);
    pulloff.src="/templates/"+CSS_STYLE+"/img/arrows/pulldown.gif";
    
	linkon=new Image(3,5);
    linkon.src="/templates/"+CSS_STYLE+"/img/arrows/link_h.gif";  
   	linkoff=new Image(3,5);
    linkoff.src="/templates/"+CSS_STYLE+"/img/arrows/link.gif"; 
    
    menlon=new Image(3,5);
    menlon.src="/templates/"+CSS_STYLE+"/img/arrows/link_w.gif";
    menloff=new Image(3,5);
    menloff.src="/templates/"+CSS_STYLE+"/img/arrows/link.gif";
    
    acrton=new Image(17,21);
    acrton.src="/templates/"+CSS_STYLE+"/img/image_functionalities/add_to_cart_h.gif";
    acrtoff=new Image(17,21);
    acrtoff.src="/templates/"+CSS_STYLE+"/img/image_functionalities/add_to_cart_ok.gif";
    
    algton=new Image(17,21);
    algton.src="/templates/"+CSS_STYLE+"/img/image_functionalities/add_to_lightbox_h.gif";
    algtoff=new Image(17,21);
    algtoff.src="/templates/"+CSS_STYLE+"/img/image_functionalities/add_to_lightbox_ok.gif";
    
    dtlson=new Image(17,21);
    dtlson.src="/templates/"+CSS_STYLE+"/img/image_functionalities/image_details_h.gif";
    dtlsoff=new Image(17,21);
    dtlsoff.src="/templates/"+CSS_STYLE+"/img/image_functionalities/image_details.gif";
    
    prcnon=new Image(17,21);
    prcnon.src="/templates/"+CSS_STYLE+"/img/image_functionalities/image_pricing_h.gif";
    prcnoff=new Image(17,21);
    prcnoff.src="/templates/"+CSS_STYLE+"/img/image_functionalities/image_pricing.gif";
}

function openNewWindow(url,param) {
	
	var myurl = url+'.php'+param;
	var winName = "ShoppingCart";
	var resizable = 0;
	var scrollbars = 1;
	var width = 484;
	var height = 700;
	var top = 30;
	var left = 50;
	
	var myfenster = window.open(myurl,winName,'toolbar=0,location=0,directories=0, status=0,menubar=0,scrollbars=' + scrollbars + ',resizable=' + resizable + ',width=' + width + ',height=' + height + ',left=' + left + ',top=' + top);
	myfenster.focus();
}

function clear_input(thistext,std_value){
	if (thistext.value==std_value){
		thistext.value="";
	}
}

function lightup(imgName)
 {
   if (document.images)
    {
      imgNameShort=imgName.substr(0,4); 
      imgOn=eval(imgNameShort + "on.src");
      document[imgName].src= imgOn;
    }
 }

function turnoff(imgName)
 {	
    if (document.images)
    {
      imgNameShort=imgName.substr(0,4);
      imgOff=eval(imgNameShort + "off.src");
      document[imgName].src= imgOff;
    }	
 }
 
 // Main function to retrieve mouse x-y pos.s
function getMouseXY(e) {
  if (activePreview){
	  if (IE) { // grab the x-y pos.s if browser is IE, OPERA	  	
	    tempX = event.clientX + document.body.scrollLeft;
	    tempY = event.clientY + document.body.scrollTop;
	    winWidth = document.body.offsetWidth;
	  } else {  // grab the x-y pos.s if browser is NS
	    tempX = e.pageX;
	    tempY = e.pageY;
	    winWidth = window.innerWidth;
	  }  
  	  // catch possible negative values in NS4
	  if (tempX < 0){tempX = 0;}
	  if (tempY < 0){tempY = 0;}  
	 
	  var preview = document.getElementById('preview');
	  if (tempX<winWidth/2){
  	  	preview.style.top = tempY+10;
  	  	preview.style.left = tempX+10;
  	  }else{
  	  	preview.style.top = tempY+10;
  	  	preview.style.left = tempX-10-preview.width;
  	  }	
  }
 }
 

  function hoverIE() {
    var LI = document.getElementById("Navigation").firstChild;
    do {
      if (sucheUL(LI.firstChild)) {
        LI.onmouseover=einblenden; LI.onmouseout=ausblenden;
      }
      LI = LI.nextSibling;
    }
    while(LI);
  }

  function sucheUL(UL) {
    do {
      if(UL) UL = UL.nextSibling;
      if(UL && UL.nodeName == "UL") return UL;
    }
    while(UL);
    return false;
  }

  function einblenden() {
    var UL = sucheUL(this.firstChild);
    if(this.className!='search'){
	    UL.style.display = "block";
	}
  }
  function ausblenden() {
  	if(this.className!='search'){
	    sucheUL(this.firstChild).style.display = "none";
	}
  }

var activePreview=false;

function showPreview(imgel){
	var preview = document.createElement('img');
	var src = imgel.firstChild.getAttribute('src');
	src=src.replace(/thumbnail/,"preview");
	preview.setAttribute('src',src);
	preview.setAttribute('style','position:absolute;');
	preview.setAttribute('id','preview');
	preview.setAttribute('class','border');
	imgel.appendChild(preview);
	activePreview=true;
}

function hidePreview(imgel){
	if (imgel.lastChild.getAttribute('id')=='preview'){
		imgel.removeChild(imgel.lastChild);
		activePreview=false;
	}
}

function recalcSum(priceel,state) {
	
	// check User-Input (Input must be a Number)
	if (priceel.value=='') priceel.value=0;
	var changeToNumberType = Math.round(parseFloat(priceel.value));
	
	if (isNaN(changeToNumberType)){
		document.getElementById('response').innerHTML = "Please type in a valid number"; 
		priceel.value='0';
	}else{
		priceel.value = changeToNumberType;
		document.getElementById('response').innerHTML = "Recalculated Price"; 
		
		var priceid=(priceel.name.split("_"))[0];
		
		price = (document.getElementById(priceid+'_price').innerHTML).split(" ");
		
		var sum = price[0] * changeToNumberType;
		document.getElementById(priceid+'_sum').innerHTML = sum.toFixed(2)+" "+price[1];
	}
	
	if (state!='edit')
		recalcSumTotal();
}

function recalcSumTotal() {

	var txtflds = document.getElementsByTagName("input");
	var txtinform = new Array();
	for (i=0,j=0;i<txtflds.length;i++){
		if (txtflds[i].type=='text'){
			txtinform[j++] = (txtflds[i].name.split("_"))[0];
		}
	}
	
	currency='';
	var sumTotal = parseFloat(0);
	for (i=0;i<txtinform.length;i++){
		sumTotal+=parseFloat(document.getElementById(txtinform[i]+'_sum').innerHTML);
		currency = (document.getElementById(txtinform[i]+'_sum').innerHTML).split(" ")[1];
	}

	document.getElementById('totalSum').innerHTML = sumTotal.toFixed(2)+" "+currency;
}

function recalcAllSums(){
	
	var txtflds = document.getElementsByTagName("input");
	var txtinform = false;
	for (i=0;i<txtflds.length;i++){
		if (txtflds[i].type=='text'){
			recalcSum(txtflds[i],'edit');
			txtinform = true;
		}
	}
	if (txtinform){
		recalcSumTotal();
	}
}

