//--------------------- Last Modified --> 2006.11.10 ---------------------//
//------------------------------------------------------------------------------------//
  $(document).ready(function(){
	$("#global-nav-02 a,#Select1 option,#searchbox").mouseover(function(){
     	$("#searchbox").show();
	});
	$("#close-search").click(function(){
     	$("#searchbox").hide();
		});	
	$("#searchbox").blur(function(){$(this).hide();});
	
	$("#global-nav-03 a").mouseover(function(){
     	$("#searchbox").hide();
	  });	
	$("#global-nav-01 a").mouseover(function(){
     	$("#searchbox").hide();
	  });	
	jQuery.each(jQuery.browser, function(i, val) {
  if(i=="msie" && jQuery.browser.version.substr(0,3)=="7.0"){
    

	$("#nav li a, #nav li ul, #nav li ul li").mouseover(function(){
     	$("#nav li").addClass('relative');
	  });	

	$("#nav li").mouseout(function(){
     	$("#nav li").removeClass('relative');
	  });	
		
  }
  else{} 
	});	
		
  });

	

	
function showPinDetails(n){
	closeAll();
		document.getElementById('pin-details-'+n).style.display = "block";
	}	
	
function hideSearchbox(){
	document.getElementById('searchbox').style.display='none';
	}
	
function hideShow(n){
	if(	document.getElementById(n).style.display != 'none'){
		closeAll();
	}
	else{	
	closeAll();
	document.getElementById(n).style.display="block";
		if (document.getElementById('link_'+n)){
			document.getElementById('link_'+n).className = "minus";
			}
		else return;
			
	}	
}
function hideShowResources(n){
		
	if(	document.getElementById(n).style.display == 'block'){
		closeResources();
	}
	else{	
	closeResources();
	document.getElementById(n).style.display='block';
		if (document.getElementById('link_'+n).className == 'plus'){
			document.getElementById('link_'+n).className = 'minus';
			}
		else {
			return;
			}
	}	
}

 function hideRight(n){
	 if (document.getElementById(n).style.display != 'none'){
	 document.getElementById('image-hide').style.display = 'none';
	 }
 else{  showRight();	 }
 }
 function showRight(){
	 document.getElementById('image-hide').style.display = 'block';
 }
//------------------- OPEN NEW WINDOW -------------------//
var newWindow = null;

function closeWin(){
	if (newWindow != null){
		if(!newWindow.closed)
			newWindow.close();
	}
}

function popUpWin(url, type, strWidth, strHeight){
	closeWin();
	if (type == "fullScreen"){
		strWidth = screen.availWidth - 10;
		strHeight = screen.availHeight - 160;
	}
	var tools="";
	if (type == "standard" || type == "fullScreen") tools = "resizable=no,toolbar=no,location=no,scroll=yes,scrollbars=yes,menubar=no,width="+strWidth+",height="+strHeight+",top=0,left=0";
	if (type == "console") tools = "resizable=no,toolbar=no,location=no,directories=no,status=no,scroll=no,scrollbars=no,menubar=no,width="+strWidth+",height="+strHeight+",left=0,top=0";
	newWindow = window.open(url, 'newWin', tools);
	newWindow.focus();
}

function popUpSWF(url, type, Width, Height, arg1, arg2, arg3){
	closeWin();
	tools = "resizable=no,toolbar=no,location=no,directories=no,status=no,scroll=no,scrollbars=no,menubar=no,width="+Width+",height="+Height+",left=0,top=0";
	if(type == "mp"){
		newWindow = window.open(url+"?bandwidth="+arg1+"&video="+arg2+"&lan="+arg3, 'newWin', tools);
	}
	if(type == "mc"){
		newWindow = window.open(url+"?category="+arg1+"&videoNum="+arg2, 'newWin', tools);
	}
	if(type == "bna"){
		newWindow = window.open(url+"?procedure="+arg1+"&caseNum="+arg2, 'newWin', tools);
	}
	newWindow.focus();
}


//------------------- for clearing and replacing text in form input fields and textareas -------------------//
function clearText(thefield) {
  if (thefield.defaultValue==thefield.value) { thefield.value = "" }
} 
function replaceText(thefield) {
  if (thefield.value=="") { thefield.value = thefield.defaultValue }
}


//---------------------ActiveX--EMBED-------------------//
function printActiveX(source, width, height, id) {
	document.write('<object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" width="'+width+'" height="'+height+'" id="'+id+'" />');
	document.write('<param name="FileName" value="'+source+'" />');
	document.write('<param name="Autostart" value="True" />');
	document.write('<param name="ShowControls" value="True" />');
	document.write('<param name="ShowStatusBar" value="False" />');
	document.write('<param name="ShowDisplay" value="False"/>');
	document.write('<param name="AutoRewind" value="True" />');
	document.write('<embed src="'+source+'" width="'+width+'" height="'+height+'" />');
	document.write('</object>');
}


//------------------- Son-Of-Sucker-Fish IE Hack -------------------//
sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	// for each list item in the menu...
	for (var i=0; i < sfEls.length; i++) {
		// Is this IE7?  If so, use onmouseleave to fix the fact that onmouseout won't fire
		is_IE7 = navigator.appVersion.indexOf("MSIE 7.0") != -1;

		sfEls[i].onmouseover = function() {
			this.className+=" sfHover";
			// is this a top-level menu item?
			var child_ul = this.getElementsByTagName('ul')[0];
			if (child_ul && is_IE7){
				// fix for IE7
				child_ul.style.position = 'static';
			}
		}

		sfEls[i].onmouseleave = function() {
			// is this a top-level menu item?
			var child_ul = this.getElementsByTagName('ul')[0];
			if (child_ul && is_IE7){
				// fix for IE7
				child_ul.style.position = 'absolute';
				child_ul.style.left = '-9000px';
			}
		}

		sfEls[i].onmouseout = function() {
			this.className=this.className.replace(new RegExp(" sfHover\\b"), "");
		}

	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

//------------------- Son-Of-Sucker-Fish IE Hack 2 -------------------//
sfHover = function() {
	var sfEls = document.getElementById("global-nav").getElementsByTagName("LI");
	// for each list item in the menu...
	for (var i=0; i < sfEls.length; i++) {
		// Is this IE7?  If so, use onmouseleave to fix the fact that onmouseout won't fire
		is_IE7 = navigator.appVersion.indexOf("MSIE 7.0") != -1;

		sfEls[i].onmouseover = function() {
			this.className+=" sfHover";
			// is this a top-level menu item?
			var child_ul = this.getElementsByTagName('ul')[0];
			if (child_ul && is_IE7){
				// fix for IE7
				child_ul.style.position = 'static';
			}
		}

		sfEls[i].onmouseleave = function() {
			// is this a top-level menu item?
			var child_ul = this.getElementsByTagName('ul')[0];
			if (child_ul && is_IE7){
				// fix for IE7
				child_ul.style.position = 'absolute';
				child_ul.style.left = '-9000px';
			}
		}

		sfEls[i].onmouseout = function() {
			this.className=this.className.replace(new RegExp(" sfHover\\b"), "");
		}

	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


