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() {	
                	this.className="mbghover";
					//alert(this.className);
					/*this.style.backgroundRepeat="repeat-x";this.className="mbghover";*/
                   /* display the inner menu */
                   this.lastChild.style.display="block";
                }
                lis[i].onmouseout=function() {                       
                   this.lastChild.style.display="none";
				   //this.style.background="";
				   this.className="mbghover";
                }
            }
        }
    }
}
window.onload= function(){
    /* pass the function the id of the top level UL */
    /* remove one, when only using one menu */
    activateMenu('nav');
}

function secure_login()
{
	obj = document.getElementById("login_box");
	
	if(obj)
	{
		if(obj.style.display == "none" || obj.style.display == "")
		{
			obj.style.visibility = "visible";
			obj.style.display = "block";
		}

		if(document.getElementsByName("username")[0])
		{
			document.getElementsByName("username")[0].focus();
		}		
	}	
}

function secure_login_close(){
	obj = document.getElementById("login_box");
	
	if(obj)
	{
		obj.style.display = "none";
	}
}

function drawMenu(){
	document.write ("<ul id=\"nav\"> ");	
	document.write ("<li ><a class=\"menu1\" href=\"#\"> Affiliate Product Toolkit</a><ul>");
	document.write ("<li><a href=\"ssl-html-template.html\">SSL HTML Template</a></li>");
	document.write ("<li><a href=\"hackerproof-html-template.html\">HackerProof HTML Template</a></li>");
	document.write ("<li><a href=\"ssl-website-banners.html\">SSL Website Banners</a></li>");
	document.write ("<li><a href=\"hp-website-banners.html\">HackerProof Website Banners</a></li>");
	document.write ("<li><a href=\"logopage.html\">Official Affiliate & Partner Logos</a></li></ul>");
	document.write ("</li>")
	
	document.write ("<li><a class=\"menu2\" href=\"join.html\">Become a Comodo Affiliate Partner</a>");
	document.write ("</li>");
	
	document.write ("<li><a class=\"menu3\" href=\"resource.html\">Affiliate Resources</a>");
	document.write ("</li>")

	document.write ("<li><a class=\"menu4\" href=\"aboutcomodo.html\">About Comodo</a>");
	document.write ("</li>");
	document.write ("</ul>");
}


/* Bookmark script */

function bookmarksite(){
var ptitle=document.getElementsByTagName('title')[0];
var title=ptitle.innerHTML;
var url= window.location.href;

if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}
