Cufon.replace('h1, h2', {fontFamily: 'Fontana ND Ee OsF semibold'});
Cufon.replace('h3', {fontFamily: 'Fontana ND Ee OsF'});
Cufon.replace('h2 strong', {fontFamily: 'Fontana ND Ee OsF bold'});

function toggleDiv(divid){
	if(document.getElementById(divid).style.display == 'none'){
	  document.getElementById(divid).style.display = 'block';
	}else{
	  document.getElementById(divid).style.display = 'none';
	}
}

   function AtLeastOneContact_ClientValidate(source, args) {

            box1 = document.getElementById("tbTelephoneHome").value;
            box2 = document.getElementById("tbTelephoneDaytime").value;
            box3 = document.getElementById("tbTelephoneMobile").value;
            if (box1 == "" && box2 == "" && box3 == "") {
                //Must use one.
                args.IsValid = false;
                document.getElementById("spanTelephone").style.display = 'none';
            }
            else {
                //Everything is fine.
                args.IsValid = true;
                document.getElementById("spanTelephone").style.display = 'block';
            }
        }

        function hasWhiteSpace(source, args) {

            postcode = document.getElementById("tbPostCode").value;
            country = document.getElementById("tbCountry").value;
            if (postcode.search(" ") == -1 && country.toUpperCase() == 'UNITED KINGDOM') {

                args.IsValid = false;
                document.getElementById("regexpPostCodeValidator").style.display = 'none';                
            }
            else {
                    args.IsValid = true;
                }            
        }

        function isValidPostCode(post) {
            var postcodeRegEx = /^([a-pr-uwyzA-PR-UWYZ]([0-9]{1,2}|([a-hk-yA-HK-Y][0-9]|[a-hk-yA-HK-Y][0-9]([0-9]|[abehmnprv-yABEHMNPRV-Y]))|[0-9][a-hjks-uwA-HJKS-UW])\ [0-9][abd-hjlnp-uw-zABD-HJLNP-UW-Z]{2}|(girGIR\ oaa0AA)|(sanSAN\ talTA1)|(bfpoBFPO\ (C\/O\ )?[0-9]{1,4})|((ascnASCN|bbndBBND|[bfsBFS]iqqIQQ|pcrnPCRN|sthlSTHL|tdcuTDCU|tkcaTKCA)\ 1ZZ))$/;
            return postcodeRegEx.test(post);

        }

        function hasCompany(source, args) {

            company = document.getElementById("tbCompanyName").value;
            if (company == "") {
                args.IsValid = false;
                document.getElementById("customValidatePosition").style.display = 'none';
            }
            else {
                args.IsValid = true;
            }
        }

        function vadidatePosition() {
            company = document.getElementById("tbCompanyName").value;
            position = document.getElementById("tbPosition").value;
            if (!(company == "" & position != "")) {
                document.getElementById("customValidatePosition").style.display = 'none';
            }
            else {
                document.getElementById("customValidatePosition").style.display = 'inline';
            }

        }

        function vadidatePostCodeFocus() {
            var country = document.getElementById("tbCountry").value;
            var postcode = document.getElementById("tbPostCode").value;

            if (country.toUpperCase() != 'UNITED KINGDOM') {
                document.getElementById("CustomValidatorPostCode").style.display = 'none';

            }
            else if (postcode.search(" ") == -1) {
                document.getElementById("CustomValidatorPostCode").textContent = "Post code must contain a space";
                document.getElementById("CustomValidatorPostCode").style.display = 'inline';

            }
            else if (!isValidPostCode(postcode)) {
                document.getElementById("CustomValidatorPostCode").textContent = "Invalid";
                document.getElementById("CustomValidatorPostCode").style.display = 'inline';
            }
            if (postcode == '') {
                document.getElementById("CustomValidatorPostCode").style.display = 'none';
            }
        }


        jQuery.noConflict();
        (function ($) {
            $(function () {
              $(document).ready(function () {

        //if ($("input[id='rblInstallation_0']:checked").val() == 'Yes') {
        //$("#siteVisit").show('fast');
        //}


        //$("input[id^='rblInstallation_']").click(function () {
        //if ($(this).val() == 'No') {
        //$("#siteVisit").hide('slow');
        //$("input[id='rblSiteVisit_1']").attr("checked", "checked");
        //}
        //else {
        //$("#siteVisit").show('slow');
        //}
        //});
		
		
		$('.item').each(function(){
			var offset = 30;
			var specialOfferTitleHeight = $(this).find('.title').innerHeight();
			var specialOfferPriceHeight = $(this).find('.price').innerHeight();
			//console.log('title: ' + specialOfferTitleHeight + ' and ' + 'price: ' + specialOfferPriceHeight)
			if (specialOfferTitleHeight > specialOfferPriceHeight) {
				$(this).find('.title').height(specialOfferTitleHeight - offset);			
				$(this).find('.price').height(specialOfferTitleHeight - offset).width(120);
			} else {
				$(this).find('.title').height(specialOfferPriceHeight - offset);			
				$(this).find('.price').height(specialOfferPriceHeight - offset).width(120);
			}
		});		
			
	});		
            });
        })(jQuery);

	


		/* function AtLeastOneContact_ClientValidate(source, args) {
      
             box1 = document.getElementById("tbTelephoneHome").value;
             box2 = document.getElementById("tbTelephoneDaytime").value;
             box3 = document.getElementById("tbTelephoneMobile").value;
             if (box1 == "" && box2 == "" && box3=="") {             
                     //Must use one.
                     args.IsValid = false;
                     document.getElementById("spanTelephone").style.display = 'none';         
                 }
                 else {
                     //Everything is fine.
                     args.IsValid = true;
                     document.getElementById("spanTelephone").style.display = 'block';
                 }
         }*/

        /* function hasWhiteSpace(source, args) {

             postcode = document.getElementById("tbPostCode").value;
             country = document.getElementById("tbCountry").value;
             if (postcode.search(" ") == -1 && country.toUpperCase() == 'UNITED KINGDOM') {

                 args.IsValid = false;
                 document.getElementById("regexpPostCodeValidator").style.display = 'none';
             }
             else {
                 args.IsValid = true;
             }
         }*/

        /* function isValidPostCode(post) {
             var postcodeRegEx = /^([a-pr-uwyzA-PR-UWYZ]([0-9]{1,2}|([a-hk-yA-HK-Y][0-9]|[a-hk-yA-HK-Y][0-9]([0-9]|[abehmnprv-yABEHMNPRV-Y]))|[0-9][a-hjks-uwA-HJKS-UW])\ [0-9][abd-hjlnp-uw-zABD-HJLNP-UW-Z]{2}|(girGIR\ oaa0AA)|(sanSAN\ talTA1)|(bfpoBFPO\ (C\/O\ )?[0-9]{1,4})|((ascnASCN|bbndBBND|[bfsBFS]iqqIQQ|pcrnPCRN|sthlSTHL|tdcuTDCU|tkcaTKCA)\ 1ZZ))$/;
             return postcodeRegEx.test(post);

         }*/

         /*function hasCompany(source, args) {

             company = document.getElementById("tbCompanyName").value;
             if (company == "") {
                 args.IsValid = false;
                 document.getElementById("customValidatePosition").style.display = 'none';
             }
             else {
                 args.IsValid = true;
             }
         }*/

        /* function vadidatePosition() {         
             company = document.getElementById("tbCompanyName").value;
             position = document.getElementById("tbPosition").value;
             if (!(company == "" & position != "")) {
                 document.getElementById("customValidatePosition").style.display = 'none';
             }
             else {
                 document.getElementById("customValidatePosition").style.display = 'inline';
             }

         }*/
 
       /*  function vadidatePostCodeFocus() {             
             var country = document.getElementById("tbCountry").value;
             var postcode = document.getElementById("tbPostCode").value;
             
             if (country.toUpperCase() != 'UNITED KINGDOM') {
                 document.getElementById("CustomValidatorPostCode").style.display = 'none';               

             }
             else if (postcode.search(" ") == -1) {
                 document.getElementById("CustomValidatorPostCode").innerHTML = "Post code must contain a space";
                 document.getElementById("CustomValidatorPostCode").style.display = 'inline';                 
             }
             else if (!isValidPostCode(postcode)) {
                 document.getElementById("CustomValidatorPostCode").innerHTML = "Invalid";
                 document.getElementById("CustomValidatorPostCode").style.display = 'inline';               
             }
             if (postcode == '') {
                 document.getElementById("CustomValidatorPostCode").style.display = 'none';                
             }                
         }*/
