// Copyright (c) 1999-2003 Cyber-dynamics Inc. All Rights Reserved

function showH(iName,iShow) {
 var oDiv,oDiz,sCon="#990000", sCoff="#666666"; 
 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() {
  if (popper) {if (! popper.closed) {popper.close();}}
  popUp('http://www.sipadan.com/facebook.php',100,100,600,300);
  return false;
}

function checkForm(){
var err = "";f=document.inquiry;
iFields = new Array;iFields = f._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,3)){err+=", "+iFields[i];}}}}
if(err){alert("Please check the following entries and then submit this form:\n"+err.substr(2));return false;}else{
  if (popper) {if (! popper.closed) {popper.close();}}
  popUp('SCUBAdownload.html',100,100,220,350);
  tellWait();
  f.title.value=document.title;
  f.target="popper";
  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 badField(str,minlength){if(isBlank(str)||(str.length<minlength)){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;}
var srchr; function srchUp(url){var str='left=0,top=0,width=450,height='+(screen.height-100)+',resizable=yes,scrollbars=yes';url=url; 
srchr=window.open(url,"srchr",str);if (!srchr.opener){srchr.opener = self;}if (srchr.focus != null) {srchr.focus();}return false;}
function mSt(s) {window.status=s;document.returnValue=true;}
function bookM(){if (document.all){var uRL=self.location.href,txt=self.document.title;window.external.AddFavorite(uRL,txt);}else{alert("Please click OK then press CTRL-D");}}
function homeP(){if (document.all){document.all[0].style.behavior='url(#default#homepage)';document.all[0].setHomePage(self.location.href);}else{alert("Please click OK then View/Options or Parameters and set Current Page as Home Page");}}
function printP(){if (parseInt(navigator.appVersion)>=4){window.print();}else{alert("This action is not supported by your browser\nPlease select File/Print");}}
function pDate() {
var monthNames=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
var dayNames=new Array("Sun","Mon","Tues","Wednes","Thurs","Fri","Satur");
var now=new Date(),yr = now.getYear();if (yr<1900){yr+=1900;}
document.write(dayNames[now.getDay()]+"day, ");document.write(monthNames[now.getMonth()]+" "+now.getDate()+", "+yr);}
function getTime() {
 var time=new Date(); time.setTime(time.getTime());
 var iHr=time.getHours(),iMin=time.getMinutes(),iSec=time.getSeconds(),
 tp =""+((iHr>12)?iHr-12:iHr); 
 tp+=((iMin<10)?":0":":")+iMin; tp+=((iSec<10)?":0":":")+iSec;tp+=(iHr>=12)?" PM":" AM";
 document.fm.WTclock.value = tp; var i=setTimeout("getTime()",1000);
}
window.defaultStatus=document.title;
function mSt(s) {window.status=s;document.returnValue=true;}
