function browserdetect(){
//returns 1 for IE, 2for N6,3 for N4 and others
if(navigator.appName=="Microsoft Internet Explorer"){return 1;}
else if(navigator.appName=="Netscape" && parseInt(navigator.appVersion)==5){return 2;}
else{return 3;}
}
function centerAbsolutePositionedLayout(layoutSize){
	var leftShift; //holds number of pixels before
	var divList; //holds Node List of all div tags
	var widthWindow; //width of the current window screen.
	//if broswer supports DOM get Element by tag name method
	if(document.getElementsByTagName){
		//if current browser uses the window inner width property
		if(window.innerWidth){
			//must deduct 19 for scroll bar to get correct width of document
			widthWindow=window.innerWidth-19;
		}
		//else if the current browser uses the body.clientWith property
		else if(document.body.clientWidth){
			widthWindow=document.body.clientWidth;
		}
		//else the browser does not have anything to check against so display will fail. Output error and stop function.
		else{
			alert('This browser does not support the needed Javascript properties.\n The page will not display properly.');
			return 0;
		}//end if current browser uses the window inner width property
		//if browser window is larger than layout
		if(widthWindow>layoutSize){
			leftShift=((widthWindow-layoutSize)/2);
			//get all div tags of document
			divList=document.getElementsByTagName('div');
			//Loop over each Div tag
			for(divCount in divList){
				//if the div tag has a style property
				if(divList[divCount].style){
					//if the div tag has the position style
					if(divList[divCount].style.position){
						//if the div is absolutely positioned
						if(divList[divCount].style.position=='absolute'){
							//apply the left shift
							divList[divCount].style.left=(parseInt(divList[divCount].style.left)+leftShift)+'px';
						}
					}
				}
			}//End Loop over each Div tag
		}//End if browser window is larger than layout
	}
	else{//else browser does not support DOM get Element by tag name method
		//alert: Page will not display correctly
		alert("This browser does not use the DOM 2 getElementsByTagName Javascript method.\n This page will not display correctly");
		return 0;
	}//end if broswer supports DOM get Element by tag name method
}//end Function
function changeimage(source,imgname,netscape4string){
 var browsertype;
 browsertype=browserdetect();
 if(browsertype==1){//if IE
  document.all[imgname].src=source;
 }
 if(browsertype==2){//if N6
  document.getElementById(imgname).src=source;
 }
 if(browsertype==3){//if N4
  var imgptr;
  imgptr=eval(netscape4string+imgname);
  imgptr.src=source;
 }
}
function checkTextNotFilledIn(passedTextField){
if(passedTextField.value.length==0){
return true;
}
else{
return false;
}
}
function checkTextNotEmailAddress(passedTextField){
	//check that @ character with chars on both sides and no spaces in field
	if(passedTextField.value.search(/.+@.+/)==-1||passedTextField.value.indexOf(' ',0)!=-1){
		return true;
	}
	else{
		return false;
	}
}
function checkSelectNotSelected(passedSelectField){
var noSelectedValues=true;
var optionsIdx;
for(optionsIdx=0;optionsIdx<passedSelectField.options.length;optionsIdx++){
	if(passedSelectField.options[optionsIdx].selected==true){
		noSelectedValues=false;
		break;
	}
}
if(passedSelectField.options[0].selected==true||noSelectedValues==true){
return true;
}
else
return false;
}
function checkRadioNotSelected(passedRadioField){
if(passedRadioField!=null){
	if(passedRadioField.length!=null){	
		var loopcount;
		//loop over radio array and if one is checked exit function with false, radio does have one item checked
		for(loopcount=0;loopcount<passedRadioField.length;loopcount++){
			if(passedRadioField[loopcount].checked){
				return false;
			}
		}
	}
	else{
		if(passedRadioField.checked){
			return false;
		}
	}
}
else{
	if(passedRadioField!=null){alert("checkRadioNotSelected was passed a null value");}
}
return true;
}
function checkCheckBoxesNotSelected(passedCheckBoxField){
if(passedCheckBoxField!=null){
	if(passedCheckBoxField.length!=null){	
		var loopcount;
		//loop over radio array and if one is checked exit function with false, radio does have one item checked
		for(loopcount=0;loopcount<passedCheckBoxField.length;loopcount++){
			if(passedCheckBoxField[loopcount].checked){
				return false;
			}
		}
	}
	else{
		if(passedCheckBoxField.checked){
			return false;
		}
	}
}
else{
	if(passedCheckBoxField!=null){alert("checkCheckBoxesNotSelected was passed a null field")};
}
return true;
}
function checkTextNotNumber(passedTextField){
	var numbercharacters="1234567890.";//valid characters for number
	var count;//loop index var
	var currentchar;//current character being check for valid digit
	for(count=0;count<passedTextField.value.length;count++){
		currentchar=passedTextField.value.charAt(count);
		if(numbercharacters.indexOf(currentchar)==-1){
			return true;
		}
	}
	return false;
}
function checkTextNotAlphaChars(passedTextField){
	var alphacharacters="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";//valid characters for number
	var count;//loop index var
	var currentchar;//current character being check for valid digit
	for(count=0;count<passedTextField.value.length;count++){
		currentchar=passedTextField.value.charAt(count);
		if(alphacharacters.indexOf(currentchar)==-1){
			return true;
		}
	}
	return false;
}
function checkTextNotLength(passedTextField,len){
	if(passedTextField.value.length!=len){
		return true;
	}
	else{
		return false;
	}
}
function checkDateNotReal(year,month,day){
	var isLeapYear;//variable to indicate if year given is a leap year
	//check that function is getting numeric parameters
	if(year==null||month==null||day==null||isNaN(year)||isNaN(month)||isNaN(day)){
		alert("function checkDateNotReal was not passed all numeric values.\The values passed are:\nYear: "+year+" Month: "+month+" Day: "+day);
		return true;
	}
	else{
		//find out if the year provided is a leap year
		// century years are only leap years if divisible by 400
		isLeapYear=(year%4==0 && (year%100!=0 || year%400==0));
		//check month is not in valid range, if so return true that not real date
		if(month<1||month>12){
			return true;
		}
		//check day is not in a valid range for the month entered, if so return true that not real date
		if(day<1||
		(month==1&&day>31)||
		(month==3&&day>31)||
		(month==5&&day>31)||
		(month==7&&day>31)||
		(month==8&&day>31)||
		(month==10&&day>31)||
		(month==12&&day>31)||
		(month==4&&day>30)||
		(month==6&&day>30)||
		(month==9&&day>30)||
		(month==11&&day>30)||
		(month==2&&isLeapYear&&day>29)||
		(month==2&&!isLeapYear&&day>28)
		){
			return true;
		}
		//all values have been validated as real so function returns false that this is unreal date
		return false;
	}
}
function ifEnterKeyPressed(evt){
var codeIfPressed="";
var codeIfNotPressed="";
if(ifEnterKeyPressed.arguments[1]){codeIfPressed=ifEnterKeyPressed.arguments[1];}
if(ifEnterKeyPressed.arguments[2]){codeIfNotPressed=ifEnterKeyPressed.arguments[2];}
	evt = (evt) ? evt : event;
    var charCode = (evt.charCode) ? evt.charCode :
        ((evt.which) ? evt.which : evt.keyCode);
    if (charCode == 13 || charCode == 3) {
        if(codeIfPressed){eval(codeIfPressed);}
		return true;
    } else {
		if(codeIfNotPressed){eval(codeIfNotPressed);}
		return false;
    }
}
function popUpDisplay(e){
var bodyptr;//bodytag ptr
var popupdiv;//Newly created Div tag
var height;//window height
var width;//window width
var scrollx;//window x scroll
var scrolly;//window y scroll
var styleattr;//pointer to style atrribute of layer to pop and so to be assigned a value
var stylecount=0;//var to loop over styles in stylearray
var txt="<b>Pop Up Text needs to be entered in function call.</b>";//text that is displayed in popup window will be set to a default if not passed as second arguement to function
var popstyle="background-color:#ffffff;color:#000000;border:1px solid #000000;position:absolute;display:block;width:300px;"//style of popup layer will be set to default if not passed as third arguement to function. 
var layerid="popuplayer";//name/id of popup layer will be set to default if not passed as fourth arguement to function
//check if optional parameters have been passed to function
if(popUpDisplay.arguments[1]){txt=popUpDisplay.arguments[1];}
if(popUpDisplay.arguments[2]){popstyle=popUpDisplay.arguments[2];}
if(popUpDisplay.arguments[3]){layerid=popUpDisplay.arguments[3];}
//function checks for necessary functions DOM2 function support
if(document.getElementById&&document.getElementsByTagName&&document.createElement){
	//check if event passed is undefined and set to window.event object if
	if(typeof e.target=="undefined"){
		e=window.event;
	}
	//check if layer already exists
	if(document.getElementById(layerid)==null){
		//if not create
		//create new layer
		popupdiv=document.createElement('DIV');
		popupdiv.id=layerid;
		document.body.appendChild(popupdiv);
	}
	else{
		//do not create new div but make pointer to work with layer
		popupdiv=document.getElementById(layerid);
	}//end check if layer already exists
	
	//Populate popup layer with text
	popupdiv.innerHTML=txt;
	//populate popup layer style
	styleattr=popupdiv.getAttribute("style");
	//if Mozilla style attribute will not already be made. Must set the attribute
	if(styleattr==null){
		popupdiv.setAttribute("style",popstyle,"normal");
	}
	else{
		//IE uses the full DOM rule string to set value
		if(typeof styleattr.cssText!="undefined"){
			styleattr.cssText=popstyle;
		}
		//if mozilla must set the style attribute object again because once style set it becomes a string in mozilla
		else if(typeof styleattr!="object"){
			popupdiv.setAttribute("style",popstyle,"normal");
		}
		else{
			alert("Error: Browser will not assign style to new div. Popup will not display correctly.")
			return false;
		}
	}
	//get values for window display check wether browser supports DOM or other
	//if innerheight is undefined use IE properties else use DOM properties
	if(typeof window.innerHeight=="undefined"){
		  height = window.screen.availHeight-146;//146 estimate of IE toolbars size in window.have no other way of determining window hieght in IE. Document.body.clientHeight in IE gives entire height of document not window size. Need window size here.
		  width = document.body.clientWidth;
		  //old bunke code used 'document.body.' but did not seem to work in IE 6 the documentElement is what works with my browser
		  scrollX= document.documentElement.scrollLeft;
		  scrollY= document.documentElement.scrollTop;
	}
	else{
        height = window.innerHeight;
		width = window.innerWidth;
	 	scrollX = window.pageXOffset;
		scrollY = window.pageYOffset;
	}//end if innerheight is undefined use IE properties else use DOM properties
	//display popup layer next to cursor
	  // see if the standard display position of content window will go offscreen
	  // standard position is 5 down and 5 right of the cursor
	  if ((e.clientX + popupdiv.offsetWidth + 5) > width)
          {
	    // it would go off screen so put 5 left of the cursor
	    popupdiv.style.left = ((e.clientX + scrollX) - (popupdiv.offsetWidth + 5))+'px';
	  } 
	  else 
	  {
	    // it's ok
	    popupdiv.style.left = ((e.clientX + scrollX) + 5)+'px';
	  }

	  if ((e.clientY + popupdiv.offsetHeight + 5) > height)
	  {
	    // it would go off the bottom 
	    // if we place it above the cursor will it go off the top
	    if((5 + popupdiv.offsetHeight) > e.clientY)
	    {
	        //put it right at the top
	        popupdiv.style.top = scrollY+'px';
	    }
	    else
	    {
	      // it's within the viewable space
	      popupdiv.style.top = ((e.clientY + scrollY) - (popupdiv.offsetHeight + 5))+'px';
	    }
	  } 
	  else 
	  {
	    // it's ok
	    popupdiv.style.top = ((e.clientY + scrollY) + 5)+'px';
	  }
	
	  // pop it up
	  popupdiv.style.visibility = 'visible';
	  return true;

}
//if browser has DOM get Element By ID support
else{
	alert("Error: Browser does not support all necessary Javascript functions. Popup will not display.")
	return false;
}//End if browser has DOM get Element By ID support
}//end function
function hidePopUpDisplay()
{
var layerid='popuplayer';//default layerid if one not passed as argument
if(hidePopUpDisplay.arguments[0]){layerid=popUpDisplay.arguments[0];}//if arguements passed assign value
  // make the pop up disappear
  var elly = document.getElementById(layerid);
  elly.style.visibility = 'hidden';
};

//Created 11/20/01 Kenneth Fly http://hsc.usf.edu/~kfly
//This function is used to preload images into a browser
//during loading so that that they may be used in the 
//future speedy image changes or dynamic effects. The
//function accepts one variable which is a comma
//delimited string of all the URL's (full or partial)
//that need to be preloaded. The function does not
//return any values. 
function preloadimages(imagesstring){
var imagesarray;
var count;
imagesarray=imagesstring.split(",");
for(count=0;count<imagesarray.length;count++)
newimage=new Image();
newimage.src=imagesarray[count];
}
function printerFriendlyHSCHeader(){
var outputstring='';//var to hold string of HTML
var pagetitle;//pointer to Page title element
var pagequalifiers;//pointer to page qualifiers element
pagetitle=document.getElementById("Layer4");
pagequalifiers=document.getElementById('Layer5');
outputstring=outputstring+'<img src=\"http://hsc.usf.edu/nocms/global_files/images/head4_logo.gif\"><br>';//add HSC logo
if(pagetitle!=null){//if there is page title on page
	outputstring=outputstring+'<h1>'+contentsectiontooutput(pagetitle,'n')+'</h1>';//add page title
}
if(pagequalifiers!=null){// if there is page qualifiers output 
	outputstring=outputstring+'<h2>'+contentsectiontooutput(pagequalifiers,'n')+'</h2>';
}
return outputstring;
}
function printerFriendlyWindow(contentsections,headerstring,outputlinkhref){
var contentarray; //array used to hold content sections passed to function
var outputstring=''; //string used to output content to window
var loopcount; //index for loop in function
var loopcount2; //index for nested loop in function
var printerfriendlywindow; //pointer to opened window object
var errormessage; //string to hold error message to be output
var contentpointer; //pointer to element object being worked over

//open window to output printerfriendly content
printerfriendlywindow=window.open('','printerfriendlywindow');
if(contentsections==''||contentsections==null){//if no contentsections were passed error outfunction
errormessage='<h1>No content sections passed to Printer Friendly JS Function</h1>';
printerfriendlywindow.document.write(errormessage);
return 0;}//return error code for function
if(headerstring==null){//if no headerstring was passed intialize value to nothing so no error in code
headerstring='';
}
if(outputlinkhref==null){//set default of parameter if none was passed.
outputlinkhref='N';
}
else{//if parameter was passed make sure it is uppercase
outputlinkhref=outputlinkhref.toUpperCase();
}
contentarray=contentsections.split(",");//split content to be output into array
for(loopcount=0;loopcount<contentarray.length;loopcount++){//loop over content array for processing
 contentpointer=document.getElementById(contentarray[loopcount]); //get the element by ID
 if(contentpointer==null){//if element is is not an ID
  contentpointer=document.getElementsByTagName(contentarray[loopcount]);//get the element by tag name
  if(contentpointer==null||contentpointer.length==0){//if content is not element ID or tag name error out
   errormessage='<h1>&quot;'+contentarray[loopcount]+'&quot; is not an element ID or an a collection of HTML tags in this document</h1>';
   printerfriendlywindow.document.write(errormessage);
   return 0;
  }
  else{//document has collection of tags loop over content and output into print screen
   for(loopcount2=0;loopcount2<contentpointer.length;loopcount2++){
    outputstring=outputstring+contentsectiontooutput(contentpointer[loopcount2],outputlinkhref);
   }
  }
 }
 else{
  //get output from content and add to output string
  outputstring=outputstring+contentsectiontooutput(contentpointer,outputlinkhref);
 }
}
printerfriendlywindow.document.write(html_head()); //output header section of HTML document
printerfriendlywindow.document.write(html_body_tag()); //ouput body tag of HTML document
printerfriendlywindow.document.write(headerstring);//output print header to print screen
printerfriendlywindow.document.write(outputstring);//write content to print screen
printerfriendlywindow.document.write(end_html_doc());//end HTML document

return 1;
}
function html_head(){
var title;
var printstring;
title=document.getElementsByTagName('TITLE');
printstring="<html><head><title>";
printstring=printstring+title[0].text;
printstring=printstring+"</title></head>";
return printstring;
}
function html_body_tag(){
return '<body>';
}
function end_html_doc(){
return '</body></html>';
}
function contentsectiontooutput(nodepointer,outputlinkhref){
var printstring=""; //return to have output
var loopcount; //index of loop
 if(nodepointer.hasChildNodes){ //if node has children loop go down to the children
  for(loopcount=0;loopcount<nodepointer.childNodes.length;loopcount++){//loop over nodes and add nodes and content to HTML string to be returned
   printstring=printstring+printchildnodes(nodepointer.childNodes[loopcount],outputlinkhref)
  }
 }
 return printstring;
}
function printchildnodes(nodepointer,outputlinkhref){
var printstring=""; //return to have output
var loopcount; //index for loop
 printstring=printstring+printnodevalues(nodepointer); //output parent node first
 if(nodepointer.hasChildNodes){ //if node has children loop go down to the children
  for(loopcount=0;loopcount<nodepointer.childNodes.length;loopcount++){//for each child node call function recursively
   printstring=printstring+printchildnodes(nodepointer.childNodes[loopcount],outputlinkhref)
  }
 }
 printstring=printstring+printendtag(nodepointer,outputlinkhref);//get end tag if needed for HTML element
 return printstring;
}
function printnodevalues(nodepointer){//output tag or content out to browser
 var printstring=''; //var used to hold return string
 var attributeloop; //index for loop over HTML tag attributes
 var attributesarray; //array to hold HTML tag attribures
 switch(nodepointer.nodeType){ //determine DOM node type
 case 1: //is an element node
 printstring=printstring+'<'+nodepointer.nodeName;//Begin outputing opening tag
 attributesarray=nodepointer.attributes;//get tags attributes
 if(nodepointer.attributes!=null){//if tag has attributes
  //loop over attributes and if not null or empty output attribute in name="value" format to return string
  for(attributeloop=0;attributeloop<attributesarray.length;attributeloop++){
   if(attributesarray[attributeloop].nodeValue!=null&&attributesarray[attributeloop].nodeValue!=''){
    printstring=printstring+' '+attributesarray[attributeloop].nodeName+'=\"'+attributesarray[attributeloop].nodeValue+'\"';
   }
  }
 }
 printstring=printstring+'>';//end HTML tag
 break;
 case 3: //is an text node
 printstring=printstring+nodepointer.nodeValue;//output text
 break;
 default: 
 }
 return printstring;
}
function printendtag(nodepointer,outputlinkhref){//ouput ending tag if needed
var printstring=''; //var to hold endstring
//array holding all HTML tags that need an ending tag
var tagsneedingending=new Array('A','ABBR','ACRONYM','ADDRESS','APPLET','B','BDO','BIG','BLOCKQUOTE','BODY','BUTTON','CAPTION','CENTER','CITE','CODE','COLGROUP','DD','DEL','DFN','DIV','DL','DT','EM','FILEDSET','FONT','FORM','FRAMESET','H1','H2','H3','H4','H5','H6','HEAD','HTML','I','IFRAME','INS','KBD','LABEL','LEGEND','LI','MAP','MENU','NOFRAMES','NOSCRIPT','OBJECT','OL','OPTGROUP','OPTION','P','PRE','Q','S','SAMP','SCRIPT','SELECT','SMALL','SPAN','STRIKE','STRONG','STYLE','SUB','SUP','TABLE','TBODY','TD','TEXTAREA','TFOOT','THEAD','TITLE','TR','TT','U','UL','VAR');
var loopcount;// index of loop
 switch(nodepointer.nodeType){//get DOM node type
 case 1: //is an element node
 //loop over tagsneedingending array and compare element each item until match
 for(loopcount=0;loopcount<tagsneedingending.length;loopcount++){
  if(tagsneedingending[loopcount]==nodepointer.nodeName){//if the tag matches and needs an end tag
   if(nodepointer.nodeName=='A'&&outputlinkhref=='Y'){//if the tag is a link and Needs to output full URL 
   printstring=printstring+' <span style=\"font-size: 8pt\;\">('+nodepointer.href+')</span>';
   }
   printstring=printstring+'</'+nodepointer.nodeName+'>';//ouput end tag
   break;
  }  
 }
 break;
 case 3: //is an text node code is here for future expandablity
 break;
 default: 
 }
 return printstring;
}
origWidth = window.innerWidth;
origHeight = window.innerHeight;
function resizehandler(){
if (window.innerWidth != origWidth || window.innerHeight != origHeight||window.innerWidth==undefined){
location.reload();
}
}

// BEGIN: functions to render College level menus on Home page templates
var lastInputID = '';
function writeDescription(inputDivID,outputDivID,navId,hoverClass){
		
		if (!( lastInputID == inputDivID)){
			var outputDiv = document.getElementById(outputDivID);
			var inputDiv = document.getElementById(inputDivID);
			var onHref = document.getElementById(navId+inputDivID);
			var navBar = document.getElementById("nav");
			for(i=0; i<navBar.childNodes.length; i++){
				node = navBar.childNodes[i];													
				if(node.id == navId + inputDivID){
					node.className = hoverClass;
				}
				else{ node.className = "";}							
			}										
			outputDiv.innerHTML = inputDiv.innerHTML;
//alert (inputDiv.innerHTML)			
			lastInputID = inputDivID;
		}
}

function blankDescription(outputDivID){
		var ouputDiv = document.getElementById(outputDivID);
		
		outputDiv.innerHTML = "";
}
// END: functions to render College level menus on Home page templates

/*BEGIN: javascript code for USF Health dropdown menu implemented in March 2006*/
/***********************************************
* AnyLink CSS Menu script- © 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 disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var enableanchorlink=0 //Enable or disable the anchor link when clicked on? (1=e, 0=d)
var hidemenu_onclick=1 //hide menu when user clicks within menu? (1=yes, 0=no)

/////No further editting needed

var ie5=document.all
var ns6=document.getElementById&&!document.all

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}
function showhide(obj, e, visible, hidden){
if (ie5||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}
function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie5 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie5 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie5 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}
function dropdownmenu(obj, e, dropmenuID){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
if (typeof dropmenuobj!="undefined") //hide previous menu
dropmenuobj.style.visibility="hidden"
clearhidemenu()
if (ie5||ns6){
obj.onmouseout=delayhidemenu
dropmenuobj=document.getElementById(dropmenuID)
if (hidemenu_onclick) dropmenuobj.onclick=function(){dropmenuobj.style.visibility='hidden'}
dropmenuobj.onmouseover=clearhidemenu
dropmenuobj.onmouseout=ie5? function(){ dynamichide(event)} : function(event){ dynamichide(event)}
showhide(dropmenuobj.style, e, "visible", "hidden")
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}
return clickreturnvalue()
}
function clickreturnvalue(){
if ((ie5||ns6) && !enableanchorlink) return false
else return true
}
function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}
function dynamichide(e){
if (ie5&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}
function delayhidemenu(){
delayhide=setTimeout("dropmenuobj.style.visibility='hidden'",disappeardelay)
}
function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}
function checkTextNotUNum(textInputPtr){
	textInputPtr.value=textInputPtr.value.toUpperCase();
	if(textInputPtr.value.search(/U\d{8}/)==-1||checkTextNotLength(textInputPtr,9)){
		return true;
	}
	else{return false;}
}
function checkTextNotUCardNum(textInputPtr){
	if(textInputPtr.value.search(/\d{16}/)==-1||checkTextNotLength(textInputPtr,16)){
		return true;
	}
	else{return false;}
}
function translate(urlBase, form) {
	form.u.value = urlBase //window.location;
	form.transurl.value = urlBase //window.location;
	var selectedIndex = form.hl.selectedIndex;
	var selectedValue = form.hl.options[selectedIndex].value;
	if (selectedValue.length > 2) {
		form.lpair_UiMultiSource_web.value = selectedValue;
		form.action = urlBase + "/free_translation.shtml";
		form.method = "post";
	} else {
		form.action = "http://translate.google.com/translate";
		form.method = "get";
	}
	form.submit();
}
function findSubElementWithPartialId(nodeToSearch,partialId){
	var elementFound=null;
	for(var index=0;index<nodeToSearch.childNodes.length;index++){
		if(nodeToSearch.childNodes[index].id!=''&&typeof nodeToSearch.childNodes[index].id=='string'){
			if(nodeToSearch.childNodes[index].id.indexOf(partialId)!=-1){
				elementFound=nodeToSearch.childNodes[index];
				return elementFound;
			}
		}
		if(nodeToSearch.childNodes[index].childNodes.length>0){
			elementFound=findSubElementWithPartialId(nodeToSearch.childNodes[index],partialId);
			if(elementFound!=null){return elementFound;}
		}
	}
	return elementFound;
}
function getElementStyleSetting(elemWStyle,jsCssSelector){
	if(typeof elemWStyle.currentStyle!="undefined"){
		return eval('elemWStyle.currentStyle.'+jsCssSelector+';');
	}
	else if(typeof window.getComputedStyle!="undefined"){
		return eval('window.getComputedStyle(elemWStyle,null).'+jsCssSelector+';'); 
	}
	else{alert('getElementStyleSetting function will not work in this browser.');return null;}
}
function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

/*BEGIN: SWFObject Flash Player Detect and Embed*/
if(typeof deconcept == "undefined") var deconcept = new Object();
if(typeof deconcept.util == "undefined") deconcept.util = new Object();
if(typeof deconcept.SWFObjectUtil == "undefined") deconcept.SWFObjectUtil = new Object();
deconcept.SWFObject = function(swf, id, w, h, ver, c, quality, xiRedirectUrl, redirectUrl, detectKey) {
	if (!document.getElementById) { return; }
	this.DETECT_KEY = detectKey ? detectKey : 'detectflash';
	this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
	this.params = new Object();
	this.variables = new Object();
	this.attributes = new Array();
	if(swf) { this.setAttribute('swf', swf); }
	if(id) { this.setAttribute('id', id); }
	if(w) { this.setAttribute('width', w); }
	if(h) { this.setAttribute('height', h); }
	if(ver) { this.setAttribute('version', new deconcept.PlayerVersion(ver.toString().split("."))); }
	this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion();
	if (!window.opera && document.all && this.installedVer.major > 7) {
		// only add the onunload cleanup if the Flash Player version supports External Interface and we are in IE
		deconcept.SWFObject.doPrepUnload = true;
	}
	if(c) { this.addParam('bgcolor', c); }
	var q = quality ? quality : 'high';
	this.addParam('quality', q);
	this.setAttribute('useExpressInstall', false);
	this.setAttribute('doExpressInstall', false);
	var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
	this.setAttribute('xiRedirectUrl', xir);
	this.setAttribute('redirectUrl', '');
	if(redirectUrl) { this.setAttribute('redirectUrl', redirectUrl); }
}
deconcept.SWFObject.prototype = {
	useExpressInstall: function(path) {
		this.xiSWFPath = !path ? "expressinstall.swf" : path;
		this.setAttribute('useExpressInstall', true);
	},
	setAttribute: function(name, value){
		this.attributes[name] = value;
	},
	getAttribute: function(name){
		return this.attributes[name];
	},
	addParam: function(name, value){
		this.params[name] = value;
	},
	getParams: function(){
		return this.params;
	},
	addVariable: function(name, value){
		this.variables[name] = value;
	},
	getVariable: function(name){
		return this.variables[name];
	},
	getVariables: function(){
		return this.variables;
	},
	getVariablePairs: function(){
		var variablePairs = new Array();
		var key;
		var variables = this.getVariables();
		for(key in variables){
			variablePairs[variablePairs.length] = key +"="+ variables[key];
		}
		return variablePairs;
	},
	getSWFHTML: function() {
		var swfNode = "";
		if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture
			if (this.getAttribute("doExpressInstall")) {
				this.addVariable("MMplayerType", "PlugIn");
				this.setAttribute('swf', this.xiSWFPath);
			}
			swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'"';
			swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
			var params = this.getParams();
			 for(var key in params){ swfNode += [key] +'="'+ params[key] +'" '; }
			var pairs = this.getVariablePairs().join("&");
			 if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; }
			swfNode += '/>';
		} else { // PC IE
			if (this.getAttribute("doExpressInstall")) {
				this.addVariable("MMplayerType", "ActiveX");
				this.setAttribute('swf', this.xiSWFPath);
			}
			swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'">';
			swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';
			var params = this.getParams();
			for(var key in params) {
			 swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
			}
			var pairs = this.getVariablePairs().join("&");
			if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}
			swfNode += "</object>";
		}
		return swfNode;
	},
	write: function(elementId){
		if(this.getAttribute('useExpressInstall')) {
			// check to see if we need to do an express install
			var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]);
			if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) {
				this.setAttribute('doExpressInstall', true);
				this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl')));
				document.title = document.title.slice(0, 47) + " - Flash Player Installation";
				this.addVariable("MMdoctitle", document.title);
			}
		}
		if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){
			var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
			n.innerHTML = this.getSWFHTML();
			return true;
		}else{
			if(this.getAttribute('redirectUrl') != "") {
				document.location.replace(this.getAttribute('redirectUrl'));
			}
		}
		return false;
	}
}

/* ---- detection functions ---- */
deconcept.SWFObjectUtil.getPlayerVersion = function(){
	var PlayerVersion = new deconcept.PlayerVersion([0,0,0]);
	if(navigator.plugins && navigator.mimeTypes.length){
		var x = navigator.plugins["Shockwave Flash"];
		if(x && x.description) {
			PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
		}
	}else if (navigator.userAgent && navigator.userAgent.indexOf("Windows CE") >= 0){ // if Windows CE
		var axo = 1;
		var counter = 3;
		while(axo) {
			try {
				counter++;
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+ counter);
//				document.write("player v: "+ counter);
				PlayerVersion = new deconcept.PlayerVersion([counter,0,0]);
			} catch (e) {
				axo = null;
			}
		}
	} else { // Win IE (non mobile)
		// do minor version lookup in IE, but avoid fp6 crashing issues
		// see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
		try{
			var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		}catch(e){
			try {
				var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
				PlayerVersion = new deconcept.PlayerVersion([6,0,21]);
				axo.AllowScriptAccess = "always"; // error if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code)
			} catch(e) {
				if (PlayerVersion.major == 6) {
					return PlayerVersion;
				}
			}
			try {
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			} catch(e) {}
		}
		if (axo != null) {
			PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
		}
	}
	return PlayerVersion;
}
deconcept.PlayerVersion = function(arrVersion){
	this.major = arrVersion[0] != null ? parseInt(arrVersion[0]) : 0;
	this.minor = arrVersion[1] != null ? parseInt(arrVersion[1]) : 0;
	this.rev = arrVersion[2] != null ? parseInt(arrVersion[2]) : 0;
}
deconcept.PlayerVersion.prototype.versionIsValid = function(fv){
	if(this.major < fv.major) return false;
	if(this.major > fv.major) return true;
	if(this.minor < fv.minor) return false;
	if(this.minor > fv.minor) return true;
	if(this.rev < fv.rev) return false;
	return true;
}
/* ---- get value of query string param ---- */
deconcept.util = {
	getRequestParameter: function(param) {
		var q = document.location.search || document.location.hash;
		if (param == null) { return q; }
		if(q) {
			var pairs = q.substring(1).split("&");
			for (var i=0; i < pairs.length; i++) {
				if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
					return pairs[i].substring((pairs[i].indexOf("=")+1));
				}
			}
		}
		return "";
	}
}
/* fix for video streaming bug */
deconcept.SWFObjectUtil.cleanupSWFs = function() {
	var objects = document.getElementsByTagName("OBJECT");
	for (var i = objects.length - 1; i >= 0; i--) {
		objects[i].style.display = 'none';
		for (var x in objects[i]) {
			if (typeof objects[i][x] == 'function') {
				objects[i][x] = function(){};
			}
		}
	}
}
// fixes bug in some fp9 versions see http://blog.deconcept.com/2006/07/28/swfobject-143-released/
if (deconcept.SWFObject.doPrepUnload) {
	if (!deconcept.unloadSet) {
		deconcept.SWFObjectUtil.prepUnload = function() {
			__flash_unloadHandler = function(){};
			__flash_savedUnloadHandler = function(){};
			window.attachEvent("onunload", deconcept.SWFObjectUtil.cleanupSWFs);
		}
		window.attachEvent("onbeforeunload", deconcept.SWFObjectUtil.prepUnload);
		deconcept.unloadSet = true;
	}
}
/* add document.getElementById if needed (mobile IE < 5) */
if (!document.getElementById && document.all) { document.getElementById = function(id) { return document.all[id]; }}

/* add some aliases for ease of use/backwards compatibility */
var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject; // for legacy support
var SWFObject = deconcept.SWFObject;
/*END: SWFObject Flash Player Detect and Embed*/

/*
BEGIN: embedded video player
this function takes the URL of a media file as a parameter and rewrites the HTML to play the 
clip in the specified section in on the HSC home page.

parameters:		filename		the URL of the media file
*/
function playIt(filename, defaultWidth, defaultHeight) {
			
	html = '<table cellpadding="0" cellspacing="0"><tr><td>';
	// for IE
	html = html + '<object id="streamvideo" width=' + defaultWidth + ' height=' + defaultHeight + ' classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" type="application/x-oleobject" align="middle" name="video">';
	html = html + '<param name="FileName" value="' + filename + '" />';
	html = html + '<param name="AutoStart" value="true" />';
	html = html + '<param name="ShowControls" value="false" />';
	html = html + '<param name="ShowDisplay" value="false" />';
	html = html + '<param name="ShowStatusBar" value="false" />';
	html = html + '<param name="AutoSize" value="false" />';
	// for netscape
	html = html + '<embed type="application/x-mplayer2" name="MediaPlayer" pluginspage="http://www.microsoft.com/windows/windowsmedia/download/" src="' + filename + '" width=' + defaultWidth + ' height=' + defaultHeight + ' autostart="true" autosize="false" showcontrols="0" showdisplay="0" align="middle" showstatusbar="0"></embed>';
	html = html + '</object></td></tr></table>';
	document.getElementById('video_live').innerHTML = html;
}
/*
this function stops the media clip being played by refreshing original page with the media clip still
*/
function stopIt() 
{
	window.location.reload();
}
/*
END: embedded video player
*/