

// --- MAP LAYOVER --- //

function mapon(){

overlaydiv = document.getElementById('background_overlay');
mapperdiv = document.getElementById('mapper');
overlaydiv.style.display = 'block';
mapperdiv.style.display = 'block';

}

function closeMap(){

overlaydiv = document.getElementById('background_overlay');
mapperdiv = document.getElementById('mapper');
overlaydiv.style.display = 'none';
mapperdiv.style.display = 'none';
document.getElementById('map_overlay').style.height = "0px";
document.getElementById('mapper').style.height = "0px";

}

function addressbreak(){

flashconfigtemp = document.getElementById('flasherconfig').href;
brokenup = flashconfigtemp.split("/");

for (i = 0;i <= brokenup.length;i++){
	alert(brokenup[i]);
}

}


function alertSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  window.alert( 'Width/Height = ' + myWidth+"/"+myHeight );

}


function showOverlay(val) {
			
			
	var myWidth = 0, myHeight = 0;
	try {
			
			
  		if( typeof( window.innerWidth ) == 'number' ) {
    		//Non-IE
			myWidth = window.innerWidth;
			myHeight = window.innerHeight;
		} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			//IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;
		} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			//IE 4 compatible
			myWidth = document.body.clientWidth;
			myHeight = document.body.clientHeight;
  		}
	
			
		
		// these values take into accoun the aspect ratio of the logo .swf file... (i.e. 175/225), etc.
		if (myWidth > myHeight){
			//alert("page width greater, using height for calc");
			wildriffHeight= Math.floor(myHeight *.9);
			wildriffWidth = Math.floor((175/225) * wildriffHeight);
		} else {
			//alert("page height greater, using width for calc");
			wildriffWidth = Math.floor(myWidth *.9);
			wildriffHeight= Math.floor((225/175) * wildriffWidth);
		}
			
	
		// Figure out position on the page
		wildriffLeft = Math.floor((myWidth - wildriffWidth) / 2);	
		wildriffTop = Math.floor((myHeight - wildriffHeight) / 2);

        document.getElementById('wildriff_overlay').style.height = myHeight+"px";

        document.getElementById('wildriff').style.height = wildriffHeight+"px";
		document.getElementById('wildriff').style.width = wildriffWidth+"px"; // was "490px"
			
		document.getElementById('wildriff').style.top = wildriffTop+"px"; 
		document.getElementById('wildriff').style.left = wildriffLeft+"px"; 
			
			

        } catch(e) {}

        document.getElementById('wildriff_overlay').style.display = "block";
        document.getElementById('wildriff_overlay').style.opacity = val/100;
        document.getElementById('wildriff_overlay').style.filter = 'alpha(opacity=' +val+ ')';
        document.getElementById('wildriff_overlay').style.MozOpacity = val/100;
        document.getElementById('wildriff').style.display = "block";    

}


function closeOverlay(){

	wildriffoverlaydiv = document.getElementById('wildriff_overlay');
	wildriffdiv = document.getElementById('wildriff');

	wildriffoverlaydiv.style.display = 'none';
	wildriffdiv.style.display = 'none';

	document.getElementById('wildriff_overlay').style.height = "0px";
	document.getElementById('wildriff').style.height = "0px";

}

function initSearchBox(){
	
	if (document.searchForm.q.value=="search"){document.searchForm.q.value="";}
}


function checkSearchForm(){
	//alert("running search check");
	
	if (document.searchForm.q.value=="search" || document.searchForm.q.value==""){
		alert("Please enter your search term first!");
		document.searchForm.q.focus();
		return false;
	} else {
		//alert("q= " + document.searchForm.q.value);
		return true;	
	}
		
}


function openLoginWindow(){
  a = window.open('/includes/pw_protect.php','login','scrollbars=yes,resizable=yes,width=400,height=300');
  a.focus();
}

function openLogoutWindow(){
  a = window.open('/includes/pw_protect.php?logout=true','login','scrollbars=yes,resizable=yes,width=400,height=300');
  a.focus();
}

