// Copyright (c) 1999-2003 Cyber-dynamics Inc. All Rights Reserved

function showH(iName,iShow) {
 var oDiv,oDiz,sCon="#990000", sCoff="#000000"; 
 if(document.layers){oDiz=document.all[iName+"z"].style;oDiv=document.all[iName].style;}
 else{if(document.all){oDiz=document.all[iName+"z"].style;oDiv=document.all[iName].style;}
 else{if(document.getElementById){oDiz=document.getElementById(iName+"z").style;oDiv=document.getElementById(iName).style;}}}
 oDiz.visibility=iShow?"visible":"hidden";oDiv.background=iShow?sCon:sCoff;
}
function clickClear(oMe,sVal) {if (oMe.value==sVal){oMe.value='';}}

function submitSub() {
var f=document.newsletterActions,sErr='';
 if ((badEmail(f.Email.value))||(f.Email.value=='youremail@host.com')){sErr += ', Email'}
 if(sErr){alert('Please check the following entries and resubmit:\n'+sErr.substr(2));
 }else{
  if (popper) {if (! popper.closed) {popper.close();}}
  popUp('MTNdownload.html',100,100,220,350);
  tellWait();
  f.title.value=document.title;
  f.target="popper";
  f.submit();
  }
  return false;
}

function checkForm(oForm){var err = "",f;if (oForm) {f=oForm} else {if (document.inquiry){f=document.inquiry;}else{if(document.admanager){f=document.admanager;}}}
var i,s,fE=f.elements,iFound=0;
	for(i=0;i<fE.length;i++){ 
		if  (!((fE[i].name.substr(0,1) == '_') || (fE[i].name.substr(1,1) == '_'))) {
			if  ( ((fE[i].value.indexOf('>') > -1) || (fE[i].value.indexOf('<') > -1)) || (fE[i].value.indexOf('|') > -1) ) {
				alert('Please do not use special characters such as  < > or |\nNote to spammers: you cannot use this form for spamming');iFound = 1;fE[i].focus();break;
		}	}
		if (iFound == 0) {
			var aEmails = new Array(); aEmails = fE[i].value.split("@");if (aEmails.length > 4) {
				alert('Too many @ signs. Please use a + instead if necessary.\nNote to spammers: you cannot use this form for spamming');
				iFound = 1;fE[i].focus();break;	
		}	} 
		if (iFound == 0) {
			var aHTTP = new Array(); aHTTP = fE[i].value.split(/http\:\/\//);if (aHTTP.length > 4) {
				alert('Too many URLs. Please amend.\nNote to spammers: you cannot use this form for spamming or posting links.');
				iFound = 1;fE[i].focus();break;	
	}	}	} 
if(iFound==0){
	iFields = new Array;if(f._required){iFields = f._required.value.split(",");}
	else if(f.i_required){iFields = f.i_required.value.split(",");}
	for (var i=0;i<iFields.length;i++){if(iFields[i].length>1){
if(iFields[i].indexOf("Email")>-1){if(badEmail(f[iFields[i]].value)) {err+=", "+iFields[i];}}else{if (badField(f[iFields[i]].value,2)){err+=", "+iFields[i];}}}}
if(err){alert("Please check the following entries and then submit this form:\n"+err.substr(2));return false;}else{
	if ((f.i_antiSpamDevice) && (cdAntiSpamCheck(f) == 0)) {
		alert('Please confirm the security code.');
		f.i_antiSpamCheck.focus();
	} else {	
		f.title.value=document.title;
		f.submit();
	}}}
	return false;
}

function tellWait() {var s="<html><head><title>Downloading - please wait</title></head><body bgcolor='#f5f9fc'><p style='text-align:center;font-family:Arial,Helvetica,sans-serif;font-size:11px;'><br /><br /><b>D O W N L O A D I NG</b><br /><br />Please Wait</p></body></html>";
popper.document.open;popper.document.write(s);popper.document.close;}
function sStatus(sStr) {window.status=sStr;document.returnValue=true;}
function badEmail(str){if (isBlank(str)||(str.indexOf("@")==-1)||(str.indexOf(".")==-1)||(str.length<6)){return true}else{return false}}	  
function isBlank(str){if(str.length==0){return true};for(i=0;i<=str.length-1;i++){if(str.charAt(i)!=" "){return false}}return true;}
var popper; function popUp(url,pLeft,pTop,pWidth,pHeight){var str='left='+pLeft+',top='+pTop+',width='+pWidth+',height='+pHeight+',resizable=no,scrollbars=no';url=url; 
popper=window.open(url,"popper",str);if (!popper.opener){popper.opener = self;}if (popper.focus != null) {popper.focus();}return false;}

window.defaultStatus=document.title;
function mSt(s) {window.status=s;document.returnValue=true;}

function writeDate() {
	var Da = new Date();var mth = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
	var dow = new Array('Sun','Mon','Tues','Wednes','Thurs','Fri','Satur');var yr=Da.getYear();if (yr<2000){yr+=1900};
	document.write(dow[Da.getDay()]+"day "+Da.getDate()+" "+mth[Da.getMonth()]+", "+yr);
}
