

//sParamIgnored is just that: Ignored. Just put here
//for compatibility with existing code.
function Reset_Image(sParamIgnored)
{
	var i;
	var sImage;
	
	for(i=1; i <=10; i++)
	{
		sImage = 'choice' + i;
		
		if(!document.images[sImage])
		  break;
		
				
		document.images[sImage].src=select_off.src;
	}
	return true;
}



function ValidateDateRange(fromDay, fromMonth, fromYear, toDay, toMonth, toYear)
{
   bReturn = true;
   
   iFromDay = parseInt( fromDay );
   iFromMonth = parseInt( fromMonth );
   iFromYear = parseInt( fromYear );
   iToDay = parseInt( toDay );
   iToMonth = parseInt( toMonth );
   iToYear = parseInt( toYear );
   
   
   //Make sure that we don't have crazy date values (like Feb. 31st or Nov. 31st)
   if (( iFromMonth == 2 ) && ((( iFromYear % 4 == 0 ) && ( iFromMonth > 29 )) || (( iFromYear % 4 != 0 ) && ( iFromDay > 28 ))))
   {
      alert( "Invalid From date." );
      bReturn =  false;
   }
    
   else if ((( iFromMonth == 4 ) || ( iFromMonth == 6 ) || ( iFromMonth == 9 ) || ( iFromMonth == 11 )) && (iFromDay > 30 )) 
   {
      alert( "Invalid From date." );
      bReturn =  false;
   }   
    	   
   else if (( iToMonth == 2 ) && ((( iToYear % 4 == 0 ) && ( iToMonth > 29 )) || (( iToYear % 4 != 0 ) && ( iToDay > 28 )))) 
   {
      alert( "Invalid To date." );
      bReturn =  false;
   }  	
	   
   else if ((( iToMonth == 4 ) || ( iToMonth == 6 ) || ( iToMonth == 9 ) || ( iToMonth == 11 )) && (iToDay > 30 )) 
   {
      alert( "Invalid To date." );
      bReturn =  false;
   }  

   //Make sure that the from date is not bigger than the to date
   else if ( iFromYear > iToYear )
   {
      alert( "The value of the From date can not exceed the value of the To date." );
      bReturn =  false;
   }
   else if ( ( iFromYear == iToYear ) && ( iFromMonth > iToMonth ) )
   {
      alert( "The value of the From date can not exceed the value of the To date." );
      bReturn =  false;
   }
   else if ( ( iFromYear == iToYear ) && ( iFromMonth == iToMonth ) && ( iFromDay > iToDay ) )
   {
      alert( "The value of the From date can not exceed the value of the To date." );
      bReturn =  false;
   }
     
   return bReturn;
}

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.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 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];}}
}

MM_preloadImages('/images/OnlineU/MainMenu_On.GIF','/images/OnlineU/BookMark_On.GIF','/images/OnlineU/Information_On.GIF','/images/OnlineU/TOCbutton_on.GIF','/images/OnlineU/Glossary_On.GIF','/images/OnlineU/Exit_On.jpg','/images/OnlineU/Back_On.GIF','/images/OnlineU/Next_On.GIF','/images/OnlineU/StartExam_On.gif');

function Info_Pop() {
   window.open("/LearnCenter/OnlineU/Information.aspx", "edu_info", "width=801, height=400, status=no,directories=no,menubar=no,resizable=yes,toolbar=no,scrollbars=yes");
}

function Glossary_Pop() {
   window.open("/LearnCenter/Glossary.aspx", "learn_glossary", "width=801, height=400, status=yes,directories=no,menubar=yes,resizable=yes,toolbar=yes,scrollbars=yes");
}

if(document.images){
   select_on = new Image();
   select_on.src = '/LearnCenter/OnlineU/Modules/Images/Select_On.GIF';
   select_off = new Image();
   select_off.src = '/LearnCenter/OnlineU/Modules/Images/Select_Off.GIF';
}
