/*-------------------------------------------------------
Begin storing/caching all images for mouseover button Fx
--------------------------------------------------------*/
if(document.images){
  var onImgArray  = new Array()
  var offImgArray = new Array()

  onImgArray["AboutTheBand"]   = new Image()
  offImgArray["AboutTheBand"]  = new Image()
  onImgArray["BuyTheGoods"]    = new Image()
  offImgArray["BuyTheGoods"]   = new Image()
  onImgArray["ContactTheBand"] = new Image()
  offImgArray["ContactTheBand"]= new Image()    
  onImgArray["HearTheBand"]    = new Image()
  offImgArray["HearTheBand"]   = new Image() 
  onImgArray["WatchTheBand"]   = new Image()
  offImgArray["WatchTheBand"]  = new Image()         

  onImgArray["AboutTheBand"].src    = "images/l1on.gif"
  offImgArray["AboutTheBand"].src   = "images/l1.gif"
  onImgArray["BuyTheGoods"].src     = "images/l2on.gif"
  offImgArray["BuyTheGoods"].src    = "images/l2.gif"
  onImgArray["ContactTheBand"].src  = "images/l3on.gif"
  offImgArray["ContactTheBand"].src = "images/l3.gif"    
  onImgArray["HearTheBand"].src     = "images/l4on.gif"
  offImgArray["HearTheBand"].src    = "images/l4.gif" 
  onImgArray["WatchTheBand"].src    = "images/l5on.gif"
  offImgArray["WatchTheBand"].src   = "images/l5.gif" 
}

/*--------------------------------------------------------
This function displays the 'ON' image on a Mouseover Fx
---------------------------------------------------------*/
function imageOn(zone){
  if(document.images){
    document.images[zone].src = onImgArray[zone].src;
  }
}

/*--------------------------------------------------------
This function displays the 'OFF' image on a Mouseout Fx
---------------------------------------------------------*/
function imageOff(zone){
  if(document.images){
    document.images[zone].src = offImgArray[zone].src;
    window.status = 'Doris Daze - Website';
  }
}




/*---------------------------------------------------------
Created: 03/02/2000
Reason : To randomly display custom messages on reload
----------------------------------------------------------*/
function getMessage(num){

	var arrMsg = new Array();

	arrMsg[0]  = "It's All Good - <a href=http://www.cdnow.com/cgi-bin/mserver/SID=984689069/pagename=/RP/CDN/ACCT/cart.html/widgetid=1185129 target=newWindow>Buy it today!</a>";
	arrMsg[1]  = "Hear the band at <a href=http://artists.mp3s.com/artists/29/doris_daze.html target=newWindow>mp3.com</a>";
	arrMsg[2]  = "Five attractive, energetic females whose music makes you want to get up and dance.";
	arrMsg[3]  = "What are you waiting for?";
	
	num = Math.round(Math.random(num)*num);
	return arrMsg[num];
}

/*---------------------------------------------------------
Created: 03/01/2000
Reason : To randomly show a site banner upon page reload
----------------------------------------------------------*/
function popBannerName(num){
    if(navigator.appName == 'Microsoft Internet Explorer' && parseInt(navigator.appVersion) == '4'){
        var num = "3"; //Bug in IE4x have to hard code num
    }
    var num = Math.round(Math.random(num)*num);
    return document.write("<a href='index.htm' target='_self'><img src='images/banner" + num + ".gif' border='0' width='300' height='66' alt='Doris Daze - Website'></a><br><br>" + getMessage(num));
}

/*---------------------------------------------------------
Created: 03/01/2000
Reason : To randomly show a band photo upon page reload
----------------------------------------------------------*/
function popBandPhoto(num){
    if(navigator.appName == 'Microsoft Internet Explorer' && parseInt(navigator.appVersion) == '4'){
        var num = "3"; //Bug in IE4x have to hard code num
    }
    var num = Math.round(Math.random(num)*num);
    return document.write("<img src='images/bandphoto" + num + ".gif' border='1' width='167' height='130' alt='Doris Daze'>");
}

/*---------------------------------------------------------
Created: 03/01/2000
Reason : To display current date and Time to end user
----------------------------------------------------------*/
function popDate(){
    var day = "";var month = "";var myweekday = "";var year = "";    
    var newdate   = new Date(); var mydate = new Date();  
    var dston     = new Date('April 4, 1999 2:59:59');
    var dstoff    = new Date('october 31, 1999 2:59:59');
    var myzone    = newdate.getTimezoneOffset();
    var newtime   = newdate.getTime();   
    var myday     = mydate.getDay();
    var mymonth   = mydate.getMonth();
    var myweekday = mydate.getDate();
    var myyear    = mydate.getYear();
    var year      = myyear;
    var myminutes = mydate.getMinutes();
    
    mydate.setTime(mydate.getTime());
    
    if (year < 2000)    
        year = year + 1900; 
        myhours = mydate.getHours();
        
    if (myhours >= 12){
        myhours = (myhours == 12) ? 12 : myhours - 12; mm = " p.m.";
    }else{
        myhours = (myhours == 0) ? 12 : myhours; mm = " a.m.";
    }       
    
    if (myminutes < 10){
        mytime = ":0" + myminutes;
    }else{
        mytime = ":" + myminutes;
    }
    
    arday    = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
    armonth  = new Array("January ","February ","March ","April ","May ","June ","July ","August ","September ", "October ","November ","December ");
    ardate   = new Array("0th","1st","2nd","3rd","4th","5th","6th","7th","8th","9th","10th","11th","12th","13th","14th","15th","16th","17th","18th","19th","20th","21st","22nd","23rd","24th","25th","26th","27th","28th","29th","30th","31st");
    //This shows the time, but found it to be annoying to the user and not cool anymore
    //var clck = (myhours + mytime + mm + " on ")
    var time = (arday[myday] +" " + armonth[mymonth] +" "+ardate[myweekday] + ", " + year);
    return time;    
}

function mOvr(src,clrOver){ 
	if (!src.contains(event.fromElement)){ 
		src.style.cursor = 'hand'; 
		src.bgColor = clrOver; 
	} 
} 
function mOut(src,clrIn){ 
	if (!src.contains(event.toElement)){ 
		src.style.cursor = 'default'; 
		src.bgColor = clrIn; 
	} 
} 
function mClk(src){ 
	if(event.srcElement.tagName=='TD')
		src.children.tags('A')[0].click();
}

function popWindow(Url,val){
	window.open(Url,'NewWindow',val)
}

function submitForm(form, blnClose){
	if(form.LName.value == '' || form.LName.value == null){
		alert('Please give us your Last Name.');
		form.LName.focus();
		return;
	}
	if(form.elements["Email Address"].value == '' || form.elements["Email Address"].value == null){
		alert('Please enter your Email Address.');
		form.elements["Email Address"].focus();
		return;
	}else{
		if(!checkEmail(form.elements["Email Address"].value)){
			alert('Please ensure that your Email Address has the \'@\' symbol and the \'.\' properly placed.\r' + form.elements["Email Address"].value + ' appears to be incorrectly formatted.');
			form.elements["Email Address"].focus();
			return;	
		}
	}
	
	if(form.elements["Question"].value == '' || form.elements["Question"].value == null){
		alert('Please give us your question and concern.');
		form.elements["Question"].focus();
		return;
	}	
	form.submit();
	
}

function checkEmail(email){
	if(email.indexOf('@') >= 0){
		if(email.indexOf('.') >= 0){
			return true;
		}
	}else{
		return false;	
	}
}

function CheckPassword(form){
	if(((form.Password.value == '')|| (form.Verify.value == ''))||(form.Password.value != form.Verify.value)){
		alert('Please re-enter your Password');
		return;
	}
	
	form.submit();
	
}
function CheckBox(form){
	if((form.FName.value == '') && (form.LName.value == '') && (form.Email.value == '')){
		alert('Please Enter one of the search criteria!!!');
		return;
	}
	
	form.submit();
	
}

function left_toggle(id){
   if (document.all){
     if(document.all[id].style.display == 'none'){
       document.all[id].style.display = '';
     } else {
       document.all[id].style.display = 'none';
     }

  return false;
   } else if (document.getElementById){
     if(document.getElementById(id).style.display == 'none'){
       document.getElementById(id).style.display = 'block';
     } else {
       document.getElementById(id).style.display = 'none';
     }

  return false;
   }
 }

/* to make a default website */

function make_homepage(name)
{
	browserName=navigator.appName;browserVer=parseInt(navigator.appVersion);version="other";
	if ((browserName=="Microsoft Internet Explorer" && browserVer>=4) && (navigator.appVersion.indexOf('5.')>-1)) version="IE5";
		/* IE Version 5 browser URL */
	if (version=="IE5")
	{
		name.style.behavior='url(#default#homepage)';name.setHomePage(location.href);name.href = "http://www.indonesianchurch.com/index.asp";
	}
}
