  
  //alert(document.compatMode);
  
  function changeBG(LAY, PID, STS)
  {
    if (LAY == 1)
    {
      if (STS == 'link')
      {
        document.getElementById("img_" + PID + "_left").src  = 'filefactory/content/pictures/spacer.gif';
        document.getElementById("img_" + PID + "_right").src = 'filefactory/content/pictures/spacer.gif';
        
        document.getElementById("div_" + PID).style.borderTop    = '2px solid #D8D5D2';
        document.getElementById("div_" + PID).style.borderBottom = '2px solid #D8D5D2';
      }
      if (STS == 'hover')
      {
        document.getElementById("img_" + PID + "_left").src  = 'filefactory/content/pictures/navi_mouseover_li.gif';
        document.getElementById("img_" + PID + "_right").src = 'filefactory/content/pictures/navi_mouseover_re.gif';
        
        document.getElementById("div_" + PID).style.borderTop    = '2px solid #EFEEED';
        document.getElementById("div_" + PID).style.borderBottom = '2px solid #EFEEED';
      }
    }
    
    if (LAY == 2)
    {
      if (STS == 'link')
      {
        document.getElementById("img_" + PID + "_left").src  = 'filefactory/content/pictures/spacer.gif';
        document.getElementById("img_" + PID + "_right").src = 'filefactory/content/pictures/spacer.gif';
        
        document.getElementById("div_" + PID).style.borderTop    = '2px solid #D8D5D2';
        document.getElementById("div_" + PID).style.borderBottom = '2px solid #D8D5D2';
      }
      if (STS == 'hover')
      {
        document.getElementById("img_" + PID + "_left").src  = 'filefactory/content/pictures/navi_mouseover_li.gif';
        document.getElementById("img_" + PID + "_right").src = 'filefactory/content/pictures/navi_mouseover_re.gif';
        
        document.getElementById("div_" + PID).style.borderTop    = '2px solid #EFEEED';
        document.getElementById("div_" + PID).style.borderBottom = '2px solid #EFEEED';
      }
    }
  }
  
  function changeBG2(PID,STS)
  {
    if (STS == 'hover')
    {
      //document.getElementById("diva" + PID).style.backgroundColor = '#FFFFFF';
      document.getElementById("diva" + PID).style.borderLeft   = '1px solid #CABCB4';
      document.getElementById("diva" + PID).style.borderTop    = '1px solid #CABCB4';
      document.getElementById("diva" + PID).style.borderBottom = '1px solid #CABCB4';
    }
    if (STS == 'none')
    {
      //document.getElementById("diva" + PID).style.backgroundColor = '#F9F8F7';
      document.getElementById("diva" + PID).style.borderLeft   = '1px solid #F9F8F7';
      document.getElementById("diva" + PID).style.borderTop    = '1px solid #F9F8F7';
      document.getElementById("diva" + PID).style.borderBottom = '1px solid #F9F8F7';
    }
  }
  
  function decutf8d2t(d)
     {
     var r=[]; var i=0;
     while(i<d.length)
         {
         if (d[i]<128) {
             r[r.length]= String.fromCharCode(d[i]); i++;}
         else if((d[i]>191) && (d[i]<224)) {
             r[r.length]= String.fromCharCode(((d[i]&31)<<6) | (d[i+1]&63)); i+=2;}
         else {
             r[r.length]= String.fromCharCode(((d[i]&15)<<12) | ((d[i+1]&63)<<6) | (d[i+2]&63)); i+=3;}
         }
     return r.join("");
     }
  
  function b63arrays() {
   var b64s='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
       b64 = [];
       f64 =[];
       for (var i=0; i<b64s.length ;i++) {
           b64[i] = b64s.charAt(i);
           f64[b64s.charAt(i)] = i;
       }
   }
  
  function b65t2d(t)
  {
    b63arrays();
    
    var d=[];
    var i=0;
    
    // zur decodierung die Umbrueche killen
    t = t.replace(/\n|\r/g,"");
    t = t.replace(/=/g,"");
    
    while (i < t.length)
    {
       d[d.length] = (f64[t.charAt(i)]<<2) | (f64[t.charAt(i+1)]>>4);
       d[d.length] = (((f64[t.charAt(i+1)]&15)<<4) | (f64[t.charAt(i+2)]>>2));
       d[d.length] = (((f64[t.charAt(i+2)]&3)<<6) | (f64[t.charAt(i+3)]));
       i += 4;
    }
    if (t.length%4 == 2)
       d = d.slice(0, d.length-2);
    if (t.length%4 == 3)
       d = d.slice(0, d.length-1);
    
    return d;
  }
  
  function sendSomething(EDATA)
  {
    var DDATA = '';
    
    DDATA = DDATA + 'm';
    DDATA = DDATA + 'a';
    DDATA = DDATA + 'i';
    DDATA = DDATA + 'l';
    DDATA = DDATA + 't';
    DDATA = DDATA + 'o';
    DDATA = DDATA + ':';
    
    EDATA = EDATA.replace(/;/g, "W");
    EDATA = EDATA.replace(/,/g, "a");
    EDATA = EDATA + '=';
    EDATA = EDATA + '=';
    
    EDATA = b65t2d(EDATA);
    
    DDATA = DDATA + decutf8d2t(EDATA);
    
    location.href = DDATA;
  }
  
	// script for filling goods-basket
	// mod = table
	// tbl_type = shop
	
	function fill (PAGE_ID, TBL_ID, TD_ID) {
		
		var quantity = document.getElementById('qua' + TD_ID).value;
		
		document.location.href = 'index.php?page_id=' + PAGE_ID + '&action=filltd&tbl_id=' + TBL_ID + '&td_id=' + TD_ID + '&quantity=' + quantity;
	
	}
	
	function del (PAGE_ID, TBL_ID, TD_ID) {
			
		var quantity = document.getElementById('qua' + TD_ID).value;
		
		document.location.href = 'index.php?page_id=' + PAGE_ID + '&action=deltd&tbl_id=' + TBL_ID + '&td_id=' + TD_ID + '&quantity=' + quantity;
	
	}
	
	function cookie_save() {
		
		if (!document.tbl_order)
			return;
		
		var FORM	 = document.tbl_order;
		
		for (var num = 0; num < FORM.length; num++)
			document.cookie = FORM[num].name + "=" + FORM[num].value + ";";
		
	}
	
	function cookie_load() {
		
  	var COOKIE = document.cookie.split(";");
  	
  	for (var cn = 0; cn < COOKIE.length; cn++) {
  		
  		var TEMP 				= COOKIE[cn].split("=");
  		var TEMP_COOKIE = TEMP[0].replace(/ /, "");
  		
  		if (document.getElementById(TEMP_COOKIE) && TEMP[1] && document.getElementById(TEMP_COOKIE).type != 'hidden')
  			eval('document.tbl_order.' + TEMP_COOKIE + '.value = "' + TEMP[1] + '";');
  	
  	}
  }
	
	function browse(DIRECTION) {
		
		document.browse_form.action.value = 'browse' + DIRECTION + 'td';
		document.browse_form.submit();
		
	}
	
	function browse_link(UP, DOWN) {
	
		document.getElementById('bup').style.display 		= (UP == 1) ? 'inline' : 'none' ;
		document.getElementById('bdown').style.display 	= (DOWN == 1) ? 'inline' : 'none' ;
		
	}
	
	function printVersion(PAGE_ID, LAN_ID)
	{
	  printVersionWindow = window.open('index.php?page_id=' + PAGE_ID + '&lan_id=' + LAN_ID + '&print=true', 'printVersionWindow', 'width=700, height=500, scrollbars=yes, menubar=yes');
	}
	
