<!--hide this script from non-javascript-enabled browsers

    function gotovilla(obj)
    {
        if(obj.value!="")
        {
            if(obj.value!=0)
        	{
            	window.location.href = "http://www.villaspain.co.uk/villa_details.php?prop_id=" + obj.value;
            }
        }
    }

	function makeimperialbooking()
    {
        var obj_form = document.mainform;
	    var incomp = "The Following Fields are incomplete:\n\n";
	    var strval = "";

        //check customer details
        if(obj_form.source_id.value==0)
        {
            incomp = incomp + "How did you find us - Needs Selecting\n";
            if(strval=="")strval = "source_id";
        }
        if(obj_form.c_title_id.value==0)
        {
            incomp = incomp + "Title - Needs Selecting\n";
            if(strval=="")strval = "c_title_id";
        }
        if(isBlank(trim(obj_form.c_first_name.value)))
        {
            incomp = incomp + "Forename - Is Blank\n";
            if(strval=="")strval = "c_first_name";
        }
        if(isBlank(trim(obj_form.c_last_name.value)))
        {
            incomp = incomp + "Surname - Is Blank\n";
            if(strval=="")strval = "c_last_name";
        }
        if(isBlank(trim(obj_form.c_add1.value)))
        {
            incomp = incomp + "Address 1 - Is Blank\n";
            if(strval=="")strval = "c_add1";
        }
        if(isBlank(trim(obj_form.c_town.value)))
        {
            incomp = incomp + "Town - Is Blank\n";
            if(strval=="")strval = "c_town";
        }
        if(isBlank(trim(obj_form.c_post_code.value)))
        {
            incomp = incomp + "Postcode - Is Blank\n";
            if(strval=="")strval = "c_post_code";
        }
        if(isBlank(trim(obj_form.c_contact_name.value)))
        {
            incomp = incomp + "Contact Name - Is Blank\n";
            if(strval=="")strval = "c_contact_name";
        }
        if(isBlank(trim(obj_form.c_phone1.value)))
        {
            incomp = incomp + "Telephone - Is Blank\n";
            if(strval=="")strval = "c_phone1";
        }else{
            //check is numbers only
            if(!isTelephoneNumber(trim(obj_form.c_phone1.value)))
            {
                incomp = incomp + "Telephone - Must be Numbers Only\n";
                if(strval=="")strval = "c_phone1";
            }
        }
        if(isBlank(trim(obj_form.c_email.value)))
        {
            incomp = incomp + "Email Address - Is Blank\n";
            if(strval=="")strval = "c_email";
        }
        if(isBlank(trim(obj_form.guest1.value)))
        {
            incomp = incomp + "Guest 1 - Is Blank - Fill in all Guests\n";
            if(strval=="")strval = "guest1";
        }
        if(isBlank(trim(obj_form.card_name.value)))
        {
            incomp = incomp + "Card Name - Is Blank\n";
            if(strval=="")strval = "card_name";
        }
        if(isBlank(trim(obj_form.card_num.value)))
        {
            incomp = incomp + "Card Number - Is Blank\n";
            if(strval=="")strval = "card_num";
        }
        if(isBlank(trim(obj_form.card_expiry.value)))
        {
            incomp = incomp + "Card Expiry - Is Blank\n";
            if(strval=="")strval = "card_expiry";
        }
        if(isBlank(trim(obj_form.card_sec.value)))
        {
            incomp = incomp + "CV2 Number - Is Blank\n";
            if(strval=="")strval = "card_sec";
        }else{
            if(!isNumber(trim(obj_form.card_sec.value)))
	        {
	            incomp = incomp + "CV2 Number - Must be a Number\n";
	            if(strval=="")strval = "card_sec";
	        }
        }

        if(incomp.length == 38)
	    {
	        obj_form.submit();
	    }else{
	          alert(incomp);
	          eval("obj_form."+strval+".focus()");
	          return;
	    }
    }

    function sendcarbooking()
    {
        var obj_form = document.mainform;
	    var incomp = "The Following Fields are incomplete:\n\n";
	    var strval = "";

        if(obj_form.source_id.value==0)
        {
            incomp = incomp + "How did you find us - Needs Selecting\n";
            if(strval=="")strval = "source_id";
        }
        if(obj_form.c_title_id.value==0)
        {
            incomp = incomp + "Title - Needs Selecting\n";
            if(strval=="")strval = "c_title_id";
        }
        if(isBlank(trim(obj_form.c_first_name.value)))
        {
            incomp = incomp + "Forename - Is Blank\n";
            if(strval=="")strval = "c_first_name";
        }
        if(isBlank(trim(obj_form.c_last_name.value)))
        {
            incomp = incomp + "Surname - Is Blank\n";
            if(strval=="")strval = "c_last_name";
        }
        if(isBlank(trim(obj_form.c_add1.value)))
        {
            incomp = incomp + "Address 1 - Is Blank\n";
            if(strval=="")strval = "c_add1";
        }
        if(isBlank(trim(obj_form.c_town.value)))
        {
            incomp = incomp + "Town - Is Blank\n";
            if(strval=="")strval = "c_town";
        }
        if(isBlank(trim(obj_form.c_post_code.value)))
        {
            incomp = incomp + "Postcode - Is Blank\n";
            if(strval=="")strval = "c_post_code";
        }
        if(isBlank(trim(obj_form.c_contact_name.value)))
        {
            incomp = incomp + "Contact Name - Is Blank\n";
            if(strval=="")strval = "c_contact_name";
        }
        if(isBlank(trim(obj_form.c_phone1.value)))
        {
            incomp = incomp + "Telephone - Is Blank\n";
            if(strval=="")strval = "c_phone1";
        }else{
            //check is numbers only
            if(!isTelephoneNumber(trim(obj_form.c_phone1.value)))
            {
                incomp = incomp + "Telephone - Must be Numbers Only\n";
                if(strval=="")strval = "c_phone1";
            }
        }
        if(isBlank(trim(obj_form.c_email.value)))
        {
            incomp = incomp + "Email Address - Is Blank\n";
            if(strval=="")strval = "c_email";
        }


        if(isBlank(trim(obj_form.villa_name.value)))
        {
            incomp = incomp + "Villa Name - Is Blank\n";
            if(strval=="")strval = "villa_name";
        }
        /*
        if(isBlank(trim(obj_form.villa_address.value)))
        {
            incomp = incomp + "Villa Address - Is Blank\n";
            if(strval=="")strval = "villa_address";
        }
        */
        if(obj_form.car_cat.value=="")
        {
            incomp = incomp + "Car Category - Is Blank\n";
            if(strval=="")strval = "car_cat";
        }
        if(isBlank(trim(obj_form.car_type.value)))
        {
            incomp = incomp + "Type of Car - Is Blank\n";
            if(strval=="")strval = "car_type";
        }
        if(isBlank(trim(obj_form.hirefrom.value)))
        {
            incomp = incomp + "Hire From Date - Is Blank\n";
	        if(strval=="")strval = "hirefrom";
		}else{
            if(getLength(obj_form.hirefrom.value)!=8 && getLength(obj_form.hirefrom.value)!=10)
	        {
	            incomp = incomp + "Hire From Date - Invalid (dd/mm/yy) or (dd/mm/yyyy)\n";
	            if(strval=="")strval = "hirefrom";
	        }else{
	            var dtnow = new Date();
	            var mDay = obj_form.hirefrom.value.substr(0,2);
	            var mMonth = obj_form.hirefrom.value.substr(3,2);
	            var mYear = obj_form.hirefrom.value.substr(6,4)
	            var dttest = new Date(mYear,(mMonth-1),mDay);
	            if(isValidDateshort(mYear,mMonth,mDay)==false)
	            {
	                if(isValidDate(mYear,mMonth,mDay)==false)
	                {
	                    incomp = incomp + "Hire From Date - Invalid (dd/mm/yy) or (dd/mm/yyyy)\n";
	                    if(strval=="")strval = "hirefrom";
	                }
	            }
	        }
        }
        if(isBlank(trim(obj_form.hireto.value)))
        {
            incomp = incomp + "Hire To Date - Is Blank\n";
	        if(strval=="")strval = "hireto";
		}else{
            if(getLength(obj_form.hireto.value)!=8 && getLength(obj_form.hireto.value)!=10)
	        {
	            incomp = incomp + "Hire To Date - Invalid (dd/mm/yy) or (dd/mm/yyyy)\n";
	            if(strval=="")strval = "hireto";
	        }else{
	            var dtnow = new Date();
	            var mDay = obj_form.hireto.value.substr(0,2);
	            var mMonth = obj_form.hireto.value.substr(3,2);
	            var mYear = obj_form.hireto.value.substr(6,4)
	            var dttest = new Date(mYear,(mMonth-1),mDay);
	            if(isValidDateshort(mYear,mMonth,mDay)==false)
	            {
	                if(isValidDate(mYear,mMonth,mDay)==false)
	                {
	                    incomp = incomp + "Hire To Date - Invalid (dd/mm/yy) or (dd/mm/yyyy)\n";
	                    if(strval=="")strval = "hireto";
	                }
	            }
	        }
        }

        //if all of the above is correct then validate the next lotk, otherwise msgbox gets too long
        if(incomp.length == 38)
	    {
            //validate driving information
            if(isBlank(trim(obj_form.passportnum.value)))
	        {
	            incomp = incomp + "Passport Number - Is Blank\n";
	            if(strval=="")strval = "passportnum";
	        }
            if(isBlank(trim(obj_form.passportissue.value)))
	        {
	            incomp = incomp + "Passport Date of Issue - Is Blank\n";
	            if(strval=="")strval = "passportissue";
	        }
            if(isBlank(trim(obj_form.licensenum.value)))
	        {
	            incomp = incomp + "Driving License Number - Is Blank\n";
	            if(strval=="")strval = "licensenum";
	        }
            if(isBlank(trim(obj_form.licensepissue.value)))
	        {
	            incomp = incomp + "Driving License Place of Issue - Is Blank\n";
	            if(strval=="")strval = "licensepissue";
	        }
            if(isBlank(trim(obj_form.licensedissue.value)))
	        {
	            incomp = incomp + "Driving License Date of Issue - Is Blank\n";
	            if(strval=="")strval = "licensedissue";
	        }
            if(isBlank(trim(obj_form.passportplace.value)))
	        {
	            incomp = incomp + "Place of Birth - Is Blank\n";
	            if(strval=="")strval = "passportplace";
	        }
            if(isBlank(trim(obj_form.passportbdate.value)))
	        {
	            incomp = incomp + "Date of Birth - Is Blank\n";
	            if(strval=="")strval = "passportbdate";
	        }else{
	            if(getLength(obj_form.passportbdate.value)!=10)
	            {
	                incomp = incomp + "Date of Birth - Invalid (dd/mm/yyyy)\n";
	                if(strval=="")strval = "passportbdate";
	            }else{
	                var dtnow = new Date();
	                var mDay = obj_form.passportbdate.value.substr(0,2);
	                var mMonth = obj_form.passportbdate.value.substr(3,2);
	                var mYear = obj_form.passportbdate.value.substr(6,4)
	                var dttest = new Date(mYear,(mMonth-1),mDay);
	                if(isValidDateshort(mYear,mMonth,mDay)==false)
	                {
	                    if(isValidDate(mYear,mMonth,mDay)==false)
	                    {
	                        incomp = incomp + "Date of Birth - Invalid (dd/mm/yyyy)\n";
	                        if(strval=="")strval = "passportbdate";
	                    }
	                }
	            }
	        }
            if(isBlank(trim(obj_form.nationality.value)))
	        {
	            incomp = incomp + "Nationality - Is Blank\n";
	            if(strval=="")strval = "nationality";
	        }

	        //validate payment details
	        if(isBlank(trim(obj_form.card_name.value)))
	        {
	            incomp = incomp + "Card Name - Is Blank\n";
	            if(strval=="")strval = "card_name";
	        }
	        if(isBlank(trim(obj_form.card_num.value)))
	        {
	            incomp = incomp + "Card Number - Is Blank\n";
	            if(strval=="")strval = "card_num";
	        }
	        if(isBlank(trim(obj_form.card_expiry.value)))
	        {
	            incomp = incomp + "Card Expiry - Is Blank\n";
	            if(strval=="")strval = "card_expiry";
	        }
            if(isBlank(trim(obj_form.card_sec.value)))
	        {
	            incomp = incomp + "CV2 Number - Is Blank\n";
	            if(strval=="")strval = "card_sec";
	        }else{
	            if(!isNumber(trim(obj_form.card_sec.value)))
	            {
	                incomp = incomp + "CV2 Number - Must be a Number\n";
	                if(strval=="")strval = "card_sec";
	            }
	        }
        }

	    if(incomp.length == 38)
	    {
	        obj_form.submit();
	    }else{
	          alert(incomp);
	          eval("obj_form."+strval+".focus()");
	          return;
	    }
	}

    function openjswin(url,winname,mheight,mwidth,mtop,mleft,mscroll,mresize,mstatus,mtool,mmenu)
	{
	    //,location=1,directories=1
	    window.open(url, winname,"height="+mheight+",width="+mwidth+",top="+mtop+",left="+mleft+",scrollbars="+mscroll+",resizable="+mresize+",status="+mstatus+",toolbar="+mtool+",menubar="+mmenu);
	}

    function gocontactus()
	{
	    var obj_form = document.mainform;
	    var incomp = "The Following Fields are incomplete:\n\n";
	    var strval = "";

	    if(isBlank(trim(obj_form.enq_name.value)))
	    {
	        incomp = incomp + "Name\n";
	        if(strval=="")strval = "enq_name";
	    }
	    if(isBlank(trim(obj_form.enq_phone.value)))
	    {
	        incomp = incomp + "Telephone\n";
	        if(strval=="")strval = "enq_phone";
	    }else{
	        if(!isTelephoneNumber(obj_form.enq_phone.value))
	        {
	            incomp = incomp + "Telephone Number must be Numbers Only\n";
	            if(strval=="")strval = "enq_phone";
	        }
	    }
	    if(isBlank(trim(obj_form.enq_email.value)))
	    {
	        incomp = incomp + "Email Address\n";
	        if(strval=="")strval = "enq_email";
	    }else{
	        if (invalidemail(obj_form.enq_email.value))
	        {
	            incomp = incomp + "Invalid Email Address\n";
	            if(strval=="")strval = "enq_email";
	        }
	    }
	    if(isBlank(trim(obj_form.enq_text.value)))
	    {
	        incomp = incomp + "Enquiry\n";
	        if(strval=="")strval = "enq_text";
	    }
        if(obj_form.txt_seccode)
        {
        	if(isBlank(trim(obj_form.txt_seccode.value)))
	        {
	            incomp = incomp + "Enter Image Text\n";
	            if(strval=="")strval = "txt_seccode";
	        }
        }

	    if(incomp.length == 38)
	    {
	        obj_form.submit();
	    }else{
	          alert(incomp);
	          eval("obj_form."+strval+".focus()");
	          return;
	    }
	}

    function gosavedetails()
	{
	    var obj_form = document.mainform;
	    var incomp = "The Following Fields are incomplete:\n\n";
	    var strval = "";

	    if(isBlank(trim(obj_form.fut_name.value)))
	    {
	        incomp = incomp + "Name - Is Blank\n";
	        if(strval=="")strval = "fut_name";
	    }
	    if(isBlank(trim(obj_form.fut_phone.value)))
	    {
	        incomp = incomp + "Telephone - Is Blank\n";
	        if(strval=="")strval = "fut_phone";
	    }else{
	        if(!isTelephoneNumber(obj_form.fut_phone.value))
	        {
	            incomp = incomp + "Telephone Number must be Numbers Only\n";
	            if(strval=="")strval = "fut_phone";
	        }
	    }
	    if(isBlank(trim(obj_form.fut_email.value)))
	    {
	        incomp = incomp + "Email Address - Is Blank\n";
	        if(strval=="")strval = "fut_email";
	    }else{
	        if (invalidemail(obj_form.fut_email.value))
	        {
	            incomp = incomp + "Email Address - Is Invalid\n";
	            if(strval=="")strval = "fut_email";
	        }
	    }
        if(isBlank(trim(obj_form.fut_nights.value)))
	    {
	        incomp = incomp + "How long would you like to stay? - Is Blank\n";
	        if(strval=="")strval = "fut_nights";
	    }
        if(obj_form.txt_seccode)
        {
        	if(isBlank(trim(obj_form.txt_seccode.value)))
	        {
	            incomp = incomp + "Enter Image Text\n";
	            if(strval=="")strval = "txt_seccode";
	        }
        }

	    if(incomp.length == 38)
	    {
	        obj_form.submit();
	    }else{
	          alert(incomp);
	          eval("obj_form."+strval+".focus()");
	          return;
	    }
	}

    function linenuntick()
    {
        var obj_form = document.mainform;

        if(obj_form.linenneeded.value==0)
        {
        	numberofcontrols = obj_form.length;
	        for(controlindex = 0; controlindex < numberofcontrols; controlindex++)
	        {
	            element = obj_form[controlindex];
	            var str = element.name

	            if(str.substr(0,5)=="ling_")
	            {
	                obj_form[str].checked = false;
	            }
	        }
        }
    }

    function fillcontact()
    {
        var obj_form = document.mainform;

        if(isBlank(trim(obj_form.c_contact_name.value)))
        {
        	obj_form.c_contact_name.value = obj_form.guest1.value;
	    }
    }


	function customermakebooking()
    {
        var obj_form = document.mainform;
	    var incomp = "The Following Fields are incomplete:\n\n";
	    var strval = "";

        if(isBlank(trim(obj_form.guest1.value)))
        {
            incomp = incomp + "Guest 1 - Is Blank - Fill in all Guests\n";
            if(strval=="")strval = "guest1";
        }

        if(obj_form.c_title_id)
        {
            if(obj_form.source_id.value==0)
	        {
	            incomp = incomp + "How did you find us - Needs Selecting\n";
	            if(strval=="")strval = "source_id";
	        }
        	if(obj_form.c_title_id.value==0)
	        {
	            incomp = incomp + "Title - Needs Selecting\n";
	            if(strval=="")strval = "c_title_id";
	        }
	        if(isBlank(trim(obj_form.c_first_name.value)))
	        {
	            incomp = incomp + "Forename - Is Blank\n";
	            if(strval=="")strval = "c_first_name";
	        }
	        if(isBlank(trim(obj_form.c_last_name.value)))
	        {
	            incomp = incomp + "Surname - Is Blank\n";
	            if(strval=="")strval = "c_last_name";
	        }
	        if(isBlank(trim(obj_form.c_add1.value)))
	        {
	            incomp = incomp + "Address 1 - Is Blank\n";
	            if(strval=="")strval = "c_add1";
	        }
	        if(isBlank(trim(obj_form.c_town.value)))
	        {
	            incomp = incomp + "Town - Is Blank\n";
	            if(strval=="")strval = "c_town";
	        }
	        if(isBlank(trim(obj_form.c_post_code.value)))
	        {
	            incomp = incomp + "Postcode - Is Blank\n";
	            if(strval=="")strval = "c_post_code";
	        }
	        if(isBlank(trim(obj_form.c_contact_name.value)))
	        {
	            incomp = incomp + "Contact Name - Is Blank\n";
	            if(strval=="")strval = "c_contact_name";
	        }
	        if(isBlank(trim(obj_form.c_phone1.value)))
	        {
	            incomp = incomp + "Telephone - Is Blank\n";
	            if(strval=="")strval = "c_phone1";
	        }else{
	            //check is numbers only
	            if(!isTelephoneNumber(trim(obj_form.c_phone1.value)))
	            {
	                incomp = incomp + "Telephone - Must be Numbers Only\n";
	                if(strval=="")strval = "c_phone1";
	            }
	        }
	        if(isBlank(trim(obj_form.c_email.value)))
	        {
	            incomp = incomp + "Email Address - Is Blank\n";
	            if(strval=="")strval = "c_email";
	        }
        }


        if(isBlank(trim(obj_form.card_name.value)))
        {
            incomp = incomp + "Card Name - Is Blank\n";
            if(strval=="")strval = "card_name";
        }
        if(isBlank(trim(obj_form.card_num.value)))
        {
            incomp = incomp + "Card Number - Is Blank\n";
            if(strval=="")strval = "card_num";
        }
        if(isBlank(trim(obj_form.card_expiry.value)))
        {
            incomp = incomp + "Card Expiry - Is Blank\n";
            if(strval=="")strval = "card_expiry";
        }
        if(isBlank(trim(obj_form.card_sec.value)))
        {
            incomp = incomp + "CV2 Number - Is Blank\n";
            if(strval=="")strval = "card_sec";
        }else{
            if(!isNumber(trim(obj_form.card_sec.value)))
	        {
	            incomp = incomp + "CV2 Number - Must be a Number\n";
	            if(strval=="")strval = "card_sec";
	        }
        }

	    if(incomp.length == 38)
	    {
	        obj_form.submit();
	    }else{
	          alert(incomp);
	          eval("obj_form."+strval+".focus()");
	          return;
	    }
	}

    function searchvillas()
    {
        var obj_form = document.sidesearchform;
	    var incomp = "The Following Fields are incomplete:\n\n";
	    var strval = "";
        /*
        if(obj_form.ser_area_id.value==0)
	    {
	        incomp = incomp + "Area - Needs Selecting\n";
	        if(strval=="")strval = "ser_area_id";
	    }
        */
        if(obj_form.ser_departure.value==0)
	    {
	        incomp = incomp + "Departure Month - Needs Selecting\n";
	        if(strval=="")strval = "ser_departure";
	    }
        //check id chart or details results
        for(i=0;i<obj_form.elements.length;i++)
		{
			var name=obj_form.elements[i].name;
			var type=obj_form.elements[i].type;
			if((type=="radio") && (name.indexOf("showrestype")!=-1))
			{
				var val=obj_form.elements[i].checked;
				if(val==true)
				{
					if(obj_form.elements[i].value==0)
                    {
                    	obj_form.action = "/villa_search_results.php";
                    }
                    if(obj_form.elements[i].value==1)
                    {
                    	obj_form.action = "/villa_search_results_detail.php";
                    }
					break;
				}
			}
		}
	    if(incomp.length == 38)
	    {
	        obj_form.submit();
	    }else{
	          alert(incomp);
	          eval("obj_form."+strval+".focus()");
	          return;
	    }
    }

    function timevalidatelong(curtime)
	{
	    bcorrect = 1;
	    if (getLength(curtime)!=8)
	    {
	        bcorrect = 0;
	    }
	    if (curtime.slice(2,3)!=":")
	    {
	        bcorrect = 0;
	    }
	    if (curtime.slice(5,6)!=":")
	    {
	        bcorrect = 0;
	    }
	    if(isNumber(curtime.slice(0,2)))
	    {
	        if((curtime.slice(0,2)<0) || (curtime.slice(0,2)>23))
	        {
	            bcorrect = 0;
	        }
	    }else{
	        bcorrect = 0;
	    }
	    //check minutes
	    if(isNumber(curtime.slice(3,5)))
	    {
	        if((curtime.slice(3,5)<0) || (curtime.slice(3,5)>59))
	        {
	            bcorrect = 0;
	        }
	    }else{
	        bcorrect = 0;
	    }
	    //check seconds
	    if(isNumber(curtime.slice(6,8)))
	    {
	        if((curtime.slice(6,8)<0) || (curtime.slice(6,8)>59))
	        {
	            bcorrect = 0;
	        }
	    }else{
	        bcorrect = 0;
	    }

	    return bcorrect;
	}

	function formatCurrency(num,pd)
	{
	    num = num.toString().replace(/\£|\,/g,'');
	    if(isNaN(num))
	    num = "0";
	    sign = (num == (num = Math.abs(num)));
	    num = Math.floor(num*100+0.50000000001);
	    cents = num%100;
	    num = Math.floor(num/100).toString();
	    if(cents<10)
	    cents = "0" + cents;
	    for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
	    num = num.substring(0,num.length-(4*i+3))+','+
	    num.substring(num.length-(4*i+3));
	    if(pd==1)
	    {
	        return (((sign)?'':'-') + '£' + num + '.' + cents);
	    }else{
	        return (((sign)?'':'-') + num + '.' + cents);
	    }
	}

	function checknum(str)
	{
	    var obj_form = document.mainform;
	    var b_correct = true;
	    var nm = 0;
	    //use the field name (str)
	    //alert(obj_form[str].value);
	    if(!obj_form[str].value)
	    {
	        obj_form[str].value  = formatCurrency(0,1);
	    }else{
	        obj_form[str].value  = formatCurrency(obj_form[str].value,1);
	    }
	}

	function checknumonly(str)
	{
	    var obj_form = document.mainform;
	    var b_correct = true;
	    var nm = 0;
	    //use the field name (str)
	    //alert(obj_form[str].value);
	    if(!obj_form[str].value)
	    {
	        obj_form[str].value  = formatCurrency(0,0);
	    }else{
	        obj_form[str].value  = formatCurrency(obj_form[str].value,0);
	    }
	}

	function isValidDateshort(iYear, iMonth, iDay)
	{
	    if (isNaN(iYear) || isNaN(iMonth) || isNaN(iDay))
	    {
	      return false;
	    }

	        var dtNewDate = new Date(iYear, (iMonth-1), iDay);
	        if ((parseInt(dtNewDate.getYear()) == iYear)
	            && (parseInt(dtNewDate.getMonth()) == (iMonth-1))
	            && (parseInt(dtNewDate.getDate()) == iDay))
	        {
	            return true;
	        }
	    return false;
	}

	function getLength(str)
	{
	    while (str.substr(str.length-1)==" ")
	    {
	        str = str.substring(0,str.length-1);
	    }
	    return str.length
	}

// stop hiding -->