function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') {
        if (isNaN(val)) errors+='- '+nm+' must contain only numbers.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}


function MM_popupMsg(msg) { //v1.0
  alert(msg);
}


function MM_jumpMenu(selObj,restore){ //v3.0 
var url = selObj.options[selObj.selectedIndex].value; 
if (url) { 
remote = window.open(url, 'view_frame'); 
if (remote != null) { 
if (remote.opener == null) 
remote.opener = self; 
} 
} 
if (restore) selObj.selectedIndex=0; 
} 

/***********************************************
* Switch Menu script- by Martial B of http://getElementById.com/
* Modified by Dynamic Drive for format & NS4/IE4 compatibility
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

if (document.getElementById){ //DynamicDrive.com change
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('.ssubmenu{display: none;}\n')
document.write('.sssubmenu{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change
		if(el.style.display != "block"){ //DynamicDrive.com change
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="submenu") //DynamicDrive.com change
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}

function SwitchsubMenu(obj){
	if(document.getElementById){
	var sel = document.getElementById(obj);
	var sar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change
		if(sel.style.display != "block"){ //DynamicDrive.com change
			for (var i=0; i<sar.length; i++){
				if (sar[i].className=="ssubmenu") //DynamicDrive.com change
				sar[i].style.display = "none";
			}
			sel.style.display = "block";
		}else{
			sel.style.display = "none";
		}
	}
}

function SwitchsubsubMenu(obj){
	if(document.getElementById){
	var ssel = document.getElementById(obj);
	var ssar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change
		if(ssel.style.display != "block"){ //DynamicDrive.com change
			for (var i=0; i<ssar.length; i++){
				if (ssar[i].className=="sssubmenu") //DynamicDrive.com change
				ssar[i].style.display = "none";
			}
			ssel.style.display = "block";
		}else{
			ssel.style.display = "none";
		}
	}
}


function SwitchMenu2(obj,obj2){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var m1 = document.getElementById(obj2);
	var ar = document.getElementById("masterdiv2").getElementsByTagName("span"); //DynamicDrive.com change
	var mr = document.getElementById("tablediv").getElementsByTagName("td");

		if(el.style.display != "block"){ //DynamicDrive.com change
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="submenu") //DynamicDrive.com change
				ar[i].style.display = "none";
			}
			for (var i=0; i<mr.length; i++){
				mr[i].className = "nav2menu";
			}
			el.style.display = "block";
			m1.className = "nav2menu2";
		}
	}
}


						
/***********************************************
* Dynamic Ajax Content- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

//var bustcachevar=0 //bust potential caching of external pages after initial request? (1=yes, 0=no)
//var loadedobjects=""
//var rootdomain="http://"+window.location.hostname
//var bustcacheparameter=""

function ajaxChange(url, containerid){
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
} 
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.onreadystatechange=function(){
loadpage(page_request, containerid)
}
//if (bustcachevar) //if bust caching of external page
//bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
page_request.open('GET', url, true)
page_request.send(null)
}

function loadpage(page_request, containerid){
if (page_request.readyState == 4 && page_request.status==200)
document.getElementById(containerid).innerHTML=page_request.responseText
}


function unhideObj(objElementTarget)
{
	if(objElementTarget && objElementTarget.style)
	{
	objElementTarget.style.display = "block";
	};
}

function hideObj(objElementTarget)
{
	if(objElementTarget)
	{
	document.getElementById(objElementTarget).style.display = "none";
	};
}
