  
  function changeBG(PID,STS)
  {
    if (STS == 'hover')
    {
      //document.getElementById("div" + PID).style.backgroundColor = '#F9F8F7';
      document.getElementById("div" + PID).style.border = '1px solid #CABCB4';
    }
    if (STS == 'none')
    {
      //document.getElementById("div" + PID).style.backgroundColor = '#FFFFFF';
      document.getElementById("div" + PID).style.border = '1px solid #FFFFFF';
    }
  }
  
  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 changeBG3(PID,STS)
  {
    if (STS == 'hover')
    {
      //document.getElementById("divb" + PID).style.backgroundColor = '#FFFFFF';
      document.getElementById("divb" + PID).style.borderRight  = '1px solid #CABCB4';
      document.getElementById("divb" + PID).style.borderTop    = '1px solid #CABCB4';
      document.getElementById("divb" + PID).style.borderBottom = '1px solid #CABCB4';
    }
    if (STS == 'none')
    {
      //document.getElementById("divb" + PID).style.backgroundColor = '#F9F8F7';
      document.getElementById("divb" + PID).style.borderRight  = '1px solid #F9F8F7';
      document.getElementById("divb" + PID).style.borderTop    = '1px solid #F9F8F7';
      document.getElementById("divb" + PID).style.borderBottom = '1px solid #F9F8F7';
    }
  }
  
  function changeBG4(PID,STS)
  {
    if (STS == 'hover')
    {
      document.getElementById("divc" + PID).style.border = '1px solid #CABCB4';
    }
    if (STS == 'none')
    {
      document.getElementById("divc" + PID).style.border = '1px solid #FFFFFF';
    }
  }
  
	// 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');
	}
	
