function proceed(message, url)
{
        if(window.confirm(message)) {
                document.location.href=url;
        }
}
function openWindow(name, width, height) {
        width += 20;
        height += 30;
        window.open('',name,"toolbar=0,directories=0,resizable=0,status=0,scrollbars=0,menubar=0,width="+width+",height="+height+",top=150,left=150")
        return 0;
}
function check_order_form(f)
{
        if(trim(f.name.value) == ""){
                alert("Please enter your name");
                return false;
        }
        if(trim(f.email.value) == ""){
                alert("Please enter your email address");
                return false;
        }
        if( ! check_mail(trim(f.email.value)) ){
                alert("Please enter valid email address");
                return false;
        }
        if(trim(f.phone.value) == ""){
                alert("Please enter your phone number");
                return false;
        }
        if(trim(f.address.value) == ""){
                alert("Please enter your address");
                return false;
        }
        return true;
    
}
// trim all spaces from string
function trim(str) 
{
        str = this != window? this : str;
        return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
}
function check_mail(str)
{
    var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    if (filter.test(str)) 
        return true
    else 
        return false;
}

