function setPaymentInfo(isChecked)
{
	with (window.document.sign_up || window.document.form1) 
	{
		if (isChecked) 
		{
			txt_c_house.value  = txt_house.value;	
			txt_c_area.value  = txt_area.value;	
			txt_c_city.value  = txt_city.value;	
			txt_c_state.value  = txt_state.value;	
			txt_c_pin.value  = txt_pin.value;	
			c_country.value  = r_country.value;	
			
			txt_c_house.readOnly  = true;
			txt_c_area.readOnly  = true;
			txt_c_city.readOnly  = true;
			txt_c_state.readOnly  = true;
			txt_c_pin.readOnly  = true;
			c_country.readOnly  = true;
		}else{
			txt_c_house.readOnly  = false;	
			txt_c_area.readOnly  = false;	
			txt_c_city.readOnly  = false;	
			txt_c_state.readOnly  = false;	
			txt_c_pin.readOnly  = false;	
			c_country.readOnly  = false;	
		}
	}
}


function checkShippingAndPaymentInfo()
{
	with (window.document.frmCheckout) {
		if(isEmpty(txtShippingFirstName) || isEmpty(txtShippingLastName) || isEmpty(txtShippingAddress1) || isEmpty(txtShippingPhone) || isEmpty(txtShippingState) || isEmpty(txtShippingCity) || isEmpty(txtShippingPostalCode) || isEmpty(txtPaymentFirstName) || isEmpty(txtPaymentLastName) || isEmpty(txtPaymentAddress1) || isEmpty(txtPaymentPhone) || isEmpty(txtPaymentState) || isEmpty(txtPaymentCity) || isEmpty(txtPaymentPostalCode) || txtShippingCountry.selectedIndex == 0 || txtPaymentCountry.selectedIndex == 0){
			alert("All fields are mandatory Please fill it Completely!");
			return false;
		}
		
		if(isNaN(txtShippingPhone.value) || isNaN(txtPaymentPhone.value)){
			alert("Phone number field must contain only digits!");
			txtShippingPhone.focus();
			return false;
		}
	}
}

function isEmpty(obj){
	var val = replaceAll(obj.value, " ", "");
	if(val.length == 0)
		return true;
}

function replaceAll(value, oldchar, newchar){
	while(true){
		if(value.indexOf(oldchar) >= 0)
			value = value.replace(oldchar, newchar);
		else
			break;
	}
	return value;
}