function move(e,matn) {
	var s = parseFloat(mydivid('joojoo-main').style.top);
	mydivid('joojoo-top').innerHTML=matn;
	if (s>e) {
		h = Math.round(s-e);
		moveU(s,e);
	}
	else if (e>s) {
		h = Math.round(e-s);
		moveD(s,e)
	}
}
function moveD(s,e) {
if (Math.round(e-s)>h/2) {
	s +=9;
	mydivid('joojoo-main').style.top = s+"px" ;
	setTimeout("moveD("+s+","+e+")",15);
	 return (false);
}
else if (Math.round(e-s)>h/4) {
	s +=7;
	mydivid('joojoo-main').style.top = s+"px" ;
	setTimeout("moveD("+s+","+e+")",20);
	 return (false);
}
else if (Math.round(e-s)>h/6) {
	s +=5;
	mydivid('joojoo-main').style.top = s+"px" ;
	setTimeout("moveD("+s+","+e+")",20);
	 return (false);
}
else if (Math.round(e-s)>h/12) {
	s +=3;
	mydivid('joojoo-main').style.top = s+"px" ;
	setTimeout("moveD("+s+","+e+")",20);
	 return (false);
}
else if (Math.round(e-s)>0) {
	s +=1;
	mydivid('joojoo-main').style.top = s+"px" ;
	setTimeout("moveD("+s+","+e+")",20);
	 return (false);
}

}
function moveU(s,e) {
//st  =parseFloat(mydivid(s).style.top);
if (Math.round(s-e)>h/2) {
	s +=-9;
	mydivid('joojoo-main').style.top = s+"px" ;
	setTimeout("moveU("+s+","+e+")",15);
	 return (false);
}
else if (Math.round(s-e)>h/4) {
	s +=-7;
	mydivid('joojoo-main').style.top = s+"px" ;
	setTimeout("moveU("+s+","+e+")",20);
	 return (false);
}
else if (Math.round(s-e)>h/6) {
	s +=-5;
	mydivid('joojoo-main').style.top = s+"px" ;
	setTimeout("moveU("+s+","+e+")",20);
	 return (false);
}
else if (Math.round(s-e)>h/12) {
	s +=-3;
	mydivid('joojoo-main').style.top = s+"px" ;
	setTimeout("moveU("+s+","+e+")",20);
	 return (false);
}
else if (Math.round(s-e)>0) {
	s +=-1;
	mydivid('joojoo-main').style.top = s+"px" ;
	setTimeout("moveU("+s+","+e+")",20);
	 return (false);
}
}

function ValidateForm()
{
var address = document.F1.address;
if ((address.value==null)||(address.value==""))
{
address.style.background='#FFDDE3';
alert("آدرس وارد نشده است");
address.focus();
return false;
}
var postal_code = document.F1.zipcode;
var postal_codeValue = F1.zipcode.value;
if ((postal_codeValue==null)||(postal_codeValue==""))
{
postal_code.style.background='#FFDDE3';
alert("کد پستی وارد نشده است");
postal_code.focus();
return false;
}
if (!/^[0-9]+$/.test(postal_codeValue))
{
postal_code.style.background='#FFDDE3';
   alert("کد پستی باید عدد باشد");
postal_codeValue="";
postal_code.focus();
return false;
}
if (postal_codeValue.length > 10 || postal_codeValue.length < 5)
{
postal_code.style.background='#FFDDE3';
alert("کد پستی باید 5 و یا 10 رقم باشد");
postal_code.focus()
return false;
}

var myRegExp = /0/;
var matchPos1 = postal_codeValue.search(myRegExp);
if(matchPos1 != -1)
{
postal_code.style.background='#FFDDE3';
alert("کد پستی نمیتواند شامل عدد صفر باشد");
postal_code.value = "";
postal_code.focus();
return false;
}
var myRegExp = /2/;
var matchPos1 = postal_codeValue.search(myRegExp);
if(matchPos1 != -1)
{
postal_code.style.background='#FFDDE3';
alert("کد پستی نمیتواند شامل عدد 2 باشد");
postal_code.value = "";
postal_code.focus();
return false;
}
var first_name = document.F1.name;
if ((first_name.value==null)||(first_name.value==""))
{
first_name.style.background='#FFDDE3';
alert("نام وارد نشده است");
first_name.focus();
return false;
}

var last_name = document.F1.l_name;
if ((last_name.value==null)||(last_name.value==""))
{
last_name.style.background='#FFDDE3';
alert("نام خانوادگی وارد نشده است");
last_name.focus();
return false;
}

var phone = document.F1.tel_home;
var work = document.F1.tel_job;
var cell = document.F1.tel_mobile;
if ((phone.value ==null || phone.value =="") && (cell.value ==null || cell.value =="") && (work.value ==null || work.value ==""))
{
phone.style.background='#FFDDE3';
cell.style.background='#FFDDE3';
alert("حداقل دو شماره تلفن برای تماس وارد کنید");
phone.focus();
return false;
}
else {
document.F1.submit()
parent.scrolli();

}
}
var numbers='1234567890'
function alpha(e,allow)
{var k;
k=document.all?parseInt(e.keyCode): parseInt(e.which);
return (allow.indexOf(String.fromCharCode(k))!=-1);}
var code='13456789'
function postalcode(e,allow)
{var k;
k=document.all?parseInt(e.keyCode): parseInt(e.which);
return (allow.indexOf(String.fromCharCode(k))!=-1);}
