var Wtime=0
var Mtime=60
function Ntrdy(){
n=!window.frames['mF'].document.all.a1;
if(!n)n=window.frames['mF'].document.all.a1.value.length>0;
return(n);
}
function DoP(m,n,o){
if(o==0) alert("ارتباط با سرور قطع شده است. امكان ارسال اطلاعات وجود ندارد!‏");
else alert("پاسخي از سرور دريافت نشد. ارتباط با سرور قطع است!‏");
Wtime=0;
if(m.substring(0,3)=="DoR" || m=="RNT"){
DoE("R"+n, 1, "");
DoE("RN"+n, 1, "hidden");
}
if(m.substring(0,3)=="DoP" || m=="PNT"){
DoE("P"+n, 1, "");
DoE("PN"+n, 1, "hidden");
}
if(m.substring(0,3)=="DoN" || m=="YNT"){
DoE("YB", 1, "");
DoE("YN", 1, "hidden");
}}
function Drdy(m,n){
if(Wtime<Mtime){
t=setTimeout(m,1000);
Wtime++;
}else{
DoP(m,n,0)
}}
function Drty(r,n){
if(r==1)q="RNT";
if(r==2)q="PNT";
if(r==3)q="YNT";
if(r==3)m=document.all[q].title;
else m=document.all[q+n].title;
if(m.length>0){
m=m-0
if(m<Mtime){
if(r==3)DoE(q, 7, m-0+1);
else DoE(q+n, 7, m-0+1);
k=setTimeout('Drty('+r+','+n+')',1000);
}else{
DoP(q,n,1)
}}}
function DoRate(Ncod,Wht){
DoE("R"+Ncod, 1, "hidden");
DoE("RN"+Ncod, 1, "");
DoE("RNT"+Ncod, 2, "در حال ثبت ...‏");
if(Ntrdy()){Drdy('DoRate('+Ncod+','+Wht+')',Ncod);return;}else Wtime=0;
DoA("a1", "1");
DoA("a2", Ncod);
DoA("a3", Wht);
DoS();
DoE("RNT"+Ncod, 7, "0");
k=setTimeout('Drty(1,'+Ncod+')',1000);
}
function DoPas(Acod,Ncod){
if(document.getElementById("pName"+Ncod).value.length==0 || document.getElementById("pMatn"+Ncod).value.length==0)return;
DoE("P"+Ncod, 1, "hidden");
DoE("PN"+Ncod, 1, "");
DoE("PNT"+Ncod, 2, "در حال ارسال پاسخ ...‏");
if(Ntrdy()){Drdy('DoPas('+Acod+','+Ncod+')',Ncod);return;}else Wtime=0;
DoA("a1", "2");
DoA("a2", Acod);
DoA("a3", Ncod);
DoA("a4", document.all["pName"+Ncod].value);
DoA("a5", document.all["pEmail"+Ncod].value);
DoA("a6", document.all["pMatn"+Ncod].value);
DoS();
DoE("PNT"+Ncod, 7, "0");
k=setTimeout('Drty(2,'+Ncod+')',1000);
SK("N",document.all["pName"+Ncod].value);
SK("E",document.all["pEmail"+Ncod].value);
}
function DoNaz(Acod){
if(document.getElementById("Name").value.length==0 || document.getElementById("Matn").value.length==0)return;
DoE("YB", 1, "hidden");
DoE("YN", 1, "");
DoE("YNT", 2, "در حال ارسال نظر ...‏");
if(Ntrdy()){Drdy('DoNaz('+Acod+')',0);return;}else Wtime=0;
DoA("a1", "3");
DoA("a2", Acod);
DoA("a3", document.getElementById("Name").value);
DoA("a4", document.getElementById("Email").value);
DoA("a5", document.getElementById("Matn").value);
DoS();
DoE("YNT", 7, "0");
k=setTimeout('Drty(3,0)',1000);
SK("N",document.getElementById("Name").value);
SK("E",document.getElementById("Email").value);
}
function ChekMe(wht,cod){
if (ChK(wht+cod)){
if(wht=="R"){
DoE(wht+cod, 1, "hidden");
DoE(wht+"N"+cod, 1, "");
DoE(wht+"NT"+cod, 2, "نظر داده‏ايد!‏");
}
if(wht=="P"){
DoE("NNpas"+cod, 1, "hidden");
DoE("ApasN"+cod, 2, "شما به اين نظر پاسخ داده‏ايد!‏");
DoE("NNpasI"+cod, 4, "images/close.gif");
DoE("Apas"+cod, 5, "");
DoE("Apas"+cod, 6, "");
}
if(wht=="Y"){
DoE("Nnazar", 1, "hidden");
DoE("Nmat", 2, "شما به اين محصول نظر داده‏ايد!‏");
DoE("NnazarI", 4, "images/close.gif");
DoE("Anaz", 5, "");
DoE("Anaz", 6, "");
}
}
}