// JavaScript Document


function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}



function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}



function MM_findObj(n, d) { //v4.0

  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 && document.getElementById) x=document.getElementById(n); return x;

}



function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2]}

}

function filenameOnly (InString)  {
	LastSlash=InString.lastIndexOf('/', InString.length-1)
	OutString=InString.substring  (LastSlash+1, InString.length)
	question = OutString.indexOf('?')
	if (question != -1) {
		OutString=OutString.substring(OutString, question)
	}
	return (OutString);	

}

	function spawn(expr,qty,reversed){  var spawnee=[expr];  
		for(s=1;s<qty;s++){    
			spawnee[s]=expr+spawnee[s-1]  
		}  
		if(reversed){    
			return spawnee.reverse()  
		}else{    
			return spawnee  
		}
}


function generateTrail(divider){  
	if(!divider) {
		divider=" >> "
	}  
	divider=" >> "
	var m=location.toString(),h="";
  	m=m.substring(m.indexOf("/")+1);
	m=m.split("/");  

	var howmany=spawn("../",m.length,true);  
	howmany[m.length]="default.asp";  
	for(i=1;i<m.length-1;i++){    
		h+=("<a href='/" +howmany[i+2]+"'  >"+unescape( m[i]+"</a>"+divider))  
	}  
	
	h += filenameOnly(window.location.toString().replace(".asp", "").replace("_", " ").replace("_", " ")); 
	//h = "<font size='-1'>" + h + "</font>" 
	h=h.fontsize(-1)
	return h.toLowerCase()
}

function fnPrint() {
if (document.getElementById || document.all) {
document.frmPrint.txtPrint.value=document.all.mainContent.innerHTML;
document.frmPrint.txtTitle.value=document.title 
document.frmPrint.submit()
}
else{
windows.alert("Formatted printing is only available in internet explorer 4+ or netscape navigator 6+. Please use your browser print button to print.")
}
	
}

var popUpWin=0;
function popUp(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function videoChange(URLStr){
	document.getElementById("txtMediaFileName").value=URLStr;
	document.forms[0].submit();
}


/***********************************************
* DD Tab 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
***********************************************/

//Set tab to intially be selected when page loads:
//[which tab (1=first tab), ID of tab content to display]:
var initialtab=[1, "sc1"]

//Turn menu into single level image tabs (completely hides 2nd level)?
var turntosingle=0 //0 for no (default), 1 for yes

//Disable hyperlinks in 1st level tab images?
var disabletablinks=0 //0 for no (default), 1 for yes

////////Stop editting////////////////

var previoustab=""

if (turntosingle==1)
document.write('<style type="text/css">\n#tabcontentcontainer{display: none;}\n</style>')

function expandcontent(cid, aobject){
if (disabletablinks==1)
aobject.onclick=new Function("return false")
if (document.getElementById){
highlighttab(aobject)
if (turntosingle==0){
if (previoustab!="")
document.getElementById(previoustab).style.display="none"
document.getElementById(cid).style.display="block"
previoustab=cid
}
}
}

function highlighttab(aobject){
if (typeof tabobjlinks=="undefined")
collecttablinks()
for (i=0; i<tabobjlinks.length; i++)
tabobjlinks[i].className=""
aobject.className="current"
}

function collecttablinks(){
var tabobj=document.getElementById("tablist")
if (tabobj==null){							//added this to prevent errors where there are no tabs
	tabobjlinks=null						//added this to prevent errors where there are no tabs
}
else{
	tabobjlinks=tabobj.getElementsByTagName("A")
}
}

function do_onload(){
collecttablinks()
if (tabobjlinks!=null){				//added this to prevent errors where there are no tabs. Just check if there is any content.
	expandcontent(initialtab[1], tabobjlinks[initialtab[0]-1])
}
}

if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload


/********* END of Dynamic tabs script ********************/



/***********************************************
* Bookmark site 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
***********************************************/

function bookmarksite(title, url){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, "")
}

/************ End of bookmark **************/


