$(document).ready(function () {
    $('#newuser').validate();

    $('.shipcheck').click(function () {
        if ($(this).attr("checked") == false) { return; }

        $('#ShipFirstName').val($('#FirstName').val());
        $('#ShipLastName').val($('#LastName').val());

        $('#ShipAddress1').val($('#Address1').val());
        $('#ShipAddress2').val($('#Address2').val());
        $('#ShipCity').val($('#City').val());
        $('#ShipState').val($('#State').val());
        $('#ShipPostalCode').val($('#PostalCode').val());

        if ($('#ShipCountry'))
            $('#ShipCountry').val() = $('#Country').val();
    });

});


function openWindowEmail(url)
{
popupWin = window.open(url,'new_page','width=475,height=350,resizable=1,scrollbars=no');
}

function openWindowLarge(url)
{
popupWin = window.open(url,'new_page','width=700,height=700,resizable=1,scrollbars=no');
}

function SaveReview(){
	
		jQuery.post("product_review.asp",
			{ author: jQuery('#txtAuthor').val(), content: jQuery('#txtContent').val(), code: jQuery('#txtCode').val(), productid: jQuery('#txtProductID').val()  },
			function(data){
			if(data.indexOf('OK')==0){
				//jQuery('#fmReview').before(jQuery('#txtAuthor').val()+' <span class="smallfont">'+data.replace('OK','')+'</span><br /><span class="smallfont"><strong>Reviewing ...</strong></span><br /><br />');
				 jQuery('#txtContent').val('');
				 jQuery('#txtCode').val('');
				 jQuery('.imgrandom').html('<img src="code.asp?t='+(new Date()).valueOf()+'" alt="" height="14" />');
				 alert('Thank you.');
			}
			else{
				alert("Error: "+data);
			}
			}
		);
		return false;
	}


function killErrors()
{
return true;
}
window.onerror=killErrors;
