﻿//start base with Hamed Saati <hamed.saati@gmail.com>
function IsEmail(Str){
	var Reg = /^[\w-\.]+\@[\w\.-]+\.[a-z]{2,4}$/
	return Reg.test(Str)
}

function send_deliver(ham3d){
         
    box1=get_value_for_ajax('pbox1');	
    box2=get_value_for_ajax('pbox2');	
    box3=get_value_for_ajax('pbox3');	
    //box4=get_value_for_ajax('pbox4');	
    box5=get_value_for_ajax('pbox5');	
    box6=get_value_for_ajax('pbox6');	
    //pcode=get_value_for_ajax('pbox7');	
    box7=get_div_value_for_ajax('get_price');	
    box8=get_div_value_for_ajax('get_total_price');	
    box9=get_div_value_for_ajax('get_deliver_price');	
    box10=get_div_value_for_ajax('get_city_ID');	
    box11=get_div_value_for_ajax('get_zone_ID');	
    cartoption=get_div_value_for_ajax('cart_option_div');	

	var Email = document.getElementById("pbox2");  	

	if (box1 == '' || box2 == '' || box3 == '' || box5 == '' || box7 == '' || box8 == '' || box9 == '' || box10 == '' || box11 == '')
		{
		write_in_id('ham3d_net_place_block_pay_error' ,'لطفا همه موارد را تکميل نماييد')
		}
		else
		{	
			if(!IsEmail(Email.value))
			{
				
				write_in_id('ham3d_net_place_block_pay_error' ,'ايميل وارد شده معتبر نمي باشد')
			}
			else
			{	
				main_ajax_do( 'send_deliver.php'  , 'ham3d_net_place_block_payway2', 'id='+ham3d+'&id1='+box1+'&id2='+box2+'&id3='+box3+'&id5='+box5+'&id6='+box6+'&id7='+box7+'&id8='+box8+'&id9='+box9+'&id10='+box10+'&id11='+box11+'&cart='+cartoption+'')
			}
		}
}

