var scrollerdelay='4000' //delay between msg scrolls. 3000=3 seconds.
var scrollerwidth='150px'
var scrollerheight='105px'
var scrollerbgcolor='#DBDBDB'
//set below to '' if you don't wish to use a background image
var scrollerbackground='scrollerback.gif'

//configure the below variable to change the contents of the scroller
var messages=new Array()
messages[0]="<font face='Arial' size=2>For more info on our Associate Degree program log on to <a href=http://cie-wc.edu>Cleveland Institute of Electronics</a> </font>"
messages[1]="<font face='Arial' size=2>For more info on our Bachelor's Degree program log on to <a href=http://worldcollege.net>World College </a></font>"
 

 

var ie=document.all
var dom=document.getElementById

if (messages.length>2)
i=2
else
i=0

function move1(whichlayer){
tlayer=eval(whichlayer)
if (tlayer.top>0&&tlayer.top<=5){
tlayer.top=0
setTimeout("move1(tlayer)",scrollerdelay)
setTimeout("move2(document.main.document.second)",scrollerdelay)
return
}
if (tlayer.top>=tlayer.document.height*-1){
tlayer.top-=5
setTimeout("move1(tlayer)",50)
}
else{
tlayer.top=parseInt(scrollerheight)
tlayer.document.write(messages[i])
tlayer.document.close()
if (i==messages.length-1)
i=0
else
i++
}
}

function move2(whichlayer){
tlayer2=eval(whichlayer)
if (tlayer2.top>0&&tlayer2.top<=5){
tlayer2.top=0
setTimeout("move2(tlayer2)",scrollerdelay)
setTimeout("move1(document.main.document.first)",scrollerdelay)
return
}
if (tlayer2.top>=tlayer2.document.height*-1){
tlayer2.top-=5
setTimeout("move2(tlayer2)",50)
}
else{
tlayer2.top=parseInt(scrollerheight)
tlayer2.document.write(messages[i])
tlayer2.document.close()
if (i==messages.length-1)
i=0
else
i++
}
}

function move3(whichdiv){
tdiv=eval(whichdiv)
if (parseInt(tdiv.style.top)>0&&parseInt(tdiv.style.top)<=5){
tdiv.style.top=0+"px"
setTimeout("move3(tdiv)",scrollerdelay)
setTimeout("move4(second2_obj)",scrollerdelay)
return
}
if (parseInt(tdiv.style.top)>=tdiv.offsetHeight*-1){
tdiv.style.top=parseInt(tdiv.style.top)-5+"px"
setTimeout("move3(tdiv)",50)
}
else{
tdiv.style.top=parseInt(scrollerheight)
tdiv.innerHTML=messages[i]
if (i==messages.length-1)
i=0
else
i++
}
}

function move4(whichdiv){
tdiv2=eval(whichdiv)
if (parseInt(tdiv2.style.top)>0&&parseInt(tdiv2.style.top)<=5){
tdiv2.style.top=0+"px"
setTimeout("move4(tdiv2)",scrollerdelay)
setTimeout("move3(first2_obj)",scrollerdelay)
return
}
if (parseInt(tdiv2.style.top)>=tdiv2.offsetHeight*-1){
tdiv2.style.top=parseInt(tdiv2.style.top)-5+"px"
setTimeout("move4(second2_obj)",50)
}
else{
tdiv2.style.top=parseInt(scrollerheight)
tdiv2.innerHTML=messages[i]
if (i==messages.length-1)
i=0
else
i++
}
}

function startscroll(){
if (ie||dom){
first2_obj=ie? first2 : document.getElementById("first2")
second2_obj=ie? second2 : document.getElementById("second2")
move3(first2_obj)
second2_obj.style.top=scrollerheight
second2_obj.style.visibility='visible'
}
else if (document.layers){
document.main.visibility='show'
move1(document.main.document.first)
document.main.document.second.top=parseInt(scrollerheight)+5
document.main.document.second.visibility='show'
}
}



 


function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=400,left = 150,top = 50');");
}


 
function scrollit(seed) {
var m1  = "Welcome to Cleveland Institute of Electronics  ";
var m2  = "......SAVE 30% Off Tuition & Start any Program for only $35!";
var m3  = "......Electronics & Computer Technology Training via Distance Learning!";
var m4  = "";
var msg=m1+m2+m3+m4;
var out = " ";
var c   = 1;
if (seed > 100) {
seed--;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else if (seed <= 100 && seed > 0) {
for (c=0 ; c < seed ; c++) {
out+=" ";
}
out+=msg;
seed--;
window.status=out;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else if (seed <= 0) {
if (-seed < msg.length) {
out+=msg.substring(-seed,msg.length);
seed--;
window.status=out;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else {
window.status=" ";
timerTwo=window.setTimeout("scrollit(100)",75);
      }
   }
}

function placeFocus() {
if (document.forms.length > 0) {
var field = document.forms[0];
for (i = 0; i < field.length; i++) {
if ((field.elements[i].type == "text") || (field.elements[i].type == "textarea") || (field.elements[i].type.toString().charAt(0) == "s")) {
document.forms[0].elements[i].focus();
break;
         }
      }
   }
}

 
function checkFields() {
if (document.emailform.email.value=="" || document.emailform.email.value.indexOf("@")<2) {
error = 1;
alert("Please re-enter your email address and hit subscribe again")
document.emailform.email.select()
document.emailform.email.focus()
return false
}

}

function hi(){
if ((document.emailform.email.value !="")&&(document.emailform.email.value.indexOf("@")>2))

alert(document.emailform.email.value + " will be subscribed for CIE monthly free news letter. ")
   
}
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_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];}}
}

function Start(page) {
OpenWin = this.open(page, "CtrlWindow", "toolbar=yes,menubar=yes,location=yes,scrollbars=yes,resizable=yes");
}

function MM_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.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 hi(){
if ((document.emailform.name.value !="")&&(document.emailform.email.value !="")&&(document.emailform.comments.value !="")&&(document.emailform.email.value.indexOf("@")>2))

alert( "         Thank you for your comments"+ "\n" + "you'll be redirected to The Electron main page.")
  
}


function StudentServices(){
if ((document.emailform.name.value !="")&&(document.emailform.email.value !="")&&(document.emailform.comments.value !="")&&(document.emailform.email.value.indexOf("@")>2))

alert( "Your comments will be sent to our Student Services Department,"+ "\n" + "and you'll be redirected to World College main page")
  
}


function placeFocus() {
 document.forms[0].elements[i].focus();
 
 }

function FreeCatalog(){
if ((document.emailform.first_name.value !="")&&(document.emailform.last_name.value !="")&&(document.emailform.address.value !="")&&(document.emailform.city.value !="")&&(document.emailform.email.value !=""))

alert("Thank you for requesting a CIE Bookstore Catalog."+"\n"+"It will arrive in the mail within the next 3 days."+ "\n" + "If you have any questions please call CIE Bookstore at (800) 321-2155.")
  
}


function placeFocus() {
 document.forms[0].elements[i].focus();
 
 }

 
 
var submitcount = 0;
var error = 0;

function reset() {
document.emailform.name.value="";
document.emailform.email.value="";
document.emailform.url.value="";
document.emailform.found.value="";
document.emailform.comments.value="";
document.emailform.operating_system.value = navigator.platform;

 
}

function checkFields1() {


error = 0;
if (document.emailform.name.value=="") {
error = 1;
alert("Please enter your name and re-submit this form.")
document.emailform.name.select()
document.emailform.name.focus()
return false
}
if (document.emailform.email.value=="" || document.emailform.email.value.indexOf("@")<2) {
error = 1;
alert("Please re-enter your email address and re-submit this form.")
document.emailform.email.select()
document.emailform.email.focus()
return false
}
if (document.emailform.comments.value=="") {
error = 1;
alert("Please enter your comments and re-submit this form.")
document.emailform.comments.select()
document.emailform.comments.focus()
return false
}

 

if (error == 0)  
   {
   if (submitcount == 0)
      {
      submitcount++;
      return true;
      }
   else 
      {
      alert("This form is already being submitted.  Thanks!");
      return false;
      }
   }
}


  function toggle(target)
  {
 
 var checkit=document.frm.payment[2].checked
 
 
 
 if((checkit) && (document.all)){
    document.all[target].style.display='inline';
 }else if ((checkit) && !(document.all)){
   document.getElementById(target).style.display='inline'}   
  
 if((!checkit) && (document.all)){
    document.all[target].style.display='none';
 }else if ((checkit) && !(document.all)){
   document.getElementById(target).style.display='none'} 
  
   
  }

function OpenCertDetails()
	{
	thewindow = window.open('https://www.thawte.com/cgi/server/certdetails.exe?code=USCLEV21', 'anew', config='height=400,width=450,toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,directories=no,status=yes');
	}
	
function ValidatePassword() {
	if (document.frmSignUp.pswd1.value == ""){
		alert("Please enter a password");
		document.frmSignUp.pswd1.focus()
		return false;
	}
	
	if (document.frmSignUp.pswd1.value != document.frmSignUp.pswd2.value) {
		alert("Your password entries do not match");
		document.frmSignUp.pswd1.focus()
		return false;
	}
	
	var strPassword
	strPassword = document.frmSignUp.pswd1.value
	if ( strPassword.length < 6){
		alert("Your password must be atleast 6 characters long");
		document.frmSignUp.pswd1.focus()
		return false;
	}
	
	return true;
}


function ValidateForgotPassword() {

	if (document.frmForgot.txtEmail.value == "") {
		alert("Please enter your email address");
		return false;
	}
	
	 
}


function NewsLetter(){
if (document.emailform.email.value=="" || document.emailform.email.value.indexOf("@")<2){
alert("Please re-enter your email address and hit subscribe again");
return false;
}else{

alert("Thank you for requesting a CIE Course Catalog."+"\n"+"It will arrive in the mail within the next 3 days"+ "\n" + "If you have any questions please call a CIE Guidance Counselor at (800) 243-6446")
 
}

  
}


function FreeCatalogNOTGOOD(){
if ((document.emailform.first_name.value !="")&&(document.emailform.last_name.value !="")&&(document.emailform.address.value !="")&&(document.emailform.city.value !="")&&(document.emailform.email.value !=""))

alert("Thank you for requesting a CIE Bookstore Catalog."+"\n"+"It will arrive in the mail within the next 3 days"+ "\n" + "If you have any questions please call  CIE BooKstore at (800) 321-2155")
  
}



