function page_print() {
	if (window.print){
		window.print();
	} else {
		alert('Please use the print functionality of your browser.');
	}
	return false;
}

function popup(theURL,features) {
	popWidth=0;
	popHeight=0;	
	popURL=theURL+"";
	popName="popup"
	if(theURL.target){
		popName=theURL.target+"";
	}
	pop = window.open(popURL + "?savereferrer=no",popName,features);
	if(popURL.indexOf(document.domain)>0){//resizing works only on pages of the same domain
		if(features.indexOf("width=")>=0){
			var re = /width=(\d*)/;
			re.exec(features);
			popWidth=Number(RegExp.$1);
		}
		if(features.indexOf("height=")>=0){
			var re = /height=(\d*)/;
			re.exec(features);
			popHeight=Number(RegExp.$1);
		}
		if(popWidth>0&&popHeight>0){
			pop.resizeTo(popWidth,popHeight);
		}
	}
	pop.focus();
	return false;
}

function popup_r(theURL,features) {
	popWidth=0;
	popHeight=0;	
	popURL=theURL+"";
	popName=theURL.target+"";
	pop = window.open(popURL,popName,features);
	if(popURL.indexOf(document.domain)>0){//resizing works only on pages of the same domain
		if(features.indexOf("width=")>=0){
			var re = /width=(\d*)/;
			re.exec(features);
			popWidth=Number(RegExp.$1);
		}
		if(features.indexOf("height=")>=0){
			var re = /height=(\d*)/;
			re.exec(features);
			popHeight=Number(RegExp.$1);
		}
		if(popWidth>0&&popHeight>0){
			pop.resizeTo(popWidth,popHeight);
		}
	}
	pop.focus();
	return false;
}

function checkKeyword(aForm) {	
	url=aForm.keywordlist.options[aForm.keywordlist.selectedIndex].value;
	if(url.indexOf("http://")>=0) {
		aForm.target="_blank";
	} else {
		aForm.target="_self";
	}
}

function getSessionID() {
	var sessDelimeter = ";";
	var winLocation = window.document.location;
	var URLSplit = String(winLocation).split(sessDelimeter);	
	if (!(URLSplit[1])) { sessID = ""; } else { sessID = sessDelimeter + URLSplit[1]; }
	return sessID;
}

function linkFromPopupToOpener(theURL){
	sessID = getSessionID();
	if(window.opener.parent) {
		window.opener.parent.location.href=theURL + sessID;
	}
	else {
		window.opener.location.href=theURL + sessID;
	}
	window.close();
	return false;
}

	