
var nslayer = (document.layers)  ? 1:0;

var ielayer = (document.all)  ? 1:0;

 

var do_submit = "";

var num_shipops = 0;

 

function checkmailform() {

do_submit = "YES";

 

if(do_submit=="YES") {

if(document.mailform.first.value=='' || document.mailform.first.value=='Name') {

alert("Please enter a NAME.          ");

if(nslayer==1 || ielayer==1)

{document.mailform.first.focus()}

do_submit="NO"}}

 

if(do_submit=="YES") {

if(checkemail(document.mailform.email.value)==false || document.mailform.email.value=='Email') {

alert("Please enter a valid EMAIL.          ");

if(nslayer==1 || ielayer==1)

{document.mailform.email.focus()}

do_submit="NO"}}

 

if(do_submit=="YES") {

document.mailform.submit();

}

 

}


function checkemail(the_value) {

// Checks the email field for:

// 1. must be at least 6 characters long i.e. 1@3.56

// 2. cannot begin with a "@" or a "."

// 3. cannot end with a "@" or a "."

// 4. cannot have 2 "." in a row

// 5. cannot have ".@" nor "@."

// 6. must contain 1 "@" and at least 1 "."

// 7. must have 2 or 3 characters after the final "."

// 8. checks specified bad chars like commas

var amp1 = 0;

var dot1 = 0;

var postdot1 = 0;

if (the_value.length<6)

{return false}

if (the_value.charAt(0)=='.')

{return false}

if (the_value.charAt(the_value.length)=='.')

{return false}

if (the_value.charAt(0)=='@')

{return false}

if (the_value.charAt(the_value.length)=='@')

{return false}

amp1 = 0;

dot1 = 0;

postdot1 = 0;

for (var i = 0; i < the_value.length; i++)

{

if (the_value.charAt(i)==',') // add bad chars here

{return false}

if (the_value.charAt(i)=='@')

{if (the_value.charAt(i-1)=='.')

{return false}

amp1=amp1+1}

if (the_value.charAt(i)=='.')

{if (the_value.charAt(i-1)=='.')

{return false}

if (the_value.charAt(i-1)=='@')

{return false}

if (dot1>0)

{dot1=0;

postdot1=0}

dot1=dot1+1}

if (dot1>0)

{postdot1=postdot1+1}

}

if (amp1!=1)

{return false}

if (dot1<1)

{return false}

if (postdot1!=5 && postdot1!=4 && postdot1!=3)

{return false}

return true

}


// Browser detect

var doit = false

 

with(navigator) {

  code = appCodeName; 

  app = appName; 

  version = appVersion; 

  iver = parseInt(version); 

  ua = userAgent;

  }

 

// this will work in "Mozilla" 3+ (includes MSIE 4)

if ( code == "Mozilla" && iver >= 3 )

{doit = true}

else 

{doit = false}

 

if (doit==true)

{

if (document.images) {

// Main Rollover ON Graphics (when moused over)

submit_info_buton = new Image();  submit_info_buton.src = "images/submit_info_on.gif";

 

program_guide_buton = new Image();  program_guide_buton.src = "images/program_guide_on.gif";

tickets_buton = new Image();  tickets_buton.src = "images/tickets_on.gif";

 

 

about_us_buton = new Image();  about_us_buton.src = "images/about_us_on.gif";

articles_buton = new Image();  articles_buton.src = "images/articles_on.gif";

links_buton = new Image();  links_buton.src = "images/links_on.gif";

contact_buton = new Image();  contact_buton.src = "images/contact_on.gif";

 

// Main Rollover OFF Graphics (when NOT moused over)

submit_info_butoff = new Image();  submit_info_butoff.src = "images/submit_info_off.gif";

 

program_guide_butoff = new Image();  program_guide_butoff.src = "images/program_guide_off.gif";

tickets_butoff = new Image();  tickets_butoff.src = "images/tickets_off.gif";

 

learn_butoff = new Image();  learn_butoff.src = "images/learn_off.gif";

about_us_butoff = new Image();  about_us_butoff.src = "images/about_us_off.gif";

articles_butoff = new Image();  articles_butoff.src = "images/articles_off.gif";

links_butoff = new Image();  links_butoff.src = "images/links_off.gif";

contact_butoff = new Image();  contact_butoff.src = "images/contact_off.gif";

 

 

}

}

 

// Main Rollover Functions (ON and OFF)

function turnOn(imageName) {

if (doit==true)

{if (document.images) {

    document[imageName].src = eval(imageName + "on.src"); }}

}        

function turnOff(imageName) {

if (doit==true)

{if (document.images) {

    document[imageName].src = eval(imageName + "off.src"); }}

}

 

 

function presubturn(objectnumber,the_action) {

the_div = "div_"+objectnumber;

the_subdiv = "subdiv_"+objectnumber;

 

document.getElementById(the_subdiv).style.marginLeft = 6

if((document.getElementById(the_div).offsetLeft + document.getElementById(the_subdiv).offsetWidth) > document.body.offsetWidth) {

 

                x = (document.getElementById(the_div).offsetLeft + document.getElementById(the_subdiv).offsetWidth) - document.body.offsetWidth;

                

                document.getElementById(the_subdiv).style.marginLeft = (parseInt(document.getElementById(the_subdiv).style.marginLeft)-x).toString()+"px";

                //alert(document.getElementById(the_subdiv).style.marginLeft)

                //document.getElementById(the_subdiv).style.marginLeft = (parseInt(document.getElementById(the_subdiv).style.marginLeft)-(document.body.offsetWidth-document.getElementById(the_div).offsetLeft.toString())).toString()+"px";

}

 

y = subturn(objectnumber,the_action);

}

 

 

var the_iframe = "";

var the_subdiv = "";

var whataction = "";

 

function subturn(objectnumber,the_action) {

 

the_subdiv = "subdiv_"+objectnumber;

 

whataction = "";

if(the_action=="open") {whataction = "visible"} // open

if(the_action=="close") {whataction = "hidden"} // close

if(whataction!="") {

                if (moz5) {

                

                document.getElementById(the_subdiv).style.visibility=whataction;

                }

                if (ns4) {

                

                document.layers[the_subdiv].style.visibility=whataction;

                }

                if (ie4) {

                

                document.all[the_subdiv].style.visibility=whataction;

                }

}

}        


var ns4 = (document.layers)  ? 1:0;

var ie4 = (document.all)  ? 1:0;

var moz5 = ((navigator.userAgent.toLowerCase().indexOf("mozilla")==0) && (navigator.userAgent.toLowerCase().charAt(8) >= 5) && (navigator.userAgent.toLowerCase().indexOf("compatible")<0));

 

function doLayer(whichLayer) {

                if (moz5) {

                //document.getElementById(whichLayer).style.position="relative";

                document.getElementById(whichLayer).style.visibility="visible";

                //document.getElementById(whichLayer).style.display="none";

                }

                if (ns4) {

                //document.layers[whichLayer].position="relative";

                document.layers[whichLayer].visibility="visible";

                }

                if (ie4) {

                //document.all[whichLayer].style.position="relative";

                document.all[whichLayer].style.visibility="visible";

                }

}

 

function undoLayer(whichLayer) {

                if (moz5) {

                document.getElementById(whichLayer).style.visibility="hidden";

                document.getElementById(whichLayer).style.display="block";

                }

                if (ns4) {

                document.layers[whichLayer].visibility="hidden";

                }

                if (ie4) {

                document.all[whichLayer].style.visibility="hidden";

                }

}


function openwin(page_name,width1,height1,scrollbars1,resizable1,menubar1,status1,toolbar1,titlebar1,location1) {

if(typeof popup_window != 'undefined') {

if(popup_window != null) {

if(popup_window.closed==false) {

popup_window.close();

} // window closed

} // window null

} // window undefined

popup_window=window.open(page_name,"popup_window","WIDTH="+width1+",HEIGHT="+height1+",top=45,left=50,menubar="+menubar1+",resizable="+resizable1+",scrollbars="+scrollbars1+",status="+status1+",toolbar="+toolbar1+",titlebar="+titlebar1+",location="+location1);

if(typeof popup_window != 'undefined') {

if(popup_window != null) {

if(popup_window.closed==false) {

popup_window.focus();

} // window closed

} // window null

} // window undefined

return

}


function imgborder(id,theaction) {

for(i = 0; i < document.images.length; i++) {

if(id==document.images[i].name) {

if(theaction=="on") {

document.images[i].className="imageborder_on";

}

else {

document.images[i].className="imageborder_off";

}

}

}

}


function imgborder2(id,theaction) {

for(i = 0; i < document.images.length; i++) {

if(id==document.images[i].name) {

if(theaction=="on") {

document.images[i].className="imageborder2_on";

}

else {

document.images[i].className="imageborder2_off";

}

}

}

}


function navbg(thediv,theaction) {

if(theaction=="on") {

                document.getElementById(thediv).className="navbg";

}

else {

                document.getElementById(thediv).className="";

}

}
