// JavaScript Document
/*image = new Array
image[1]="/images/main_img_a.html"
image[2]="/images/main_img_b.html"
image[3]="/images/main_img_c.html"
image[4]="/images/main_img_d.html"

 random_num = (Math.round((Math.random()*3)+1))
*/
function swap(imgname, filename) 
{
	if (document.images) 
    {
	document [imgname].src = filename;
	
	}
 }
	
function txtswap(obj1,txt)
{
	document.getElementById(obj1).innerHTML=txt;	
} 	



function formHandler(form)
{
	var URL = document.form.site.options[document.form.site.selectedIndex].value;
	var ASS = "<% response.write CEU_SERVER %>/interactive_catalogue.asp?IQVillage=&strState="
	window.location.href = ASS+URL;
}


function checkSelect()
{		
	if ( document.courseQuery.studyType.value =="insurancece" || document.courseQuery.studyType.value =="insuranceceAdjuster" )
	 {		 	
	 	document.all.stateArea.style.display="";
		var show=document.courseQuery.strState.value;		
		if ( document.courseQuery.strState.value =="" )
		{
		
		}
		else if (document.courseQuery.strState.value =="NH" && document.courseQuery.studyType.value =="insuranceceAdjuster" )
		{
			document.all.adjustSubTypeArea.style.display="";
			
			if ( document.courseQuery.adjustSubType.value =="" )
			{
			
			}
			else
			{ 
            	document.courseQuery.submit(); 
            }
		}
	   else
		{
        	document.courseQuery.submit();	
        }
		
	 }
	else
	 {	 	
	 	document.all.stateArea.style.display="none";
	 	document.courseQuery.submit();
	 }
	 
	 
		
}

	function displayAdjusterSublictype(who)
	{
		alert("inside_display Adjuster");
		if (who==1 || who==200 )
		{	
			document.all('adjuster_Sub_license_area').style.display = "none"; 
		}
		else if (who==2)
		{				
				if (document.all('Licensestate2')[0].checked==true && document.all('state1').value=="NH" )
				{		
					document.all('adjuster_Sub_license_area').style.display = "";
				}
				else if (document.all('Licensestate2')[1].checked==true && document.all('InsurLicState').value=="NH")
				{
					document.all('adjuster_Sub_license_area').style.display = "";
				}
				else
				{	
                	document.all('adjuster_Sub_license_area').style.display = "none";
                }
		}
	}



//var pausecontent=new Array()
//pausecontent[0]='"I really love being able to take continuing education classes at my own pace.  I can focus on the areas I need to learn more about.  I also love not having to drive anywhere which not only saves me a lot of time, but with gas prices these days, money too! "'
//pausecontent[1]='"I have looked at other courses – online, and offered by booklet.  CEU.com has, by far, the best and most readily understood presentation."'
//pausecontent[2]='"I like using CEU.com, it’s the only place I go for all my CE needs."'
//pausecontent[3]='"I found your contact and company very helpful in assisting with the enrollment of this course.  The course provided a good overview of the BOP and the examples and explanations were clear.  I would recommend to business associates."'
//pausecontent[4]='"Courses are very easy to follow and understand. The questions at the end of each section do help to summarize what was learned in preparation for the exam at the end."'
//pausecontent[5]='"I like the ease and convenience of the courses to stay current with my licensing.  I have a busy schedule and this makes it easier than attending a physical classroom."'
//pausecontent[6]='"Love the module format.  Interacting with the system really helped the information sink in."'
//pausecontent[7]='"Great website... easy to use... great customer service people who helped me navigate the site."'
//pausecontent[8]='"Enjoyed the ability to print down course materials for review purposes outside of sitting at the computer."'
//pausecontent[9]='"Great variety of learning tools!  Instructions were easy to follow.  Cost was just right."'
//pausecontent[10]='"The exam did a great job reviewing the fundamentals and the audio gave great detail and examples on the applications of certain coverages."'
//pausecontent[11]='"The individual at CEU.com that I spoke with when I registered was excellent, very professional and really nice!"'
//pausecontent[12]='"I really enjoyed taking the course and would like to continue my continuing ed right here."'



/***********************************************
* Pausing up-down scroller- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

function pausescroller(content, divId, divClass, delay)
{
	this.content=content //message array content
	this.tickerid=divId //ID of ticker div to display information
	this.delay=delay //Delay between msg change, in miliseconds.
	this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
	this.hiddendivpointer=1 //index of message array for hidden div
	document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">		'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
	var scrollerinstance=this
	if (window.addEventListener) //run onload in DOM2 browsers
	window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
	else if (window.attachEvent) //run onload in IE5.5+
	window.attachEvent("onload", function(){scrollerinstance.initialize()})
	else if (document.getElementById) //if legacy DOM browsers, just start scroller after 0.5 sec
	setTimeout(function(){scrollerinstance.initialize()}, 500)
}

// -------------------------------------------------------------------
// initialize()- Initialize scroller method.
// -Get div objects, set initial positions, start up down animation
// -------------------------------------------------------------------

pausescroller.prototype.initialize=function()
{
	this.tickerdiv=document.getElementById(this.tickerid)
	this.visiblediv=document.getElementById(this.tickerid+"1")
	this.hiddendiv=document.getElementById(this.tickerid+"2")
	this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))
	//set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
	this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
	this.getinline(this.visiblediv, this.hiddendiv)
	this.hiddendiv.style.visibility="visible"
	var scrollerinstance=this
	document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
	document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
	if (window.attachEvent) //Clean up loose references in IE
	window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
	setTimeout(function(){scrollerinstance.animateup()}, this.delay)
}


// -------------------------------------------------------------------
// animateup()- Move the two inner divs of the scroller up and in sync
// -------------------------------------------------------------------

pausescroller.prototype.animateup=function()
{
	var scrollerinstance=this
	if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+0)){
	this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-3+"px"
	this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-3+"px"
	setTimeout(function(){scrollerinstance.animateup()}, 180)
}
else
{
	this.getinline(this.hiddendiv, this.visiblediv)
	this.swapdivs()
	setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
}
}

// -------------------------------------------------------------------
// swapdivs()- Swap between which is the visible and which is the hidden div
// -------------------------------------------------------------------

pausescroller.prototype.swapdivs=function()
{
	var tempcontainer=this.visiblediv
	this.visiblediv=this.hiddendiv
	this.hiddendiv=tempcontainer
}

pausescroller.prototype.getinline=function(div1, div2)
{
	div1.style.top=this.visibledivtop+"px"
	div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
}

// -------------------------------------------------------------------
// setmessage()- Populate the hidden div with the next message before it's visible
// -------------------------------------------------------------------

pausescroller.prototype.setmessage=function()
{
	var scrollerinstance=this
	if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
	setTimeout(function(){scrollerinstance.setmessage()}, 300)
	else
    {
		var i=this.hiddendivpointer
		var ceiling=this.content.length
		this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
		this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
		this.animateup()
	}
}

pausescroller.getCSSpadding=function(tickerobj)
{ //get CSS padding value, if any
	if (tickerobj.currentStyle)
	return tickerobj.currentStyle["paddingTop"]
	else if (window.getComputedStyle) //if DOM2
	return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
	else
	return 0
}
