function emailSite() {
	
	if(Mailer.address.value != '') { 
		this.location.href = 'mailto:' + document.Mailer.address.value + '?subject=A friend wants you to visit Bloomingvails, LLC..com&body=Bloomingvails, LLC. provides full service interior and exterior holiday decoration services to the greater Vail Valley.  Whether you\'re looking for outdoor tree lighting, your home fully decorated for the holidays, or any of the materials to do it yourself, Bloomingvails, LLC. is your solution!  Choose from any of the following holiday decorations:  Outdoor tree lighting, home lighting, Christmas trees (decorated or not), tree ornaments, wreaths, poinsettias and more!  Let Bloomingvails, LLC. take care of everything for you this holiday season.  Just pick from the following holiday home decoration packages, let us know when you are arriving, and we\'ll take care of the rest!  Visit Bloomingvails, LLC. at www.Bloomingvails, LLC..com'; 
		return true; 
	} 
	else { 
		alert('Please enter an email address'); 
		return false;
	}
}

function enableForm(theForm) {

	if (theForm.chkSameAddr.checked==true) {
		//enable all form fields
		//alert('enable fields');
		theForm.txtvvaddr1.disabled=true;
		theForm.txtvvaddr2.disabled=true;
		theForm.txtvvcity.disabled=true;
		theForm.txtvvstate.disabled=true;
		theForm.txtvvzip.disabled=true;
		theForm.txtvvphone.disabled=true;
		
		/*
		for (var i = 1; i<theForm.length; i++)    		
			if (theForm.elements[i].name=='txtvvaddr1') {
				theForm.elements[i].disabled=false;
			}
    		if (theForm.elements[i].name=='txtvvaddr2') {
				theForm.elements[i].disabled=false;
			}
    		if (theForm.elements[i].name=='txtvvcity') {
				theForm.elements[i].disabled=false;
			}
    		if (theForm.elements[i].name=='txtvvstate') {
				theForm.elements[i].disabled=false;
			}
    		if (theForm.elements[i].name=='txtvvzip') {
				theForm.elements[i].disabled=false;
			}
    		if (theForm.elements[i].name=='txtvvphone') {
				theForm.elements[i].disabled=false;
			}
		*/
	}
	else {
		//disable all form fields
		//alert('disable fields');		

		theForm.txtvvaddr1.disabled=false;
		theForm.txtvvaddr2.disabled=false;
		theForm.txtvvcity.disabled=false;
		theForm.txtvvstate.disabled=false;
		theForm.txtvvzip.disabled=false;
		theForm.txtvvphone.disabled=false;
		
		/*
		for (var i = 1; i<theForm.length; i++)			
    		if (theForm.elements[i].name=='txtvvaddr1') {
				theForm.elements[i].disabled=true;
			}
    		if (theForm.elements[i].name=='txtvvaddr2') {
				theForm.elements[i].disabled=true;
			}
    		if (theForm.elements[i].name=='txtvvcity') {
				theForm.elements[i].disabled=true;
			}
    		if (theForm.elements[i].name=='txtvvstate') {
				theForm.elements[i].disabled=true;
			}
    		if (theForm.elements[i].name=='txtvvzip') {
				theForm.elements[i].disabled=true;
			}
    		if (theForm.elements[i].name=='txtvvphone') {
				theForm.elements[i].disabled=true;
			}
		*/
	}
}

function randomXmasTune() {

	//var sound1="music/Holynit.mid"
	//var sound2="music/Joytothe.mid"
	//var sound3="music/kings.mid"
	//var sound4="music/xmasong.mid"
	var sound1="music/jingbell.mid"
	var sound2="music/jingbell.mid"
	var sound3="music/jingbell.mid"
	var sound4="music/jingbell.mid"


	var x=Math.round(Math.random()*3)
	
	if (x==0) x=sound1
	else if (x==1) x=sound2
	else if (x==2) x=sound3
	else x=sound4
	if (navigator.appName=="Microsoft Internet Explorer")
		document.write('<bgsound src='+'"'+x+'"'+' loop="infinite">')
	else 
		document.write('<embed src='+'"'+x+'"'+'hidden="true" border="0" width="20" height="20" autostart="true" loop="true">')
}

function snowEffect() {

}

function countdown_clock(year, month, day, hour, minute, format)
         {
         //I chose a div as the container for the timer, but
         //it can be an input tag inside a form, or anything
         //who's displayed content can be changed through
         //client-side scripting.
         html_code = '<div id="countdown"></div>';
         
         document.write(html_code);
         
         countdown(year, month, day, hour, minute, format);                
         }
         
function countdown(year, month, day, hour, minute, format)
         {
         Today = new Date();
         Todays_Year = Today.getYear() - 2000;
         Todays_Month = Today.getMonth() + 1;                  
         
         //Convert both today's date and the target date into miliseconds.                           
         Todays_Date = (new Date(Todays_Year, Todays_Month, Today.getDate(), 
                                 Today.getHours(), Today.getMinutes(), Today.getSeconds())).getTime();                                 
         Target_Date = (new Date(year, month, day, hour, minute, 00)).getTime();                  
         
         //Find their difference, and convert that into seconds.                  
         Time_Left = Math.round((Target_Date - Todays_Date) / 1000);
         
         if(Time_Left < 0)
            Time_Left = 0;
         
         switch(format)
               {
               case 0:
                    //The simplest way to display the time left.
                    document.all.countdown.innerHTML = Time_Left + ' seconds';
                    break;
               case 1:
                    //More datailed.
                    days = Math.floor(Time_Left / (60 * 60 * 24));
                    Time_Left %= (60 * 60 * 24);
                    hours = Math.floor(Time_Left / (60 * 60));
                    Time_Left %= (60 * 60);
                    minutes = Math.floor(Time_Left / 60);
                    Time_Left %= 60;
                    seconds = Time_Left;
                    
                    dps = 's'; hps = 's'; mps = 's'; sps = 's';
                    //ps is short for plural suffix.
                    if(days == 1) dps ='';
                    if(hours == 1) hps ='';
                    if(minutes == 1) mps ='';
                    if(seconds == 1) sps ='';
                    
                    document.all.countdown.innerHTML = days + ' day' + dps + ' ';
                    document.all.countdown.innerHTML += hours + ' hour' + hps + ' ';
                    document.all.countdown.innerHTML += minutes + ' minute' + mps + ' and ';
                    document.all.countdown.innerHTML += seconds + ' second' + sps;
                    break;
               default: 
                    document.all.countdown.innerHTML = Time_Left + ' seconds';
               }
               
         //Recursive call, keeps the clock ticking.
         setTimeout('countdown(' + year + ',' + month + ',' + day + ',' + hour + ',' + minute + ',' + format + ');', 1000);
         }
		 
		 
//POPUP WINDOW FUNCTION
//
function popUpWindow(sPage,sWindow,iTop,iLeft,iHeight,iWidth,sScrollbars){
	popup=window.open(sPage,sWindow,"top=" + iTop + ",left=" + iLeft + ",height=" + iHeight + ",width=" + iWidth + ",scrollbars=" + sScrollbars);
	popup.focus();
}


//POPUP WINDOW FUNCTION THAT RESIZES TO PICTURE
//
function PopupPic(sPicURL) { 
  	window.open( "large_image.asp?"+sPicURL, "largepic", "top=10,left=10,resizable=1,HEIGHT=10,WIDTH=10"); 
} 

function trim(inputString) {
	   // Removes leading and trailing spaces from the passed string. Also removes
	   // consecutive spaces and replaces it with one space. If something besides
	   // a string is passed in (null, custom object, etc.) then return the input.
	   if (typeof inputString != "string") { return inputString; }
	   var retValue = inputString;
	   var ch = retValue.substring(0, 1);
	   while (ch == " ") { // Check for spaces at the beginning of the string
	      retValue = retValue.substring(1, retValue.length);
	      ch = retValue.substring(0, 1);
	   }
	   ch = retValue.substring(retValue.length-1, retValue.length);
	   while (ch == " ") { // Check for spaces at the end of the string
	      retValue = retValue.substring(0, retValue.length-1);
	      ch = retValue.substring(retValue.length-1, retValue.length);
	   }
	   while (retValue.indexOf("  ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
	      retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
	   }
	   return retValue; // Return the trimmed string back to the user
} // Ends the "trim" function

function validateMessage(theForm) {


	if (trim(theForm.txtname.value)==""){ 
		alert("Please enter a Name!");
		return;
	}

	if (trim(theForm.txtphone.value)==""){ 
		alert("Please enter a Phone!");
		return;
	}

	if (trim(theForm.txtemail.value)==""){ 
		alert("Please enter an Email!");
		return;
	}

	if (trim(theForm.txtmessage.value)==""){ 
		alert("Please enter a message!");
		return;
	}

	if (trim(theForm.txtsubject.value)==""){ 
		alert("Please enter a Subject!");
		return;
	}

	theForm.submit()
}
	 
		 
		 
