// JavaScript Document
function getBrowser(){
	var browser="";
	if(navigator.userAgent.toLowerCase().indexOf("gecko")>-1){
		browser="moz";
	}else{
		browser="ie";
	}
	return(browser);	
}
function pageSetup(){
	
	//121 is the height of the header
	var newHeight=document.getElementById("central").clientHeight-151;	
	
	var element=document.getElementById("content");	
	if(getBrowser()=="ie"){
		element.style.height=newHeight;	
	}else{		
		element.setAttribute("style", "height:" + newHeight + "px;");
		//element.setAttribute("style", "margin-top:5px;");
	}

}

/*function showImage(folder,image,type,title){	
	this["title_" + type]=title;
	this["image_" + type]=folder + image;
	
	document.getElementById("img_" + type).src=folder + "small_" + image;
	document.getElementById("img_" + type).alt=title;
	document.getElementById("img_" + type).title=title;
	
}*/
function openImageWindow(image,title,type){	

	popup=window.open("image.asp?image=" + image + "&title=" + title + "&type=" + type,"popup","resizable, status=no,width=600,height=450"); 	
 	if (window.focus){
		popupTimer=setTimeout("popup.focus()",250);				
	}	
  return popup;
}
function loadpage(){
	document.getElementById("divMain").style.visibility="visible";
	if(document.getElementById("caption")){
		document.getElementById("caption").style.visibility="visible";
	}
}
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_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') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) 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 writeFlash(id,movie,vars,width,height){
	var strFlash="<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" ";							
	strFlash+="codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"" + width + "\" height=\"" + height + "\">";
	strFlash+="<param name=\"movie\" value=\"" + movie + "\">";
	strFlash+="<param name=\"quality\" value=\"high\">";
	strFlash+="<param name=\"flashVars\" value=\"" + vars + "\">";
	strFlash+="<embed src=\"" + movie + "\" quality=\"high\" ";
	strFlash+="flashVars=\"" + vars + "\" ";
	strFlash+="pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\""  +width + "\" height=\"" + height + "\"></embed></object>";	
	//alert(strFlash);
	document.getElementById(id).innerHTML=strFlash;
}
function remove(id){
	document.getElementById(id).innerHTML="";
	document.getElementById(id).style.width=0;
}