/*<![CDATA[*/
<!--
function openWin(url, name, width, height) {
	var param = 'status=yes,scrollbars=yes,width=' + width + ',height=' + height;

	url = unescape(url); // unescape all at this stage

	var pos = url.indexOf('?');
	if (pos > 0 ) {
		// case when there is a query string at the end of the URL
		if (navigator.appName.indexOf("Netscape") != -1 ) {
		 	// for netscape browsers
			// do nothing it is well formatted
	 	} else {
			// for other browsers (IE in particular)
			// it is a problem because IE unescape automatically the parameters...
			var script = url.substring(0, pos);
			var query = url.substring(pos + 1, url.length) ;
			var upos = query.indexOf('url=');
			if (upos > 0 ) {
				// this will fix our problem for now if url is the last parameter..
		  		query = query.substring(0, upos + 4) + escape(query.substring(upos + 4, query.length));
			}
			url = script + '?' + query;
		}

	}
	window.open(url, name, param);
}

function openNewWindow(url, name, width, height) {
	var param = 'status=yes,scrollbars=yes,width=' + width + ',height=' + height;
	window.open(url, name, param);
	return true;
}

function openNewHelpWindow(url, name, width, height) {
	var param = 'status=yes,scrollbars=yes,resizable=yes,width=' + width + ',height=' + height;
	var newwindow = null;
    newwindow = window.open(url, name, param);
	var browserName=navigator.appName; 
	if(navigator.userAgent.indexOf("Netscape") != -1){
		if (newwindow || !newwindow.closed ) {
			newwindow.opener=self;
			//document.close();
		}
		
	} else {
		if (newwindow || !newwindow.closed ) {
			newwindow.close();
			window.open(url, name, param);
		}
		
	}
	if (window.focus) {newwindow.focus()}
	return true;
}

function openNewExportWindow(url, name, width, height) {
	var win=null;
	var param = 'status=yes,resizable=yes,scrollbars=yes,width=' + width + ',height=' + height;
 	if (!win || win.closed ) {
 	 win=window.open(url, name, param);
 	 win.focus();
 	 return true;
 	 }else{
     return false;
	 }

}
function openNewDefaultWindow(url,name) {
	var win=null;
	var param = 'status=yes,resizable=yes,scrollbars=yes,menubar=yes,toolbar=yes,location=yes';
 	if (!win || win.closed ) {
 	 win=window.open(url, "ContactUs" , param);
 	 win.focus();
 	 return true;
 	 }else{
     return false;
	 }
}

function openPrivacyWindow(url) {
	openNewWindow(url, 'privacy', 600, 490);
}

function openHelpWindow(url) {
	openNewHelpWindow(url, 'help', 785, 600);
}

function openLegalWindow(url) {
	openNewWindow(url, 'legal', 600, 490);
}
function openContactUsWindow(url) {
	openNewDefaultWindow(url,'contactUs');
}

function openTellAFriendWindow(url) {

	//openNewWindow(url, 'tellafriend', 400, 490);
	//Captcha implementation
	openNewWindow(url, 'tellafriend', 450, 490);
	}
//function to open the contact scirus link(under the tools option present in help page)in a new window.
function openContactScirusWindow(url){
	openNewWindow(url, 'contactscirus', 800, 490);
}

//function to open the submit websie link(under the tools option present in help page)in a new window.
function openSubmitWebsiteWindow(url){
	openNewWindow(url, 'submitwebsite', 800, 490);
}

// Affiliates popup function
function openAffiliateListWindow(url) {
   openNewWindow(url, 'affiliateList', 400, 600);
}
function openNewsSubscribeWindow(url) {
   openNewWindow(url, 'SubscribeNews', 700, 625);
}
function openJapaneseInfoWindow(url) {
   openNewWindow(url, 'JapaneseInfo', 700, 580);
}

function refnumAlert() {
		var feed = document.fbForm.feedback;
		if (feed.options[feed.selectedIndex].value == 'Library Partners') {
			alert("Please provide the reference number if known");
		}
	}

// This method is for reading the specified cookie value.
// Returns the cookie value if exists, otherwise return null
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 basicToadv(contextPath){
    if(document.getElementById("q")){
		var bv = document.getElementById("q").value;
		document.frm.q1.value=bv;
	} 
	document.frm.action=contextPath + "advanced/index.jsp?q1";
    document.frm.submit();
}

//-->
/*]]>*/