function checkForm() {
var el = document.forms[0].elements;
for(var i = 0 ; i < el.length ; ++i) {
if(el[i].type == "radio") {
var radiogroup = el[el[i].name];
var itemchecked = false;
for(var j = 0 ; j < radiogroup.length ; ++j) {
if(radiogroup[j].checked) {
itemchecked = true;
break;
}
}
if(!itemchecked) { 
alert("Please make a selection");
if(el[i].focus)
el[i].focus();
return false;
}
}
}
return true;
}

function validatefields(theForm){
// check if the first drop down is selected, if so, invalid selection
if (theForm.cbo_QuestionSet.selectedIndex == 0)
{
alert("Specify Question Set type (Pre or Post).");
theForm.cbo_QuestionSet.focus();
return (false);
}
}

function HideContent(d) {
document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
document.getElementById(d).style.display = "block";
}
function ReverseDisplay(d) {
if(document.getElementById(d).style.display == "none") { document.getElementById(d).style.display = "block"; }
else { document.getElementById(d).style.display = "none"; }
}

<!-- Prevew sections PopUp Window Opener -->
<!-- var newwindow; -->
function popupwin(url)
{
var newwindow;
newwindow=window.open(url,'name','height=610,width=750,left=100, top=100,resizable=yes,scrollbars=yes,toolbar=no,status=yes');
if (window.focus) {newwindow.focus()}
}

<!-- PopUp Window Opener -->
function openNewWindow(URLtoOpen,windowName,height,width)
{
windowFeatures ="menubar=no,scrollbars=yes,location=no,favorites=no,resizable=yes,status=no,toolbar=no,directories=no";
var test = "'"; 
winLeft = (screen.width-width)/2; 
winTop = (screen.height-(height+110))/2; 
myWin= open(URLtoOpen,windowName,"width=" + width +",height=" + height + ",left=" + winLeft + ",top=" + winTop + test + windowFeatures + test);
if (window.focus) {myWin.focus()}
}

<!-- Open PopUp Window in full screen -->
function openNewWindowFull(URLtoOpen,windowName)
{
myWin= open(URLtoOpen,windowName,'menu=no,toolbar=no,resizable=yes,scrollbars=yes,status=yes');
document.write('<center><br>If you see this page but did not get to IDL registration or login page, you will need to disable you popup blocker.<br /><br />If you see an yellow bar saying "Popup blocked" on top of this page, right click on it and select "Always allow..."<br /><br />It is required that you disable popup blocker and enable javascript on your browser to enable some functionalities. <br><br>Click Back button of your browser or<br> Go back to <a href="/" target="_self">EPEC IDL</a></center>');
}
function openNewWindowResize(URLtoOpen,windowName,height,width)
{
if (window.showModalDialog) {
window.showModalDialog(URLtoOpen,windowName,"dialogWidth:" + width + "px;dialogHeight:" + height + "px;edge:sunken;scroll:yes;resizable:yes;status:no;center:yes");
} else {
windowFeatures ="menubar=no,scrollbars=yes,location=no,favorites=no,resizable=yes,status=no,toolbar=no,directories=no";
var test = "'"; 
winLeft = (screen.width-width)/2; 
winTop = (screen.height-(height+110))/2; 
newwindow=window.open(URLtoOpen,windowName,"width=" + width +",height=" + height + ",left=" + winLeft + ",top=" + winTop + test + windowFeatures + test);
if (window.focus) {newwindow.focus()}
}
}
function openNewWindowNoResize(URLtoOpen,windowName,height,width)
{
if (window.showModalDialog) {
window.showModalDialog(URLtoOpen,windowName,"dialogWidth:" + width + "px;dialogHeight:" + height + "px;edge:sunken;scroll:no;resizable:no;status:no;center:yes");
} else {
windowFeatures ="menubar=no,scrollbars=no,location=no,favorites=no,resizable=no,status=no,toolbar=no,directories=no";
var test = "'"; 
winLeft = (screen.width-width)/2; 
winTop = (screen.height-(height+110))/2; 
newwindow=window.open(URLtoOpen,windowName,"width=" + width +",height=" + height + ",left=" + winLeft + ",top=" + winTop + test + windowFeatures + test);
if (window.focus) {newwindow.focus()}
}
}
<!-- External Video Player in Modal Window -->
function modalWin(myplayer, width, height) {
windowFeatures ="toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes ,modal=yes";
if (window.showModalDialog) {
window.showModalDialog(myplayer,"EPEC-Video",
"dialogWidth:" + width + "px;dialogHeight:" + height + "px;edge:sunken;scroll:no;resizable:no;status:no");
} else {
window.open(myplayer,'EPEC-Video',
'height=' + height + ',width=' + width + ',' + windowFeatures);
}
} 
<!-- External Video Player -->
function ExternalPlayer(player, videofile,windowName,height,width)
{
var playernum
var s1 = new SWFObject("flvplayer.swf","single","350","280","7");
	s1.addParam("allowfullscreen","true");
	s1.addVariable("image","images/start.gif");
	s1.addVariable("file","<?php echo $myvideo; ?>");
	s1.addVariable("backcolor","0x000000");
	s1.addVariable("frontcolor","0xCCCCCC");
	s1.addVariable("lightcolor","0xFFFCCC");
	s1.addVariable("overstretch","fit");
	//s1.addVariable("width","300");
	//s1.addVariable("height","250");
	s1.addVariable("autostart","false");
	s1.write("player"+playernum);
}
<!-- Refreshes parent window and cloase the popup -->
function win(){
window.opener.document.location.reload();
self.close();
}

<!-- Change font size -->
<!-- var fontSize = 100; -->
var fontSize = 100;
function FontSizeSet()
{
var el, n = 1;
while (el = document.getElementById('content' + n++))
el.style.fontSize = fontSize + '%';
return false;
}

function SetFontLarger()
{
if (fontSize < 150) 
fontSize=fontSize+15;
return FontSizeSet();
}

function SetFontSmaller()
{
if (fontSize > 80) 
fontSize=fontSize-15;
return FontSizeSet();
}

<!--- Discussion Board Resizing Script -->
//global variables used to track status 
var curHeight=0 
var curPos=0 
var newPos=0 
var mouseStatus='up' 

//this function gets the original div height 
function setPos(e){ 
//for handling events in ie vs. w3c 
curevent=(typeof event=='undefined'?e:event) 
//sets mouse flag as down 
mouseStatus='down' 
//gets position of click 
curPos=curevent.clientY 
//accepts height of the div 
tempHeight=document.getElementById('mydiv').style.height 
//these lines split the height value from the 'px' units 
heightArray=tempHeight.split('p') 
curHeight=parseInt(heightArray[0]) 
} 

//this changes the height of the div while the mouse button is depressed 
function getPos(e){ 
if(mouseStatus=='down'){ 
curevent=(typeof event=='undefined'?e:event) 
//get new mouse position 
newPos=curevent.clientY 
//calculate movement in pixels 
var pxMove=parseInt(newPos-curPos) 
//determine new height 
var newHeight=parseInt(curHeight+pxMove) 
//conditional to set minimum height to 5 
newHeight=(newHeight<5?5:newHeight) 
//set the new height of the div 
document.getElementById('mydiv').style.height=newHeight+'px' 
} 
}





