function CL()
{
window.close();
}
function CLREL()
{
window.opener.location.reload();
window.close();
}
function CLREL1()
{
window.opener.location.reload();
}
function REL(url)
{
location.href=url;
}
function miniWin(url,w,h)
{
window.open(url,"_blank","left=400,top=100,width="+w+",height="+h+",location=0,menubar=0,resizable=0,scrollbars=1,status=0");
}
function LoadIMG(w,h)
{
var uric=document.forms.product_edit.img.value;
var uri="image_load.php?img="+uric;
window.open(uri,"_blank","left=100,top=100,width="+w+",height="+h+",location=0,menubar=0,resizable=0,scrollbars=1,status=0");
}
function LoadIMG2(w,h)
{
var uric=document.forms.product_edit.bimg.value;
var uri="image_load.php?img="+uric;
window.open(uri,"_blank","left=100,top=100,width="+w+",height="+h+",location=0,menubar=0,resizable=0,scrollbars=1,status=0");
}
function Order()
{
window.open("order.php","_blank","left=100,top=100,width=400,height=500,location=0,menubar=0,resizable=0,scrollbars=1,status=0");
window.close();
}
function Rating(w,h)
{
var id=window.document.rating.productID.value;
var rat=window.document.rating.rating_new.value;
var uri="shop/rating_write.php?productID="+id+"&rating_new="+rat;
window.open(uri,"_blank","left=100,top=100,width="+w+",height="+h+",location=0,menubar=0,resizable=0,scrollbars=1,status=0");
}

CountActive = true;
CountStepper = -1;
LeadingZero = true;
DisplayFormat = "%%H%% : %%M%% : %%S%% ";

CountStepper = Math.ceil(CountStepper);
if (CountStepper == 0) CountActive = false;
var SetTimeOutPeriod = (Math.abs(CountStepper)-1)*1000 + 990; 

function CountBack_All(secs, id) {

  var seconds = secs;
	
   
  // days
  var days  = Math.ceil(secs / 86400) - 1;
  secs -= days * 86400;
  
  
  // hours
  var hours = Math.ceil(secs / 3600) - 1;
  secs -= hours * 3600;
  
  // minutes
  var mins  = Math.ceil(secs / 60) - 1;
  secs -= mins * 60;
     
  if (days < 10) {
	  days = '0'+days;
	  }
  if (hours < 10) {
	  	hours = '0'+hours;
	  }
	  
  if (mins < 10) {
	  	mins = '0'+mins;
	  } 
  
  if (secs < 10) {
	  	secs = '0'+secs;
	  } 
  
  if (document.getElementById(id+'days'))	 document.getElementById(id+'days').innerHTML  = days; 
  if (document.getElementById(id+'hrs'))	 document.getElementById(id+'hrs').innerHTML = hours;
  if (document.getElementById(id+'min'))	 document.getElementById(id+'min').innerHTML  = mins;
  if (document.getElementById(id+'sec'))	 document.getElementById(id+'sec').innerHTML  = secs;
  
  
  
  if (CountActive) setTimeout("CountBack_All("+(seconds+CountStepper)+", '"+ id+"')", SetTimeOutPeriod);
} 
