// JavaScript Document
/* Copy rights date */
var d = new Date();
var curr_year = d.getFullYear();

/* Chat popu up*/
function loadChat(){
    window.open('chat.html','unique','scrollbars=no,menubar=no,resizable=0,location=no,screenX=50,screenY=100,width=450,height=360');
}

/* Login popup*/
function showHide(divID, imgID){
	if (document.getElementById(divID).style.display == "none") {
		document.getElementById(divID).style.display = "block";		
	} else {
		document.getElementById(divID).style.display = "none";		
	}
}
function monitorClick(e){
        var evt = (e)?e:event;
        var theElem = (evt.srcElement)?evt.srcElement:evt.target;
        while(theElem!=null){
                if((theElem.id == "hideDiv" || theElem.id=="dirImg")) {
                        document.getElementById('hideDiv').style.display = 'block';
                        return true;
                }
                theElem = theElem.offsetParent;
        }
        document.getElementById('hideDiv').style.display = 'none';
        return true;
}
document.onclick = monitorClick;

/* Show and hide content for Home page*/
function toggle() {
	var ele = document.getElementById("toggleText");
	var text = document.getElementById("displayText");
	if(ele.style.display == "block") {
    		ele.style.display = "none";
		text.innerHTML = "<strong class='more-info'>More Information</strong>";
  	}
	else {
		ele.style.display = "block";
		text.innerHTML = "<strong class='more-info-active'>More Information</b>";
	}
} 

/* DIP State selection dopdown */
function idsstateSelected() {
               var state=document.getElementById('STATE_IDS');
                if(state.selectedIndex == 0) {
                        alert("Please Select the State");
                }else {
                        var selectedState = state.options[state.selectedIndex].value; 
                       /* var teenstate = selectedState.toUpperCase();
			Set_Cookie('STATE',teenstate);*/
                        action=selectedState;
                        location.href=action;
                }
                
                        
}

/* Teen State selection dopdown */
function teenstateSelected() {
               var state=document.getElementById('STATE_TEEN');
                if(state.selectedIndex == 0) {
                        alert("Please Select the State");
                }else {
                        var selectedState = state.options[state.selectedIndex].value; 
                       /* var teenstate = selectedState.toUpperCase();
			Set_Cookie('STATE',teenstate);*/
                        action=selectedState;
                        location.href=action;
                }
                
                        
}
/* Mature State selection dopdown */
function maturestateSelected() {
              var state=document.getElementById('STATE_MATURE');
             if(state.selectedIndex == 0) {
                        alert("Please Select the State");
                }else {
                        var selectedState = state.options[state.selectedIndex].value; 
                        /*var state = selectedState.toUpperCase();
			Set_Cookie('STATE',state);*/
                        action=selectedState;
                        location.href=action;
                }
                        
}

/* Driver Record State selection dopdown */
function drstateSelected() {
              var state=document.getElementById('STATE_DR');
             if(state.selectedIndex == 0) {
                        alert("Please Select the State");
                }else {
                        var selectedState = state.options[state.selectedIndex].value; 
                        /*var state = selectedState.toUpperCase();
			Set_Cookie('STATE',state);*/
                        action=selectedState;
                        location.href=action;
                }
                        
}

function pwd()
{
location.href="https://www.idrivesafely.com/course/forgotPassword.pl?"
}
