function Trim(s) {
		while ((s.substring(0,1) == ' ') || (s.substring(0,1) == '\n') || (s.substring(0,1) == '\r')) 
			s = s.substring(1,s.length);
		while ((s.substring(s.length-1,s.length) == ' ') || (s.substring(s.length-1,s.length) == '\n') || (s.substring(s.length-1,s.length) == '\r')) 
			s = s.substring(0,s.length-1);
		return s;
	}

function frmvalidation() {
	str = "";
	if(Trim(document.getElementById("childsfirstname").value)=="") {
		str+="Child's First Name.\n";
		document.getElementById("childsfirstname").focus();
	} 
	if(Trim(document.getElementById("childslastname").value)=="") {
		str+="Child's Last Name.\n";
		document.getElementById("childslastname").focus();
	} 
	if(  (Trim(document.getElementById("childsbirthyear").value)=="")   ||  (Trim(document.getElementById("childsbirthyear").value)=="Year")   ) {
		str+="Child's Birth Year.\n";
	} 
	if (      (Trim(document.getElementById("childsbirthmonth").value)=="") ||    (Trim(document.getElementById("childsbirthmonth").value)=="Month") )  {
		str+="Child's Birth Month.\n";
	} 
	if(  (Trim(document.getElementById("childsbirthday").value)=="")           ||    (Trim(document.getElementById("childsbirthday").value)=="Day")          ) {
		str+="Child's Birth Date.\n";
	} 
	if(Trim(document.getElementById("childsbirthtime").value)=="") {
		str+="Child's Birth Time.\n";
    }
	if(Trim(document.getElementById("childsbirthcity").value)=="") {
		str+="Child's Birth City.\n";
	} 
	if(Trim(document.getElementById("childsbirthstate").value)=="") {
		str+="Child's Birth State/Province.\n";
	} 
	if(Trim(document.getElementById("childsbirthcountry").value)=="") {
		str+="Child's Birth Country.\n";
	} 
	if(Trim(document.getElementById("childsgender").value)=="") {
		str+="Child's Gender.\n";
	} 
	if(Trim(document.getElementById("RealN").value)=="") {
		str+="Your Name.\n";
	} 
	if(Trim(document.getElementById("RealE").value)=="") {
		str+="Your Email Address.\n";
	}
	if(Trim(document.getElementById("ordernumber").value)=="") {
		str+="Your Order / Invoice Number.\n";
	}
	if(Trim(document.getElementById("ordernumber").value)=="") {
		document.getElementById("ordernumber").focus();
	} 
	if(Trim(document.getElementById("RealE").value)=="") {
		document.getElementById("RealE").focus();
	} 
	if(Trim(document.getElementById("RealN").value)=="") {
		document.getElementById("RealN").focus();
	} 
	if(Trim(document.getElementById("childsgender").value)=="") {
		document.getElementById("childsgender").focus();
	} 
	if(Trim(document.getElementById("childsbirthcountry").value)=="") {
		document.getElementById("childsbirthcountry").focus();
	} 
	if(Trim(document.getElementById("childsbirthstate").value)=="") {
		document.getElementById("childsbirthstate").focus();
	} 
	if(Trim(document.getElementById("childsbirthcity").value)=="") {
		document.getElementById("childsbirthcity").focus();
	} 
	if(Trim(document.getElementById("childsbirthtime").value)=="") {
		document.getElementById("childsbirthtime").focus();
    }
	if(  (Trim(document.getElementById("childsbirthday").value)=="")           ||    (Trim(document.getElementById("childsbirthday").value)=="Day")          ) {
		document.getElementById("childsbirthday").focus();
	} 
	if (      (Trim(document.getElementById("childsbirthmonth").value)=="") ||    (Trim(document.getElementById("childsbirthmonth").value)=="Month") )  {
		document.getElementById("childsbirthmonth").focus();
	} 
	if(  (Trim(document.getElementById("childsbirthyear").value)=="")   ||  (Trim(document.getElementById("childsbirthyear").value)=="Year")   ) {
		document.getElementById("childsbirthyear").focus();
	} 
	if(Trim(document.getElementById("childslastname").value)=="") {
		document.getElementById("childslastname").focus();
	} 
	if(Trim(document.getElementById("childsfirstname").value)=="") {
		document.getElementById("childsfirstname").focus();
	} 




	if (str!="") {
		msg="Please enter the following details\n";
		msg = msg + "----------------------------------------\n";
		msg = msg + str;
		alert(msg);
		return false;
	}
	else {
		document.contact.submit()
		return true;

	}
}


 /*******************************************************
 * code for ensuring segments don't override eachother
 * to set a segment overtop this, simply use the normal
 * utmSetVar() function
 *******************************************************/
function segmentGetCookie(name) {
    var start = document.cookie.indexOf(name+"=");
    var len = start+name.length+1;
    if ((!start) && (name !=
document.cookie.substring(0,name.length))) return null;
    if (start == -1) return null;
    var end = document.cookie.indexOf(";",len);
    if (end == -1) end = document.cookie.length;
    return unescape(document.cookie.substring(len,end));

}

function setSegmentSafe(name) {
    if (!segmentGetCookie('__utmv'))
        __utmSetVar(name);
}
