// JavaScript Document

function certPopup(sTargetUrl)
{
	if(!checkCookie("certWarning"))
	{
		document.open("certwarning.htm","_blank","menubar=no,toolbar=no,status=no,height=300,width=225");
	}
	else 
	{
		document.open(sTargetUrl,"_blank")
	}
}

function setCookie(sName, sValue)
{
  date = new Date();
  document.cookie = sName + "=" + escape(sValue) + "; expires=" + "01 Jan 2010 00:00:00 GMT";
  alert("Cookie Set");
}

function checkCookie(sName)
{
	
	if(document.cookie == null)
		return false;
		
  // cookies are separated by semicolons
  var aCookie = document.cookie.split("; ");
  for (var i=0; i < aCookie.length; i++)
  {
	  	// a name/value pair (a crumb) is separated by an equal sign
    	var aCrumb = aCookie[i].split("=");
    	if (sName == aCrumb[0]) 
      		return unescape(aCrumb[1]);
  }

  // a cookie with the requested name does not exist
  return false;
}

