var ie = (document.all) ? 1:0 // detects ie
var dom = (document.getElementById && !document.all) ? 1:0 //detects mozilla browsers like NS6 & 7

// Helps Setup SubNavDropDown Kill for MacIE
function BrowserDetectVeryLite(){
	var ua = navigator.userAgent.toLowerCase(); 
	this.isMac   = (ua.indexOf('mac') != -1);
	this.isIE    = ( (ua.indexOf("msie") != -1) && (ua.indexOf("opera") == -1) && (ua.indexOf("webtv") == -1) ); 
	
	// browser version
	this.versionMinor = parseFloat(navigator.appVersion); 
	// correct version number
	if (this.isIE && this.versionMinor >= 4) {
		this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) );}
	}
var browser = new BrowserDetectVeryLite();

getVer = browser.versionMinor.toString()
isIE50 = (getVer.indexOf('5.0')!=-1?true:false)
var killRollouts;
if(browser.isMac && browser.isIE){killRollouts = true} 
if(isIE50){killRollouts = true} 
// ******************************************


// Search Submit
function HeaderSearchButton_Click() {
	if(ie){
		if(document.forms[0]._headerSearch.value != null && document.forms[0]._headerSearch.value != ''){
			window.location.href = "/CWS/SearchResults.aspx?Criteria="+document.forms[0]._headerSearch.value ;
			return false;
			}
		else {return true;}}
	if(dom){
		if(document.forms[0]._headerSearch.value != null && document.forms[0]._headerSearch.value != ''){
			window.location.href = "/CWS/SearchResults.aspx?Criteria="+document.forms[0]._headerSearch.value ;
			return false;}
		else {return true;}}
}
// ********************************************************************************************

//For launching Maps and Directions
function launchPopup(page){
	var width
	var height
	var leftdist
	var topdist
	width = screen.width;
	height = screen.height;
	leftdist = Math.round((width - 700) / 2);
	topdist = Math.round((height - 500) / 2);
	window.open(page,'mappopup','width=700,height=500,top=10,left='+leftdist+',resizable=1,menubar=1,location=1,scrollbars=1,toolbar,status=1')
}
// *******************************************************************************************
// For hitting enter to submit search
function entsub() {
var Key=event.keyCode
if(Key==13)
{
   
	HeaderSearchButton_Click()
	return false ;
}
else
{	
	return true;
}
}
// **********************************


// Right Mouse Click Disable
//var message="Function Diabled";

//function rightClickDisable(){
//	if(ie){
//		if (event.button==2){
//			alert(message);
//			return false;}
//	}
//	if(dom){
//		oncontextmenu=new Function("alert(message);return false")}
//}

function GoTo(URL){
	if (URL) {
		window.location.href = URL;
	}
}

// ******************************************************************