﻿function doCookieTest()
{
    var msg;
//    return true;
    if ( window.navigator.cookieEnabled )
    {
		return true;
	}
	else
	{
		msg = "Cookies are not enabled on this browser! \n\n";
		msg += "Please enable cookies in your browser in order to be able to buy from our store. You will not be able to access systems requiring authentication if your cookies are disabled.";
		window.alert( msg );
		return false;
	}
}



function update_subtotals (itemscnt)
{
	if ( doCookieTest() )
	{
		params_str = "cart_update.php?params=" + (2*itemscnt+1) ;
		if ( itemscnt == 1)
		{
			params_str = params_str + "&id" + 1 + "=" + document.thecart.cartid.value + "&qty" + 1 + "=" + document.thecart.cartqty.value;
		}
		else
		{
			for (var i=0; i < itemscnt; i++)
			{
				j = i + 1;
				params_str = params_str + "&id" + j + "=" + document.thecart.cartid[i].value + "&qty" + j + "=" + document.thecart.cartqty[i].value;
		 	}
		}
		document.thecart.action = params_str + document.thecart.mysid.value;
		return true;
	}
	else
	{
		return false;
	}
}








var winModeless_CertSRAC
var winModeless_CertIQNet
	
function Arata_Certificat_SRAC()
{
    window.open ("s_cert_srac.php","cert_srac","dependent=yes,width=601,height=850,resizable=no")
}

function Arata_Certificat_IQNet()
{
    window.open ("s_cert_iqnet.php","cert_iqnet","dependent=yes,width=601,height=850,resizable=no")
}




var winModal_CalcRate
	 
function IgnoreEvents(e)
{
  return false
}
 
function ShowCalcRate()
{
  if (window.showModalDialog)
  {
    window.showModalDialog("s_calculator_rate_iunie.php","Calculator de Rate",
    "dialogWidth=500px;dialogHeight=500px")
  }
  else
  {
    window.top.captureEvents (Event.CLICK|Event.FOCUS)
    window.top.onclick=IgnoreEvents
    window.top.onfocus=HandleFocus 
    winModal_CalcRate = 
    window.open ("s_calculator_rate_iunie.php","ModalChild",
       "dependent=yes,width=500,height=500")
    winModal_CalcRate.focus()
  }
}

 
function HandleFocus()
{
  if (winModal_CalcRate)
  {
    if (!winModal_CalcRate.closed)
    {
      winModal_CalcRate.focus()
    }
    else
    {
      window.top.releaseEvents (Event.CLICK|Event.FOCUS)
      window.top.onclick = ""
    }
  }
  return false
}
