function charCounter(id, outid, maxChars)
{
	id.onkeyup = function() {
		outid.innerHTML = "Characters remaining: " + 
						  (maxChars - id.value.length);
	}
}
function calendarWait(field){
document.getElementById(field).innerHTML ="'<img src=\"http://yacht.cmsdude.com/images/ajax-loader.gif\" >";
}
function calendarWait2(field){
document.getElementById(field).innerHTML ="'<img src=\"http://yacht.cmsdude.com/images/ajax-loader-small.gif\" >";
}
function calendarWait3(field){
document.getElementById(field).innerHTML ="'<img src=\"http://yacht.cmsdude.com/images/ajax-loader-small-blue.gif\" >";
}
function clearCalendar(field){
document.getElementById(field).innerHTML ="";
}

function refreshit(){location.reload(true);}
var color='#FFB2B4';

function isNotEmpty(field, fieldName,msg)  { 


        if (field.value.length == 0)  {
            alert(msg + fieldName + ".");
            field.focus();
            field.style.backgroundColor = '#FFB2B4';
            return false;
        }
        field.style.backgroundColor = '';
        return true;
}
    
        
    function isNotSelected(field, fieldName,msg)  { 


        if (field.value== 0)  {
            alert(msg + fieldName + ".");
            field.focus();
            field.style.backgroundColor = '#FFB2B4';
            return false;
        }
        field.style.backgroundColor = '';
        return true;
}



var MUST_SUPPLY = "You must supply ";


function validateReservation(form){
        
    if (!isNotEmpty(form.name, 'a Name',MUST_SUPPLY))
    return false;
    
    if (!isNotEmpty(form.email, 'an Email',MUST_SUPPLY))
    return false;

    
    if (!isNotSelected(form.time, 'an Site down time',MUST_SUPPLY))
    return false;
    
    
    
    
    
    return true;

}


function validateComments(form){
        
    if (!isNotEmpty(form.name, 'a Name',MUST_SUPPLY))
    return false;
    
    if (!isNotEmpty(form.email, 'an Email',MUST_SUPPLY))
    return false;

    
       if (!isNotEmpty(form.comments, 'a Comment / Question',MUST_SUPPLY))
    return false;
 
    
    return true;

}




