function wopen(url, name, w, h){w += 32;h += 96;wleft = (screen.width - w) / 2;wtop = (screen.height - h) / 2;var win = window.open(url, name, 'width=' + w + ', height=' + h + ', ' + 'left=' + wleft + ', top=' + wtop + ', ' + 'location=no, menubar=no, ' + 'status=no, toolbar=no, scrollbars=no, resizable=no');
win.resizeTo(w, h); win.moveTo(wleft, wtop);win.focus();}
function n(url) { window.location.href=url; }
function doSearchShow() { 

changeObjectVisibility('menuContent','hidden');
changeObjectVisibility('searchParams','visible');

}

function ShowMenu() { 
changeObjectVisibility('menuContent','visible');
changeObjectVisibility('searchParams','hidden');
}

function displaySearchProgress() { 
//Display search progress
changeObjectVisibility('searchParams','hidden');
changeObjectVisibility('searchProgress','visible');

var sq = document.getElementById('Menu1_txtSearch').value;
var ss = getValue(document.getElementById('Menu1_ddlSearchSections'))

//Redirect to search page
redirect('/search/?q=' + encodeURI(sq) + '&s=' + ss)
}

function sKey() 
{
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;
if (keycode == 13)
{
displaySearchProgress();
return false;
}
else
return true;
}

//get dropdownlist selected value
function getValue(obj) { 
if (obj != null) { 
return obj.options[obj.selectedIndex].value;
}
}

function redirect(url) { 
  var version = parseInt(navigator.appVersion)
  // replace is supported
  if (version>=4 || window.location.replace) {
    window.location.replace(url); }
  else { 
    window.location.href = url; }

}

function getStyleObject(objectId) {
    // cross-browser function to get an object's style object given its id
    if(document.getElementById && document.getElementById(objectId)) {
	// W3C DOM
	return document.getElementById(objectId).style;
    } else if (document.all && document.all(objectId)) {
	// MSIE 4 DOM
	return document.all(objectId).style;
    } else if (document.layers && document.layers[objectId]) {
	// NN 4 DOM.. note: this won't find nested layers
	return document.layers[objectId];
    } else {
	return false;
    }
    
       
} // getStyleObject

function changeObjectVisibility(objectId, newVisibility) {
    // get a reference to the cross-browser style object and make sure the object exists
    var styleObject = getStyleObject(objectId);
    
    if(styleObject) {
	styleObject.visibility = newVisibility;
	
	if (newVisibility == "visible") { styleObject.display = 'block'; } else { 
	styleObject.display = 'none';	
	}
	
	return true;
	
    } else {
	// we couldn't find the object, so we can't change its visibility
	return false;
    }
} // changeObjectVisibility
