ie4 = (document.all)?true:false;
ns4 = (document.layers)?true:false;

var window_onresize_tmp = window.onresize;
function window_onresize(){
	if (window_onresize_tmp)
		window_onresize_tmp();
	calcPos();
}
window.onresize = window_onresize;

var window_onscroll_tmp = window.onscroll;
function window_onscroll(){
	if(window_onscroll_tmp)
		window_onscroll_tmp();
	calcPos();
}
window.onscroll = window_onscroll;

var document_onselectionchange_tmp = document.onselectionchange;
function document_onselectionchange(){
	if (document_onmouseup_tmp)
		document_onselectionchange_tmp();
	document_onselectionchanged();
}
document.onselectionchange = document_onselectionchange;

var document_onmouseup_tmp = document.onmouseup;
function document_onmouseup(){
	if (document_onmouseup_tmp)
		document_onmouseup_tmp();
	document_onselectionchanged();
}
document.onmouseup = document_onmouseup;

function calcPos() {
	if (ie4 || ns4) {
		windowWidth  = (ie4)?document.body.clientWidth:window.innerWidth;
		windowHeight = (ie4)?document.body.clientHeight:window.innerHeight;
		scrollTop = (ie4)?document.body.scrollTop:0 ;
		scrollLeft = (ie4)?document.body.scrollLeft:0 ;
		//logoLeft = scrollLeft + 10;
		logoLeft = scrollLeft;
		logoTop = windowHeight + scrollTop ;
		//logoWidth= windowWidth - 11 ;
		logoWidth= windowWidth ;
		posObj('keywordH1',logoLeft,logoTop,logoWidth);
	}
}
function posObj(objName,objLeft,objTop,objWidth) {
	if(document.all[objName]!=null){
		if (ie4) {
			objMove = document.all[objName].style;
			objHeight = document.all[objName].scrollHeight + 1;
		}
		else if (ns4) { 
			objMove = document.layers[objName]; 
			objHeight = document.layers[objName].height;
		}
		objMove.top = objTop - objHeight;
		objMove.left = objLeft; 
		objMove.width = objWidth;
	}
}
if(document.all["keywordH1"]!=null){
	document.all["keywordH1"].innerHTML = "<b>Search for keywords: </b>"+document.all["keywordH1"].innerHTML;
}
function document_onselectionchanged()
{
	if (document.all["masterSearchTextBox"]!=null && document.selection){
		var oSel = document.selection.createRange();
		var sType = document.selection.type;
		if (sType=="Control")
		{
			pe=oSel.item(0).parentElement;
		}
		else
		{
			pe=oSel.parentElement();
		}
		if (pe.id != "masterSearchTextBox" && sType=="Text" && oSel.text.length>0){
			document.all["masterSearchTextBox"].value=oSel.text;
		}
	}
}
calcPos();
function openPopup(url)
{
	var popUp = window.open(url, popUp, 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=500,height=400');
}
function openPopupFocus(url)
{
	var popUp = window.open(url, popUp, 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=500,height=400');
	popUp.focus();
}
function AllAspLeftNavDropDownJs(ob)
{
	if(document.TemplateForm.elements[ob].selectedIndex>0)
	{
	window.navigate(document.TemplateForm.elements[ob][document.TemplateForm.elements[ob].selectedIndex].value);
	}
}





