function isblank(s) 
{
    for(var i = 0; i < s.length; i++) {
        var c = s.charAt(i);
        if ((c != ' ') && (c != '\n') && (c != '\t')) return false;
    }
    return true;
}

function sendqueries(jlhbrg) 
{
	form1.action="saonlinephp.php?status=calculator";
	form1.submit();
}


function sendadddelivery() 
{
    var msg;
    var empty_fields = "";
    var errors = "";

	if(isblank(form1.firstname.value))
		errors += "Delivery Details \n\n - First Name required\n";
	if(isblank(form1.lastname.value))
		errors += "- Last Name required\n";
	if(isblank(form1.address1.value))
		errors += "- Address 1 required\n";
	if(isblank(form1.city.value))
		errors += "- City required\n";
	if(isblank(form1.state.value))
		errors += "- State required\n";
	if(isblank(form1.zip.value))
		errors += "- Zip Code required\n";
	if(isblank(form1.phone.value))
		errors += "- Telephone Number required\n";
	if(isNaN(form1.phone.value))
		errors += "- The telephone field must be a number \n";
	if(isblank(form1.mobile.value))
		errors += "- Mobile Number required\n";
	if(isNaN(form1.mobile.value))
		errors += "- The Mobile field must be a number \n";


	if(errors=="")
	{
		form1.action="saonlinephp.php?status=addelad";
		form1.submit();
	}
	else
	{
		alert(errors);
	}
}

function sendgiftcode() 
{
		form1.action="saonlinephp.php?status=giftcode";
		form1.submit();
}

function checkoutcart()
{
    var msg;
    var empty_fields = "";
    var errors = "";

	if(isblank(form1.hidshipcost.value))
		errors += "Delivery Cost is required\n";

	if(errors=="")
	{
			window.location='https://www.saladamsonline.com/ecompay/paymentform.php';
	}
	else
	{
		alert(errors);
	}
}

//  End -->
