// --------------------------------------------------------------------------
// on mouse over button -----------------------------------------------------
// --------------------------------------------------------------------------

function mouseOver(id)
{
	var obj = document.getElementById(id);
	obj.className = 'onmouseover_button';
}


function mouseOut(id)
{
	var obj = document.getElementById(id);
	obj.className = 'onmouseout_button';
}

// --------------------------------------------------------------------------
// validation ---------------------------------------------------------------
// --------------------------------------------------------------------------


function cek_receiver(formname)
{	
	if (document.getElementById('receiver_name').value!='' && document.getElementById('address').value!='' && document.getElementById('city').value!='')
	{
		return (true);
	}
	else
	{
		alert("Mohon lengkapi kolom dengan tanda '*'");
		return (false);
	}
}

function cek_buy_agreement(formname)
{	
	if (document.forms[formname].agree.checked==true && document.getElementById('receiver_name').value!='' && document.getElementById('address').value!='' && document.getElementById('city').value!='')
	{
		return (true);
	}
	else
	{
		alert("You must agree to the terms and conditions to continue");
		return (false);
	}
}


// --------------------------------------------------------------------------
// small window -------------------------------------------------------------
// --------------------------------------------------------------------------

self.name='mainWindow';

function MM_openBrWindow(theURL,winName,features) 
{ 
  window.open(theURL,winName,"width=450, height=500, scrollbars=yes");
}

function MM_openPrintWindow(theURL,winName,features) 
{ 
  window.open(theURL,winName,"width=700, height=600, scrollbars=yes");
}


// --------------------------------------------------------------------------
// add to chart -------------------------------------------------------------
// --------------------------------------------------------------------------
function go(kode)
{
	if(kode=='') opener.location.href="index.php";
	else opener.location.href="cart.php?kode="+kode+"&jumlah=0&submit=go&showComplementary=<?php echo $_GET['showComplementary']; ?>";
	self.close();
} 

function goFromDetailProd(kode,formname)
{
	//var obj = document.forms[formname].destination;
	//var dest = obj.value;
	var dest = '';
	if(kode=='') opener.location.href="index.php";
	else opener.location.href="cart.php?kode="+kode+"&dest="+dest+"&jumlah=0&submit=go";
	self.close();
} 

function closeWindow()
{
	self.close();
} 

function reloadWindow()
{
	self.reload();
	self.close();
} 


