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_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_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_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 toggle(e) {

        var eVisible = xGetElementById(e)


    if (eVisible.style.visibility=='visible') {
		xHide(e);
	}else{
	   xShow(e);
	}

}

function xShow(e) {

  if(!(e=xGetElementById(e))) return;
  if(e.style && xDef(e.style.visibility)) e.style.visibility='visible';
  else if(xDef(e.visibility)) e.visibility='show';
}

function xHide(e) {
  if(!(e=xGetElementById(e))) return;
  if(e.style && xDef(e.style.visibility)) e.style.visibility='hidden';
  else if(xDef(e.visibility)) e.visibility='hide';
}

function xGetElementById(e) {

  if(typeof(e)!='string') return e;
  if(document.getElementById) e=document.getElementById(e);
  else if(document.all) e=document.all[e];
  else if(document.layers) e=xLayer(e);
  else e=null;

  return e;
}

function xDef() {
  for(var i=0; i<arguments.length; ++i){if(typeof(arguments[i])=='undefined') return false;}
  return true;
}

function confirmSubmit(targetPage){
	var agree=confirm("You are deleting the selected page and all related items. Are you sure you want to continue?");
	if (agree)
		document.location=targetPage ;
	else
		return false ;
	}

	
function resize_iframe(framename)
{

	if (document.getElementById(framename)==null)
	{
		return;
	}
	var browserName=navigator.appName;
		
	if (browserName="Microsoft Internet Explorer")
	{


		if (document.getElementById(framename).height=="100%")
		{
			height = document.body.scrollHeight;
			document.getElementById(framename).height=height
			document.getElementById(framename).height
		}
		
	}else{
			height = "1px";

			if (document.getElementById(framename).style.height=="100%")
			{
				document.getElementById(framename).style.height = height; 
				height = document.getElementById(framename).contentDocument.body.scrollHeight;
				document.getElementById(framename).style.height = height;
			}

}
		
}
			
function increaseFontSize()
 {
	tags = new Array ('div', 'p', 'a', 'font','li','td');
	
	for (j = 0; j < tags.length; j ++) 
	{
		
		var p  = document.getElementById('mainContRow').getElementsByTagName(tags[j]);
		if (p!=null){
			increaseContentFontSize(p);
		}

	}
}
		
function decreaseFontSize()
{

	tags = new Array ('div', 'p', 'a', 'font','li','td');
	for (j = 0; j < tags.length; j ++) 
	{
		var p  = document.getElementById('mainContRow').getElementsByTagName(tags[j]);
		if (p!=null){
			decreaseContentFontSize(p);
		}
	}
	
}  

function decreaseContentFontSize(p)
{
		
		for(i=0;i<p.length;i++) {
			if(p[i].style.fontSize) {
				var s = parseInt(p[i].style.fontSize.replace("px",""));
			} else {
				var s = 12;
			}
			if(s!=min) {
				s -= 1;
			}
			p[i].style.fontSize = s+"px"
		} 
}  




function increaseContentFontSize(p)
{
	
		//var p = document.getElementsByTagName('p');
		for(i=0;i<p.length;i++) {
			if(p[i].style.fontSize) {
				var s = parseInt(p[i].style.fontSize.replace("px",""));
			} else {
				var s = 12;
			}
			if(s!=max) {
				s += 1;
			}
			p[i].style.fontSize = s+"px"
		}
}		





//imageRotator Functions
		function get_random()
		{
			var ranNum= Math.floor(Math.random()*5);
			return ranNum;
		}


	function getRotatorImage(Image)
		{
		whichImage=getRandom(Image);
		return(Image[whichImage]);
		}
		
		function getRotatorHyper(Hyper)
		{
			return(Hyper[whichImage]);
			
		}
		
		function getRotatorLabel(Label)
		{
	
			if (typeof(Label[whichImage])=="object")
			{
				return(Label[whichImage]);
			}else{
				return "";
			
			}
			
		}
		
			
		function getRandom(Image)
		{
		
			var ranNum= Math.floor(Math.random()*(Image.length));
			return ranNum;
		}
		
		function disableEnterKey()
			{
			if (window.event.keyCode == 13) window.event.keyCode = 0;
}
function encodedHtmlString(string) {
     encodedHtml = escape(string);
     encodedHtml = encodedHtml.replace(/\//g,"%2F");
     encodedHtml = encodedHtml.replace(/\?/g,"%3F");
     encodedHtml = encodedHtml.replace(/=/g,"%3D");
     encodedHtml = encodedHtml.replace(/&/g,"%26");
     encodedHtml = encodedHtml.replace(/@/g,"%40");
          
    return encodedHtml;
}	


function displayTimePicker(controlName, FormName, ParameterName){

	PageURL="../moduleAttributesControls/contents/datePicker.aspx?controlName=" + controlName + "&SelectedDate=" + FormName[controlName].value
	window.open(PageURL, "Calendar", "left=400, top=300, height=300, width=400");

}


function openFileUpload(objectId, URL)
{
    window.open(URL, "FileUpload", "top=100, left=100, width=600, height=600, resizable=yes, scrollbars=yes, menubar=no, status=yes;");
}	

function openGPACalculator(objectId)
{
    gpafield  = objectId.id.replace("CalcualateGPA","Edu_CumulativeGPA")
   
    URL = "../gpaCalculator.aspx?fieldId=" + gpafield;
   
    window.open(URL, "FileUpload", "top=100, left=100, width=600, height=600, resizable=yes, scrollbars=yes, menubar=no, status=yes;");
}	

function addAwardTypes(selectbox)
{
    if (buildDropwdown == false)
	{
		var optn = document.createElement("option");
		optn.text = "-- Select One --";
		optn.value = "";
		selectbox.options.add(optn);
		
		optn =  document.createElement("option");
		optn.text = "Academic";
		optn.value = "Academic";
		selectbox.options.add(optn);
		
		optn =  document.createElement("option");  
		optn.text = "Athletic";
		optn.value = "Athletic";
		selectbox.options.add(optn);
		
		optn =  document.createElement("option");   
		optn.text = "Artistic";
		optn.value = "Artistic";
		selectbox.options.add(optn);
		
		optn =  document.createElement("option");  
		optn.text = "Community Service";
		optn.value = "CommunityService";
		selectbox.options.add(optn);
		
			optn =  document.createElement("option");  
		optn.text = "Employment";
		optn.value = "Employment";
		selectbox.options.add(optn);
		
		optn =  document.createElement("option");  
		optn.text = "Extracurricular";
		optn.value = "Extracurricular";
		selectbox.options.add(optn);
	}
	 buildDropwdown = true;
  
}


