function switchit(list){var listElementStyle=document.getElementById(list).style;if(listElementStyle.display=="none"){listElementStyle.display="block";}
else{listElementStyle.display="none";}}
var popupwindow;function gotoanchor(){if(popupwindow=='cocp'){MyWindowTerms.frames.tos.location='../terms-of-use-text-t101.php#cocp';}
if(popupwindow=='faxs'){MyWindowTerms.frames.tos.location='../terms-of-use-text-t101.php#faxs';}
if(popupwindow=='electron'){MyWindowTerms.frames.tos.location='../terms-of-use-text-t101.php#electron';}
if(popupwindow=='ccpmp'){MyWindowTerms.frames.tos.location='../terms-of-use-text-t101.php#ccpmp';}
if(popupwindow=='ecffgr'){MyWindowTerms.frames.tos.location='../terms-of-use-text-t101.php#ecffgr';}
if(popupwindow=='parp'){MyWindowTerms.frames.tos.location='../terms-of-use-text-t101.php#parp';}}
function stringFilter(input){s=document.getElementById(input).value;filteredValues="\\-_ /#";var i;var returnString="";for(i=0;i<s.length;i++){var c=s.charAt(i);if(filteredValues.indexOf(c)==-1){returnString+=c;}else{var rc;var rf;if(c==' '){rc='space';}else{rc=c;}
if(input.indexOf('drivers-license')!=-1){rf='driver\'s license';}
if(input.indexOf('password')!=-1){rf='password';}
alert('The '+rc+' character is not allowed in the '+rf+' field.  This character has been removed from the field.');}}
document.getElementById(input).value=returnString;}
function css_browser_selector(u){var ua=u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1;},g='gecko',w='webkit',s='safari',o='opera',h=document.documentElement,b=[(!(/opera|webtv/i.test(ua))&&/msie\s(\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\/(\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\s|\/)(\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\/(\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?'mobile':is('iphone')?'iphone':is('ipod')?'ipod':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win':is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js'];c=b.join(' ');h.className+=' '+c;return c;};css_browser_selector(navigator.userAgent);function switchit(list){var listElementStyle=document.getElementById(list).style;if(listElementStyle.display=="none"){listElementStyle.display="block";}
else{listElementStyle.display="none";}}
var popupwindow;function gotoanchor(){if(popupwindow=='cocp'){MyWindowTerms.frames.tos.location='../terms-of-use-text-t101.php#cocp';}
if(popupwindow=='faxs'){MyWindowTerms.frames.tos.location='../terms-of-use-text-t101.php#faxs';}
if(popupwindow=='electron'){MyWindowTerms.frames.tos.location='../terms-of-use-text-t101.php#electron';}
if(popupwindow=='ccpmp'){MyWindowTerms.frames.tos.location='../terms-of-use-text-t101.php#ccpmp';}
if(popupwindow=='ecffgr'){MyWindowTerms.frames.tos.location='../terms-of-use-text-t101.php#ecffgr';}
if(popupwindow=='parp'){MyWindowTerms.frames.tos.location='../terms-of-use-text-t101.php#parp';}}
function stringFilter(input){s=document.getElementById(input).value;filteredValues="\\-_ /#";var i;var returnString="";for(i=0;i<s.length;i++){var c=s.charAt(i);if(filteredValues.indexOf(c)==-1){returnString+=c;}else{var rc;var rf;if(c==' '){rc='space';}else{rc=c;}
if(input.indexOf('drivers-license')!=-1){rf='driver\'s license';}
if(input.indexOf('password')!=-1){rf='password';}
alert('The '+rc+' character is not allowed in the '+rf+' field.  This character has been removed from the field.');}}
document.getElementById(input).value=returnString;}
function css_browser_selector(u){var ua=u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1;},g='gecko',w='webkit',s='safari',o='opera',h=document.documentElement,b=[(!(/opera|webtv/i.test(ua))&&/msie\s(\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\/(\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\s|\/)(\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\/(\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?'mobile':is('iphone')?'iphone':is('ipod')?'ipod':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win':is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js'];c=b.join(' ');h.className+=' '+c;return c;};css_browser_selector(navigator.userAgent);var STOP;function getstarted(){STOP=0;stringFilter('drivers-license');if(document.getElementById('course-state').value.length==0){alert('Please select your course state.');document.getElementById('course-state').focus();STOP=1;return false;}
if(document.getElementById('drivers-license').value.length==0){alert('Please enter your driver\'s license number.');document.getElementById('drivers-license').focus();STOP=1;return false;}
if(document.getElementById('drivers-license').value.length<=4){alert('Your driver\'s license number must be at least 5 characters long.  Please re-enter your driver\'s license number.');document.getElementById('drivers-license').focus();STOP=1;return(false);}
if(document.getElementById('last-name').value.length==0){alert('Please enter your last name.');document.getElementById('last-name').focus();STOP=1;return false;}
if(window.RegExp){var reg=new RegExp('(.*)(@)(.*)[.]{1}(.*)','g');if(!reg.test(document.getElementById('email-address').value)){alert('You must enter a valid email address (e.g., john@yahoo.com).');document.getElementById('email-address').focus();STOP=1;return(false);}}
createCookie('coursestate',document.getElementById('course-state').value,0);createCookie('lastname',document.getElementById('last-name').value.toUpperCase(),0);createCookie('driverslicense',document.getElementById('drivers-license').value.toUpperCase(),0);createCookie('emailaddress',document.getElementById('email-address').value,0);createCookie('selfsubmitstateform','YES',0);}
function returningstudents(){STOP=0;stringFilter('drivers-license-2');if(document.getElementById('drivers-license-2').value.length==0){alert('Please enter your driver\'s license number.');document.getElementById('drivers-license-2').focus();STOP=1;return false;}
if(document.getElementById('password').value.length==0){alert('Please enter your password.');document.getElementById('password').focus();STOP=1;return false;}}
function forgotpassword(){STOP=0;if(document.getElementById('drivers-license-2').value.length==0){alert('Please enter your driver\'s license number then click on the Forgot Your Password link.  Your password will be emailed to you.\n\nIf you have not already registered please complete and submit the Start Course form above.');document.getElementById('drivers-license-2').focus();STOP=1;return false;}alert('Your password has been successfully sent to the email address you gave us when you registered. Once you receive your password please try logging in again.\n\nIf you do not receive an email within a few minutes it means that you have not provided us with a correct email address. Please contact customer service if you need further assistance.');}
