var searchLink;
var searchError;

function startList() {
	
	var opsys = (navigator.userAgent.indexOf('Mac') == -1)
	if(document.all&&document.getElementById&&opsys) {
		navRoot = document.getElementById("nav");
		if(navRoot != null) {
			for(i=0; i<navRoot.childNodes.length; i++) {
				node = navRoot.childNodes[i];
				if(node.nodeName=="LI") {
					node.onmouseover=function() {
						this.className+=" over";
					}
					node.onmouseout=function() {
						this.className=this.className.replace(" over", "");
					}
				}
			}
		}
	}
}

function PopIt(url,width,height,options){
	if(typeof(url)!='undefined'){
		if(typeof(width)=='undefined')width=600;
		if(typeof(height)=='undefined')height=500;
		if(typeof(options)=='undefined')options='status=no,scrollbars=auto,location=no,menubar=no,resizable=yes,toolbar=0';
		window.open(url,'chopra','width='+width+',height='+height+','+options);
	}
} 

function sendSearch() {
	var st = document.getElementById("st");
	
	if(st != null) {
		var val = st.value;

		if(val!=''){
			document.location.href='http://search.chopra.com/search?entqr=0&output=xml_no_dtd&sort=date%3AD%3AL%3Ad1&entsp=0&lr=lang_en&client=www_chopra&ud=1&oe=UTF-8&ie=UTF-8&proxystylesheet=www_chopra&site=www_chopra&q=' + val;
			return false;
		}
		else{
			alert("Please enter search keyword.");
		}
	}
}

function sendEmail() {
	var em = document.getElementById("em");
	
	if(em != null) {
		var val = em.value;

		if(val!=''){
			document.location.href='/124444.html?e=' + val;
			return false;
		}
		else{
			alert("Please enter email address.");
		}
	}
}


function submitSearchOnEnter() {
	if (event.keyCode == 13)  {
		sendSearch();
		return false;
	}
}

function submitEmailOnEnter() {
	if (event.keyCode == 13)  {
		sendEmail();
		return false;
	}
}


window.onload=startList;
