function PrintThisPage(objectName){
	if(document.getElementById(objectName)){

	var sOption="toolbar=yes,location=no,toolbar=yes,directories=yes,menubar=yes,"; 
		sOption+="scrollbars=yes,width=750,height=600,left=100,top=25"; 

   var sWinHTML = document.getElementById(objectName).innerHTML; 
   
   var winprint=window.open("","",sOption); 
	   winprint.document.open(); 
	   winprint.document.write('<html><head><title>Niagara Catholic District School Board</title></head><body>'); 
			winprint.document.write('<div id="container">');
			winprint.document.write(sWinHTML);          
			winprint.document.write('</div>');
	   winprint.document.write('<div>Source: <a href="http://www.niagaracatholic.ca">http://www.niagaracatholic.ca</a></div>');
	   winprint.document.write('<div id="container">');	   
	   winprint.document.write('</body></html>'); 
	   winprint.document.close(); 
	   winprint.focus();
	   winprint.print();
	}else{
		window.print();
	}
}

function submitSearch(sForm, sPhase){	
	gsPhase = document.getElementById(sPhase);
	if(gsPhase.value != "" )document.location="index.php?UI=SearchResultFront&phase=" + gsPhase.value;
}

var winRef;				
function openWindow(url, name){
	sWidth = screen.width;
	sHeight = screen.height;
	
	wWidth = sWidth/2;
	wHeight = sHeight/2;
	
	wTop = 0;  
	wLeft = sWidth - wWidth;
	//alert(screen.width+'x'+screen.height);
	features = "toolbar=0,";
	features += "location=0,";
	features += "directories=0,";
	features += "status=0,";
	features += "menubar=1,";
	features += "scrollbars=1,";
	features += "resizable=1,";
	features += "width=" + wWidth + ",";
	features += "height="+ wHeight +",";
	features += "top="+ wTop +",";
	features += "left="+ wLeft +",";
	winRef = window.open( url, name, features );
	winRef.focus();
}

function MM_CheckFlashVersion(reqVerStr,msg){
  with(navigator){
    var isIE  = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);
    var isWin = (appVersion.toLowerCase().indexOf("win") != -1);
    if (!isIE || !isWin){  
      var flashVer = -1;
      if (plugins && plugins.length > 0){
        var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";
        desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;
        if (desc == "") flashVer = -1;
        else{
          var descArr = desc.split(" ");
          var tempArrMajor = descArr[2].split(".");
          var verMajor = tempArrMajor[0];
          var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");
          var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;
          flashVer =  parseFloat(verMajor + "." + verMinor);
        }
      }
      // WebTV has Flash Player 4 or lower -- too low for video
      else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;

      var verArr = reqVerStr.split(",");
      var reqVer = parseFloat(verArr[0] + "." + verArr[2]);
  
      if (flashVer < reqVer){
        if (confirm(msg))
          window.location = "http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
      }
    }
  } 
}
