 


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 popup(){
 
var openit=window.open('ad/video.htm','Video','height=400,width=500,left=' + (screen.width-460)/2 + ',top=160,scrollbars=no'); 
return false;
}

 

function popup2(){
 
var openit=window.open('ad/test.htm','Video','height=400,width=500,left=' + (screen.width-460)/2 + ',top=160,scrollbars=no'); 
return false;
}
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.Student_EMail.value=="" || document.emailform.Student_EMail.value.indexOf("@")<2) {
error = 1;
alert("Please re-enter your email address and hit subscribe again")
document.emailform.Student_EMail.select()
document.emailform.Student_EMail.focus()
return false
}

}

function hi(){
if ((document.emailform.Student_EMail.value !="")&&(document.emailform.Student_EMail.value.indexOf("@")>2))

alert(document.emailform.Student_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.Student_Name.value !="")&&(document.emailform.Student_EMail.value !="")&&(document.emailform.Comments.value !="")&&(document.emailform.Student_EMail.value.indexOf("@")>2))

alert( "Your comments will be sent to our Guidance Counselor,"+ "\n" + "and you'll be redirected to World College main page")
  
}


function StudentServices(){
if ((document.emailform.Student_Name.value !="")&&(document.emailform.Student_EMail.value !="")&&(document.emailform.Comments.value !="")&&(document.emailform.Student_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.Student_EMail.value !=""))

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 placeFocus() {
 document.forms[0].elements[i].focus();
 
 }

 
 
var submitcount = 0;
var error = 0;

function reset() {
document.emailform.Student_Name.value="";
document.emailform.Student_EMail.value="";
document.emailform.url.value="";
document.emailform.How_Student_Found_Us.value="";
document.emailform.Comments.value="";
document.emailform.operating_system.value = navigator.platform;

 
}

function checkFields1() {


error = 0;
if (document.emailform.Student_Name.value=="") {
error = 1;
alert("Please enter your name and re-submit this form.")
document.emailform.Student_Name.select()
document.emailform.Student_Name.focus()
return false
}
if (document.emailform.Student_EMail.value=="" || document.emailform.Student_EMail.value.indexOf("@")<2) {
error = 1;
alert("Please re-enter your email address and re-submit this form.")
document.emailform.Student_EMail.select()
document.emailform.Student_EMail.focus()
return false
}
 if (document.emailform.How_Student_Found_Us.value=="") {
error = 1;
alert("Please enter how you found about us and re-submit this form.")
document.emailform.How_Student_Found_Us.select()
document.emailform.How_Student_Found_Us.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-2', '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.txtemail2.value == "") {
		alert("Please enter your email address");
		return false;
	}
	
	 
}

