function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}
function checksearchForm() {
	if(document.getElementById('search').value  == "" || document.getElementById('search').value == "enter keyword(s) here")
	{
		alert("Please enter a search term!");
	  	return false;
	}
	return true;
}
function eraseCookie(name) {
	createCookie(name,"",-1);
}


activateMenu = function(nav) {
    /* currentStyle restricts the Javascript to IE only */
	if (document.all && document.getElementById(nav).currentStyle) {  
        var navroot = document.getElementById(nav);
        
        /* Get all the list items within the menu */
        var lis=navroot.getElementsByTagName("LI");  
        for (i=0; i<lis.length; i++) {
        
           /* If the LI has another menu level */
            if(lis[i].lastChild.tagName=="UL"){
            
                /* assign the function to the LI */
             	lis[i].onmouseover=function() {	
                
                   /* display the inner menu */
                   this.lastChild.style.display="block";
                }
                lis[i].onmouseout=function() {                       
                   this.lastChild.style.display="none";
                }
            }
        }
    }
}
window.onload= function(){
    /* pass the function the id of the top level UL */
    /* remove one, when only using one menu */
    //activateMenu('nav');
	
}
function GetParam(name){ /*Returns values from location urls and assigns to reference variable*/
var start=location.search.indexOf("?"+name+"=");
if (start<0) start=location.search.indexOf("&"+name+"=");
if (start<0) return '';
start += name.length+2;
var end=location.search.indexOf("&",start)-1;
if (end<0) end=location.search.length;
var result=location.search.substring(start,end);
var result='';
for(var i=start;i<=end;i++) {
	var c=location.search.charAt(i);
	result=result+(c=='+'?' ':c);}
return unescape(result);
}

var apvalue='';
function append_query_string()
{
	apvalue=GetParam('ap');
 	if(apvalue != "")
	{
		a_href = document.getElementsByTagName("a");
 		// alert(a_href.length);
		for(i=0;i<a_href.length;i++)
		{
		 
			var linkurl = a_href[i].href;
			if(a_href[i].className != "exclude")
			{
				if(linkurl.indexOf("&ap=") == -1)
				{
					if(linkurl.indexOf("http://www.hackerguardian.com")!=-1)
					{
						if(linkurl.indexOf("?")!=-1)
						{
								 
								ap_text = a_href[i].href.split("ap=");
								if(ap_text && ap_text.length > 1)
								{
									a_href[i].href;
								}
								
								else
								{
									a_href[i].href =  + "&ap=" + apvalue;
								}
								
								
							
						}
						else
						{
							a_href[i].href = a_href[i].href + "?ap=" + apvalue;						 
						}
					}
				}
				else
				{
					if(linkurl.indexOf("&entryURL=")!=-1)
					{
						EntUrlArr = linkurl.split("&entryURL=");
						var EntUrl = unescape(EntUrlArr[1]);
						var QapStr = "ap=" + apvalue;
						while (EntUrl.indexOf(QapStr) > -1)
						{
							EntUrl = EntUrl.replace(QapStr,"");
						}
						a_href[i].href = EntUrlArr[0] + "&entryURL=" + EntUrl;
					}
				}
			}
		}
	}
}
function drawMenu(){
	document.write("<div class='searchlabel'>Search: </div>\
<FORM name='search' style='display:inline;' METHOD='GET' ACTION='http://search.instantssl.com/cgi-bin/ts.pl'><INPUT TYPE='HIDDEN' NAME='index' VALUE='428374'>\
<input type='text' name='query' class='searchbox' value='Enter Search Text Here' onclick='this.value=\"\"'/><div style='position:absolute;right:10px;top:6px;'>\
<a href='#' onclick='document.search.submit();'><img src='http://www.instantssl.com/ssl-certificate-images/search.gif'></a></div></FORM>");
	document.write ("<ul id=\"nav\"> ");	
	document.write ("<li><a href=\"/pci-compliance/products.html\" style=\"padding-left:15px;width:85px;\">SSL Products</a>");
	document.write ("</li>");
	document.write ("<li><a href=\"/pci-compliance/solutions_online_reseller.html\" style=\"width:120px;\">SSL Reseller Program</a>");
	document.write ("</li>");
	document.write ("<li><a href=\"/pci-compliance/addsupport/ssl-instantssl_free.html\" style=\"width:90px;\">Special Offers</a>");
	document.write ("</li>")
	document.write ("<li><a href=\"/ssl-certificate-corporate/ssl-certificate-index.html\" style=\"width:65px;\">Corporate</a>");
	document.write ("</li>");
	document.write ("<li><a href=\"http://support.comodo.com\" style=\"width:85px;\">SSL Support</a>");
	document.write ("</li>");
	document.write ("<li><a href=\"/ssl-certificate-international/ssl-certificate-index.html\" style=\"width:65px;\">International</a>");
	document.write ("</li>");
	document.write ("</ul>");
	
	
}
function goSite(url){
window.location=url;
}

function popitup(url)
{
newwindow=window.open(url,'name','height=750,width=470,scrollbars=yes');
	if (window.focus) {newwindow.focus()}
	return false;
}


function drawCart(option){
	
var str='';
str+='<div id="shopcart">';
str+='<img src="/ssl-certificate-images/inner/shoptop.jpg">';
str+='<div class="addbox">';


str+='<div class="items"><h3>Shopping Cart<\/h3>';
str+='<ul>';
str+='<li style="display:block;"><table width="100%" border="0" cellpadding="0" cellspacing="0">';
str+='<tr><td align="left" valign="top">Product:<\/td><td align="right" valign="top"><span id="shop_product"><\/span><\/td><\/tr><\/table>';
str+='<\/li>';
str+='<li style="display:block;"><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td align="left" valign="top">Product Term:<\/td><td align="right" valign="top">';
str+='<span id="shop_term"><\/span><\/td><\/tr><\/table><\/li>';
str+='<\/ul><table width="100%" border="0" cellpadding="0" cellspacing="0">';
str+='<tr><td align="left" valign="top"><h4>Total Price:</h4><\/td><td align="right" valign="top"><h4><span style="color:#CC3333;" id="shop_price"><\/span><\/h4><\/td><\/tr><\/table>';

if (option=='checkout'){
str+='<br \/>';}

else if (option=='pci'){
	str+='<a href="\/hackerguardian\/buy\/ip_pack.html"><img src="\/ssl-certificate-images\/inner\/proceed.gif" onmouseout="this.src=\'\/ssl-certificate-images\/inner\/proceed.gif\';" onmouseover="this.src=\'\/ssl-certificate-images\/inner\/proceed_hot.gif\';"><\/a><br \/>';

}




else
str+='<a href="\/pci-compliance\/addsupport\/ssl-purchase.html"><img src="\/ssl-certificate-images\/inner\/proceed.gif" onmouseout="this.src=\'\/ssl-certificate-images\/inner\/proceed.gif\';" onmouseover="this.src=\'\/ssl-certificate-images\/inner\/proceed_hot.gif\';"><\/a><br \/>';

if (option=='disable'){
str+='';
}


else if (option=='ac'){
str+='<a href="\/pci-compliance\/ssl-ac-options.html" ><img src="\/ssl-certificate-images\/inner\/buymore.gif" onmouseout="this.src=\'\/ssl-certificate-images\/inner\/buymore.gif\';" onmouseover="this.src=\'\/ssl-certificate-images\/inner\/buymore_hot.gif\';" style="margin-top:5px;"><\/a>';
}
else if (option=='trust'){
str+='<a href="\/pci-compliance\/ssl-trust-options.html" ><img src="\/ssl-certificate-images\/inner\/buymore.gif" onmouseout="this.src=\'\/ssl-certificate-images\/inner\/buymore.gif\';" onmouseover="this.src=\'\/ssl-certificate-images\/inner\/buymore_hot.gif\';" style="margin-top:5px;"><\/a>';
}
else if (option=='checkout'){
str+='';
}

else {
str+='<a href="\/pci-compliance\/products.html" ><img src="\/ssl-certificate-images\/inner\/buymore.gif" onmouseout="this.src=\'\/ssl-certificate-images\/inner\/buymore.gif\';" onmouseover="this.src=\'\/ssl-certificate-images\/inner\/buymore_hot.gif\';" style="margin-top:5px;"><\/a>';
}
str+='<\/div>';

str+='<\/div>';
str+='<img src="/ssl-certificate-images/inner/shopbot.jpg"><br><br>';

str+='<p style="text-align:center;"><object classid="CLSID:2D5E36D5-C74F-4A57-A0AD-6D9F783FEA56" id="ESigil" width="166" height="71">';
str+='<param name="CertLocation" value="https://www.hackerguardian.com/cvc/2236150.cer" />';
TrustLogo(false, 'CCPLG');
str+='<span onClick="return TrustLogo_Credentials(event, \'CCPLG\');"';
str+='onMouseOver="return TrustLogo_MouseOver(event, \'CCPLG\');"';
str+='onMouseMove="return TrustLogo_MouseMove(event, \'CCPLG\');"';
str+='onMouseOut="return TrustLogo_MouseOut(event, \'CCPLG\');">';
str+='<img src="https://www.hackerguardian.com/cvc/2236150.gif" width="166" height="71" border="0">';
str+='</span>';
str+='</object>';
str+='<br \/><br /><a href="/pci-compliance/ssl-cvc.html" target="_blank">Prove the legitimacy of your card logos</a><br \/></p>';
str+='<\/div>';

if (option=='disable2'){
str='';
}

document.write(str);
document.write('<script type="text/javascript" src="/javascript/shopcart.js"></script>');
}

function drawLive(){
//document.write('<a href="#"><img src="/ssl-certificate-images/liveperson/reponline.gif" class="ssllivesupport"></a>');

document.write('<div style="position:absolute;right:317px;top:24px;">');
document.write('<script type="text/javascript"  src="http://c3.chatsupportlive.com/js/status_image.php?base_url=http://c3.chatsupportlive.com&l=comodo4support&x=78&deptid=190&"><a href="http://www.phplivesupport.com"></a></script>');
document.write('</div>');
}

function LoadScript(url)
{
   var e = document.createElement("script");
   e.src = url;
   e.type = "text/javascript";
   document.getElementsByTagName("head")[0].appendChild(e);
}
gg_currency=readCookie('currency');

function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,resizable=0,width=420,height=400,left = 302,top = 184');");
}

function close_window() 
{
if (newwindow) newwindow.close()
}



//image cache for faster rollovers
if (document.images) {
img1 = new Image();
img2 = new Image();
img3 = new Image();
img4 = new Image();
img5 = new Image();
img6 = new Image();
img7 = new Image();
img8 = new Image();
img9 = new Image();
img10 = new Image();
img11 = new Image();
img12 = new Image();
img13 = new Image();
img14 = new Image();
img15 = new Image();
img16 = new Image();
img17 = new Image();
img18 = new Image();
img19 = new Image();
img20 = new Image();
img21 = new Image();
img22 = new Image();
img23 = new Image();
img24 = new Image();
img25 = new Image();
img26 = new Image();
img27 = new Image();
img28 = new Image();
img29 = new Image();
img30 = new Image();
img31 = new Image();
img32= new Image();
img33= new Image();
img34= new Image();
img35= new Image();
img36= new Image();
img37= new Image();
img38= new Image();
img39= new Image();
img40= new Image();
img41= new Image();
img42= new Image();
img43= new Image();
img44= new Image();
img45= new Image();
img46= new Image();
img1.src = "/ssl-certificate-images/header/head_gobtn.gif";
img2.src = "/ssl-certificate-images/header/head_gobtn_h.gif";
img3.src = "/ssl-certificate-images/header/freessl_o1.gif";
img4.src = "/ssl-certificate-images/header/freessl_o.gif";
img5.src = "/ssl-certificate-images/header/iknowwhich_o1.gif";
img6.src = "/ssl-certificate-images/header/iknowwhich_o.gif";
img7.src = "/ssl-certificate-images/header/knewyourcertificate_o1.gif";
img8.src = "/ssl-certificate-images/header/knewyourcertificate_o.gif";
img9.src = "/ssl-certificate-images/inner/proceed_hot.gif";
img10.src = "/ssl-certificate-images/inner/proceed.gif";
img11.src = "/ssl-certificate-images/inner/buymore_hot.gif";
img12.src = "/ssl-certificate-images/inner/buymore.gif";
img13.src = "/ssl-certificate-images/inner/addtoshopping_hot.gif";
img14.src = "/ssl-certificate-images/inner/addtoshopping.gif";
img15.src = "/ssl-certificate-images/inner/buynow2.gif";
img16.src = "/ssl-certificate-images/inner/buynow1.gif";
img17.src = "/images/index/learnmore.gif";
img18.src = "/images/index/learnmore2.gif";
img19.src = "/images/index/newtossla.jpg";
img20.src = "/images/index/newtossl.jpg";
img21.src = "/images/index/helpmedecidea.jpg";
img22.src = "/images/index/helpmedecide.jpg";
img23.src = "/images/index/r32.jpg";
img24.src = "/images/index/r33.jpg";
img25.src = "/images/index/r34.jpg";
img26.src = "/images/index/r34a.jpg";
img27.src = "/images/index/r33a.jpg";
img28.src = "/images/index/r32a.jpg";
img29.src = "/images/index/mainlearn_o.gif";
img30.src = "/images/index/mainbuy_o.gif";
img31.src = "/images/index/mainlearn_n.gif";
img32.src = "/images/index/mainbuy_n.gif";
img33.src = "/images/index/buybtn.gif";
img34.src = "/images/index/buybtn2.gif";
img35.src = "/images/index/trybtn.gif";
img36.src = "/images/index/trybtn2.gif";
img37.src = "/images/index/qlinks_nrm.gif";
img38.src = "/images/index/qlinks_hot.gif";
img39.src = "/ssl-certificate-images/inner/change.gif";
img40.src = "/ssl-certificate-images/inner/change_hot.gif";
img41.src = "/images/index/try_hot.jpg";
img42.src = "/images/index/try_nrm.jpg";
img43.src = "/images/index/bbb_buy.jpg";
img44.src = "/images/index/bbb_buy_hot.jpg";
img45.src = "/images/index/bbb_learn.jpg";
img46.src = "/images/index/bbb_learn_hot.jpg";
}
//end image cache



function popLogin(type){
if (type=="hg"){
var url="https://www.hackerguardian.com/login.html";
}


   w = document.body.clientWidth;
   h = document.body.clientHeight;


var popW = 412, popH = 168;

var leftPos = (w-popW)/2, topPos = (h-popH)/2;

if (type=="hg"){
window.open('https://www.hackerguardian.com/login.html','name','height=174,width=414,scrollbars=yes,menubar=yes,resizable=yes,top=200,left='+leftPos+'');
}
else if (type=="sm"){
location.href="https://sitemon.hackerguardian.com/sitemon/pages/Welcome.jsp";
}

}

function end(){
	document.forms['loginForm'].reset();
}
function ssl_livechat(){
	window.open('/livechat/chatpopup.html','ChatSupport','width=350,height=260,scroll=0,status=no');
}
//display current year automatically
function copyRightYear()
{
	var currentTime = new Date();
	var year = currentTime.getFullYear();
	return year;
}
