//  JavaScripts for TVU website


function ToggleBackground(bg) {
   
   if (bg =="background") {document.getElementById('container').style.background = "url(BrightSkies.jpg) repeat";
                              		   }
   else if (bg=="nobackground") {document.getElementById('container').style.background = "#FBFBFB";
   						}
 }


 function getTextSize() {  
   
   return document.body.style.fontSize = parseFloat(document.body.style.fontSize) + "em";  
 }  

// === text size start

var currFont = 1;

var sops = "";



function setTextSize(s) {

	 var arrFont = new Array('.8em', '1em', '1.2em', '1.4em', '1.6em'); 

	 var arrHeight = new Array('1.3em', '1.35em', '1.4em', '1.45em', '1.5em');
	 
	 var arrCol = new Array(0.8, 1.0, 1.2, 1.4, 1.6);
	 
	 var element, idCol;

	 if (s == 'up') {

		currFont++; 

	 }

	 if (s == 'down') {

		currFont--; 

	 }

	 if (currFont >= 4) {

		currFont = 4; 

	 }

	 if (currFont <= 0) {

		currFont = 0; 

	 }

	 document.getElementById('PageContentText').style.fontSize = arrFont[currFont];

	 document.getElementById('PageContentText').style.lineHeight = arrHeight[currFont];
	 
	

}// --- text size end 


/* 
  ------------------------------------
  PVII Menu CSS Express Drop-Down Menu
  by Project Seven Development
  www.projectseven.com
  ------------------------------------
*/
function ExpMenu(){ 
 if(navigator.appVersion.indexOf("MSIE")==-1){return;}
 
 var i,k,g,lg,r=/\s*IEhvr/,nn='',c,cs='IEhvr',bv='menubar';
 
 for(i=0;i<10;i++){
 g=document.getElementById(bv+nn);
 	if(g){
 			
 			lg=g.getElementsByTagName("LI");
 			if(lg)
 				{
 				 for(k=0;k<lg.length;k++)
 				 	{
 						lg[k].onmouseover=function(){
 							c=this.className;cl=(c)?c+' '+cs:cs;
							 this.className=cl;
							 };
							 lg[k].onmouseout=function(){
									c=this.className;
									 this.className=(c)?c.replace(r,''):'';
							};
					 }
				}
			}nn=i+1;
	}
}

function ValidateFormPRF() {
var getform;

	getform = document.getElementById('PartneringRequestForm');  
	// Protect form
	getform.setAttribute("action","../gdform.php");
	
          if (getform.spambots.value != "orange") {
			    alert ( "You must answer the 'orange' question correctly to submit this form." );
		        getform.spambots.value = "";
        		getform.spambots.focus();
					return false;  
			}
			else { return true;  }
}


/* this validates in XHTML Strict because it does not use the Form <name> tag */
function ValidateFormHelp() {
var getform;

	getform = document.getElementById('HelpForm');  
	// Protect form
	getform.setAttribute("action","../gdform.php");
	
          if (getform.spambots.value != "orange") {
			    alert ( "You must answer the 'orange' question correctly to submit this form." );
		        getform.spambots.value = "";
        		getform.spambots.focus();
					return false;  
			}
			else { return true;  }
}

/* this works if the form has a <name="PartneringRequestForm"> tag */
function ValidateFormOld() {
var getform;

	if(document.PartneringRequestForm.spambots.value != "yes") { 
			return false;  
			}
			else { return true;  }
}




// maximize browser window 
/* 

function getPageOffsetWidth()
{
var MenuBodyRef;
for(var i in document.all)
{
if (document.all[i].tagName == 'BODY')
{
MenuBodyRef = document.all[i]
}
}
return MenuBodyRef.offsetWidth;
}
function MaximizeW()
{
window.moveTo(0,0);
window.resizeTo(screen.width,screen.height);
var borderw = screen.width - getPageOffsetWidth();
window.moveTo(-borderw/2, -borderw/2);
window.resizeTo(screen.width + borderw,screen.height + borderw);
}
MaximizeW(); */

