var xmlHttp;

var id;

var colorwa;

var Adadesh;

var starteshA;

var nanayok;

var moval40;



function showColor(warn,adadesh,startesh,nanay,moval4,moval5,moval6,moval7){







	colorwa = warn;

	Adadesh = encodeURI(adadesh);

	starteshA = encodeURI(startesh);

	nanayok = encodeURI(nanay);

	moval40 = encodeURI(moval4);

	moval5 = encodeURI(moval5);

	moval6 = encodeURI(moval6);

	moval7 = encodeURI(moval7);

	

var str = "r="+(new Date().getTime()) ;







id = "HmyColorNew";



if (colorwa == "MaxCount"){



	var url="MaxCount_Div.php?r="+(new Date().getTime());

	

}



if (colorwa == 'RegRecharge'){

    var BBShetab = document.getElementById('xprice_shetab').value;

    var url="RegRecharge.php?svalue="+BBShetab+'&r='+(new Date().getTime());

}

if (colorwa == "RegFinalOrder"){

    

      

    if(document.myFinalForm.SelectPay[0].checked==true){

        var selectRadioValue = document.myFinalForm.SelectPay[0].value;

    }alert(document.myFinalForm.SelectPay[0].checked);

    if(document.myFinalForm.SelectPay[1].checked==true){

        var selectRadioValue = document.myFinalForm.SelectPay[1].value;

    }

    if(document.myFinalForm.SelectPay[2].checked==true){

        var selectRadioValue = document.myFinalForm.SelectPay[2].value;

    }

    if(document.myFinalForm.SelectPay[3].checked==true){

        var selectRadioValue = document.myFinalForm.SelectPay[3].value;

    }

    //alert('nnh');

  

    //alert(selectRadioValue);

    var factornum = document.getElementById('FactorNumber').value;

    var FactorPay = document.getElementById('FactorPay').value;

    var CheckSum = document.getElementById('CheckSum').value;

    

    //var DarsadFF = document.getElementById('DarsadFF').value;

    //var CopenFF = document.getElementById('CopenFF').value;

    

	var url="RegFinalOrder.php?svalue="+selectRadioValue+'&factornum='+factornum+'&price='+FactorPay+'&pricecheck='+CheckSum+'&r='+(new Date().getTime());

//alert(url);

}



if (colorwa == "RegHavale"){

    var xShomare = document.getElementById('xShomare').value;

    var xMablagh = document.getElementById('xMablagh').value;

    

    var myxHesab = document.getElementById('xHesab');

    var myHESAB = encodeURI(myxHesab.options[myxHesab.selectedIndex].value);

    

    var myxRooz_Variz = document.getElementById('xRooz_Variz');

    var Rooz_Variz = encodeURI(myxRooz_Variz.options[myxRooz_Variz.selectedIndex].value);

    

    var myxMah_Variz = document.getElementById('xMah_Variz');

    var Mah_Variz = encodeURI(myxMah_Variz.options[myxMah_Variz.selectedIndex].value);

    

    var myxSal_Variz = document.getElementById('xSal_Variz');

    var Sal_Variz = encodeURI(myxSal_Variz.options[myxSal_Variz.selectedIndex].value);

    

	var url="RegHavale.php?xShomare="+xShomare+'&Hesab='+myHESAB+'&xMablagh='+xMablagh+'&xRooz='+Rooz_Variz+'&xMah='+Mah_Variz+'&xSal='+Sal_Variz+'&r='+(new Date().getTime());

	

}



if (colorwa == "FactorCalc"){

			var el=document.getElementsByName("checkgroup");

            

			var bufferx="";

			for (var i=0;i<el.length;i++){

				

 				 if(el[i].checked){

 				 	//alert(el[i].value);

       				bufferx=bufferx+el[i].value+"|";

   				}

			}

            //-------------------------------------------------

            

			var bufferx2="";

            for (var i=0;i<30;i++){

                 //alert(document.getElementById("tedad_1").value);

                if (document.getElementById("tedad_"+i) != null){

                   

                    var elW=document.getElementById("tedad_"+i).value;

                    var elWName=document.getElementById("tedad_"+i).name;

 				    if(elW != ''){

 				 	     //alert(el[i].value);

       				     bufferx2=bufferx2+elWName+"|"+elW+"*";

   				     }

                }

			}

    var Copen_Takhfif = document.getElementById('xcopen_takhfif').value;

    

	var url="FactorCalc.php?IDDEL="+bufferx+"&TEDADHa="+bufferx2+"&CopenTakhfif="+Copen_Takhfif+"&r="+(new Date().getTime());

//alert(url);

}



if (colorwa == "CheckEmailExist"){

	

	var mFriendName = document.getElementById('xemail_reg').value;

	var url="EmailCheck.php?xEmail="+mFriendName+'&r='+(new Date().getTime());

    //alert(url);

}





if (colorwa == "EditPassword"){

	//alert('fff');

	var mGHPASS = document.getElementById('xPass_GH').value;

    var xNewPassword = document.getElementById('xNewPassword').value;

    var xPicCode = document.getElementById('PicCode').value;

	var url="EditUserPass2.php?xPass="+xNewPassword+'&GhPass='+mGHPASS+'&PicCode='+xPicCode+'&r='+(new Date().getTime());

    //alert(url);

}





if (colorwa == "TellFriend"){

	

	var mFriendName = document.all.xFriendName.value;

	var mFriendEmail = document.all.xFriendEmail.value;

	var mPicCode = document.all.PicCode_Friend.value;

	

	var mxmatn_f = document.all.xmatn_f.value;



	document.all.Send_FriendButt.disabled=true;

	var url="TellAFriend.php?mFriendName="+mFriendName+

	'&mFriendEmail='+mFriendEmail+'&mPicCode='+mPicCode+'&xmatn='+mxmatn_f+'&r='+(new Date().getTime());

	

}



if (colorwa == "reloadpic"){



	var url="reloadpic.php?idpro="+Adadesh+'&r='+(new Date().getTime());

	

}





if (colorwa == "ReloadModel"){



	var url="ReloadModel.php?idno="+Adadesh+'&idsubgr='+moval5+'&idp2='+starteshA+'&idp3='+nanayok+'&idp1='+moval40+'&r='+(new Date().getTime());

	//alert(url);

}



if (colorwa == "VijeLoad"){



	var url="VijeLoad.php?idpro="+Adadesh+'&r='+(new Date().getTime());

	

}



if (colorwa == "ChangeCity"){



	var url="ChangeCity.php?ido="+Adadesh+'&r='+(new Date().getTime());

	

}





if (colorwa == "Retr_Fish"){



	var url="eshop_Retr_Fish.php?r="+(new Date().getTime());

	//alert('dfdf');

}





if (colorwa == "Special"){

	

	var url="Special_Div.php?r="+(new Date().getTime());

	

}

if (colorwa == "Newest"){



	var url="Newest_Div.php?r="+(new Date().getTime());

	

}



if (colorwa == "AgentsLoad"){



	var url="Agents_Div.php?r="+(new Date().getTime());

	

}



if (colorwa == "ServicesLoad"){



	var url="Services_Div.php?r="+(new Date().getTime());

	

}



if (colorwa == "ArticlesLoad"){



	var url="Articles_Div.php?r="+(new Date().getTime());

	

}



if (colorwa == "Tosie"){



	var url="Tosie.php?IDFaq="+Adadesh+'&IDComment='+starteshA+'&r='+(new Date().getTime());

	

}



if (colorwa == "Mokhalef"){

	

	var url="Mokhalef.php?IDFaq="+Adadesh+'&IDComment='+starteshA+'&r='+(new Date().getTime());	

}





if (colorwa == "Reg_Class"){



	var url="Reg_Class.php?CID="+Adadesh+'&r='+(new Date().getTime());

	

}





if (colorwa == "Order_product_buy"){



	var url="Order_buy_Pro.php?username_order="+starteshA+'&tozihat_order='+Adadesh+

	'&pro_id='+nanayok+'&r='+(new Date().getTime());

	//alert(url);

}









if (colorwa == "company"){

var url="Retrive_Folders.php?r="+(new Date().getTime());

}



if (colorwa == "FinalBuy"){

var url="eshop_FinalBuy.php?r="+(new Date().getTime());

}





if (colorwa == "RegisterNewUser"){

	//encodeURI(

	var NameOkk = encodeURI(document.getElementById('xname_reg').value);

	var PasswordOkk = encodeURI(document.getElementById('xpassword_reg').value);

	var EmailOkk = encodeURI(document.getElementById('xemail_reg').value);

	

    

	//var Country = encodeURI(document.all.Country.value);

	var PicCode = encodeURI(document.getElementById('PicCode').value);

    var myww = document.getElementById('xgensiat_reg');

    var Gensiat = encodeURI(myww.options[myww.selectedIndex].value);	

    

 

    var TelNumber = '';

    var xcity_code = '';

    var xpostalcode = '';

    var xmobile_T = '';

    var YourAdrress = '';

    var YourCity = '';

    var YourCity_City = '';

    var xcity_code = '';

    var xpostalcode = '';

    

    if (document.getElementById('Extra_Reg').style.display != 'none'){

        var TelNumber = encodeURI(document.getElementById('xtel').value);

        var xcity_code = encodeURI(document.getElementById('xcity_code').value);

	

        var xpostalcode = encodeURI(document.getElementById('xpostalcode').value);

        var xmobile_T = encodeURI(document.getElementById('xmobile').value);

	 

    	var YourAdrress = encodeURI(document.getElementById('xaddress').value);

	

        var myent3 = document.getElementById('xostan');

        var YourCity = encodeURI(myent3.options[myent3.selectedIndex].value);	

        

        var myent333 = document.getElementById('xcity');

        var YourCity_City = encodeURI(myent333.options[myent333.selectedIndex].value);

   

        var xcity_code = encodeURI(document.getElementById('xcity_code').value);

        var xpostalcode = encodeURI(document.getElementById('xpostalcode').value);

    }

    

     var url = window.location.pathname;

     var filename = url.substring(url.lastIndexOf('/')+1);

     

     //alert(filename+'fff');

     //if (filename == 'Order_4.php'){

    // alert('yyy');    

	var url="SignUp2.php?xmobile="+xmobile_T+'&filename='+filename+'&Name='+NameOkk+'&Email1='+EmailOkk+'&TelNumber='+TelNumber+

	'&YourCity='+YourCity+'&YourAdrress='+YourAdrress+'&Password='+PasswordOkk+'&PicCode='+PicCode+'&Gensiat='+Gensiat+'&xpostalcode='+xpostalcode+'&xcity_code='+xcity_code+'&cityCity='+YourCity_City+'&r='+(new Date().getTime());

    

   // alert(url);

}





if (colorwa == "EditUser"){

	//encodeURI(



	var NameOkk = encodeURI(document.getElementById('xname_reg').value);

	var EmailOkk = encodeURI(document.getElementById('xemail_reg').value);

	

	//var Country = encodeURI(document.all.Country.value);

	var TelNumber = encodeURI(document.getElementById('xtel').value);

	var xcity_code = encodeURI(document.getElementById('xcity_code').value);

	    

  

	var xpostalcode = encodeURI(document.getElementById('xpostalcode').value);

    //alert('fffffff');

	var xmobile_T = encodeURI(document.getElementById('xmobile').value);







	 var myww = document.getElementById('xgensiat_reg');

    var Gensiat = encodeURI(myww.options[myww.selectedIndex].value);	



    

	var YourAdrress = encodeURI(document.getElementById('xaddress').value);

	

    var myent3 = document.getElementById('xostan');

    var YourCity = encodeURI(myent3.options[myent3.selectedIndex].value);	

    

    var myent333 = document.getElementById('xcity');

    var YourCity_City = encodeURI(myent333.options[myent333.selectedIndex].value);

   

    var xcity_code = encodeURI(document.getElementById('xcity_code').value);

    var xpostalcode = encodeURI(document.getElementById('xpostalcode').value);

    

	var url="EditInformation2.php?xmobile="+xmobile_T+'&Name='+NameOkk+'&Email1='+EmailOkk+'&TelNumber='+TelNumber+

	'&YourCity='+YourCity+'&YourAdrress='+YourAdrress+'&Gensiat='+Gensiat+'&xpostalcode='+xpostalcode+'&xcity_code='+xcity_code+'&cityCity='+YourCity_City+'&r='+(new Date().getTime());

    

   // alert(url);

}







if (colorwa == "LoginCheck"){

	var xUsername_LoginOkk = encodeURI(document.getElementById('xUsername_Login').value);

	var xPassword_LoginOkk = encodeURI(document.getElementById('xPassword_Login').value);

	

	//alert(xUsername_LoginOkk);

var url="Check.php?xUsername_Login="+xUsername_LoginOkk+'&xPassword_Login='+xPassword_LoginOkk+'&r='+(new Date().getTime());

//alert(url);

}



if (colorwa == "SendContact"){





	var xname = encodeURI(document.getElementById('xname').value);

	var xemail = encodeURI(document.getElementById('xemail').value);

	var xtel = encodeURI(document.getElementById('xtel').value);

	var xtext = encodeURI(document.getElementById('xtext').value);

	var PicCode = encodeURI(document.getElementById('PicCode_Contact').value);



	var url="ContactSend.php?xname="+xname+'&xemail='+xemail+'&xtel='+xtel+'&xtext='+xtext+'&PicCode='+PicCode+'&r='+(new Date().getTime());



}





if (colorwa == "Send_Comment"){

	

	var Comment_Name = encodeURI(document.all.Comment_Name.value);

	var Comment_Email = encodeURI(document.all.Comment_Email.value);

	var Comment_Matn = encodeURI(document.all.Comment_Matn.value);

	var PicCode = encodeURI(document.all.PicCode.value);



 if (Comment_Name == ''){

 	alert('نام وارد نشده است');

 	return false;

 }

 

  if (Comment_Matn == ''){

 	alert('نظر شما وارد نشده است');

 	return false;

 }

	var url="Send_Comment.php?Comment_Name="+Comment_Name+'&Comment_Email='+Comment_Email+'&Comment_Matn='+Comment_Matn+'&PicCode='+PicCode+'&News_ID='+Adadesh+'&Mos_ID='+starteshA+'&r='+(new Date().getTime());



}





if (colorwa == "Send_CommentOp"){

	





	var YourName_Comm = encodeURI(document.all.YourName_Comm.value);

	var YourCity_Comm = encodeURI(document.all.YourCity_Comm.value);

	var YourEmail_Comm = encodeURI(document.all.YourEmail_Comm.value);

	var YourText_Comm = encodeURI(document.all.YourText_Comm.value);

	var PicCode = encodeURI(document.all.PicCode.value);



 if (YourName_Comm == ''){

 	alert('نام وارد نشده است');

 	return false;

 }

 

  if (YourText_Comm == ''){

 	alert('نظر شما وارد نشده است');

 	return false;

 }

 

	var url="Send_CommentOp.php?Comment_Name="+YourName_Comm+'&Comment_Email='+YourEmail_Comm+'&Comment_Matn='+YourText_Comm+'&PicCode='+PicCode+'&Comment_City='+YourCity_Comm+'&IDFaq='+Adadesh+'&r='+(new Date().getTime());



}





if (colorwa == "Comment_Filter"){

	var RNewest = document.all.R_Sort[0].checked;

	var RTosie = document.all.R_Sort[1].checked;



	var url="Filter_Comment.php?RNewest="+RNewest+'&RTosie='+RTosie+'&ID_FAQ='+Adadesh+'&r='+(new Date().getTime());



}



















xmlHttp=GetXmlHttpObject(stateChanged);

xmlHttp.open("POST", url , true);

xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); 

//xmlHttp.setRequestHeader("enctype", "multipart/form-data"); 

xmlHttp.send(str);





}













function stateChanged() 

{ 

if (xmlHttp.readyState==1 || xmlHttp.readyState=="loading")

{	

	if (colorwa == "LoginCheck"){

		document.getElementById('LoginS').innerHTML="<img src='ajax-loader2.gif'>";

	}

    if (colorwa == "EditPassword"){

        document.getElementById('natije').innerHTML="<img src='ajax-loader2.gif'>";

	}

    if (colorwa == 'RegRecharge'){

        document.getElementById('RegRecharge').innerHTML="<p align='right'><img src='ajax-loader2.gif'><font face='tahoma' size='1'>لطفا كمي صبر نماييد </font></p>";

    }

	if (colorwa == "VijeLoad"){

		document.getElementById('sometext').innerHTML="<p align='right'><img src='ajax-loader2.gif'><font face='tahoma' size='1'>لطفا كمي صبر نماييد </font></p>";

	}

	if (colorwa == "Retr_Fish"){

		document.getElementById('KOLL').innerHTML="<p align='right'><img src='ajax-loader2.gif'><font face='tahoma' size='1'>لطفا كمي صبر نماييد </font></p>";

	}

	

    if (colorwa == "RegHavale"){

        document.getElementById('Havale').innerHTML="<p align='right'><img src='ajax-loader2.gif'><font face='tahoma' size='1'>لطفا كمي صبر نماييد </font></p>";

    }

	if (colorwa == "reloadpic"){

		document.getElementById('KOLL').innerHTML="<p align='right'><img src='ajax-loader2.gif'><font face='tahoma' size='1'>لطفا كمي صبر نماييد </font></p>";

	}

	

	if (colorwa == "Send_Comment"){

		document.getElementById('Comment_DIV').innerHTML="<p align='right'><img src='ajax-loader2.gif'><font face='tahoma' size='1'>لطفا كمي صبر نماييد </font></p>";

	}

	

	if (colorwa == "Send_CommentOp"){

		document.getElementById('mComDiv').innerHTML="<p align='right'><img src='ajax-loader2.gif'><font face='tahoma' size='1'>لطفا كمي صبر نماييد </font></p>";

	}

	

    if (colorwa == "EditUser"){

        document.getElementById('RSuccess').innerHTML="<p align='right'><img src='ajax-loader2.gif'><font face='tahoma' size='1'>لطفا كمي صبر نماييد </font></p>";

    }

	

	if (colorwa == "Reg_Class"){

		document.getElementById('LoadTD').innerHTML="<p align='right'><img src='loader.gif'><font face='tahoma' size='1'>لطفا كمي صبر نماييد </font></p>";

	}

	

	if (colorwa == "Comment_Filter"){

		document.getElementById('Comment_DIV').innerHTML="<p align='right'><img src='ajax-loader2.gif'><font face='tahoma' size='1'>لطفا كمي صبر نماييد </font></p>";	

	}

	if (colorwa == "ArticlesLoad"){

		document.getElementById('Main_Div').innerHTML="<p align='right'><img src='ajax-loader2.gif'><font face='tahoma' size='1'>لطفا كمي صبر نماييد </font></p>";

	}

	if (colorwa == "RegisterNewUser"){

		document.getElementById('reg_DIVV').innerHTML="<p align='right'><img src='ajax-loader2.gif'><font face='tahoma' size='1'>لطفا كمي صبر نماييد </font></p>";

	}

	if (colorwa == "v_detail"){

		document.getElementById('PicCView').innerHTML="<p align='right'><img src='ajax-loader2.gif'><font face='tahoma' size='1'>لطفا كمي صبر نماييد </font></p>";	

	}

	if (colorwa == "Order_product"){

		var mDivID = document.all.LastOrderID.value;

		document.getElementById('Buy_Product_'+mDivID).innerHTML="<p align='right'><img src='ajax-loader2.gif'><font face='tahoma' size='1'>لطفا كمي صبر نماييد </font></p>";	

	}

	if (colorwa == "Order_product_buy"){

		var mDivID = document.all.LastOrderID.value;

		document.getElementById('Buy_Product_'+mDivID).innerHTML="<p align='right'><img src='ajax-loader2.gif'><font face='tahoma' size='1'>لطفا كمي صبر نماييد </font></p>";

	}

	if (colorwa == "SendContact"){

			document.getElementById('reg_DIVV').innerHTML="<p align='right'><img src='ajax-loader2.gif'><font face='tahoma' size='1'>لطفا كمي صبر نماييد </font></p>";

	}

	if (colorwa == "Tosie"){

		//document.getElementById('IDmovafegh2').innerHTML="<p align='right'><img src='ajax-loader2.gif'><font face='tahoma' size='1'>لطفا كمي صبر نماييد </font></p>";

	}

	if (colorwa == "Mokhalef"){

		//document.getElementById('IDmokhalef2').innerHTML="<p align='right'><img src='ajax-loader2.gif'><font face='tahoma' size='1'>لطفا كمي صبر نماييد </font></p>";	

	}

	if (colorwa == "FinalBuy"){

		document.getElementById('basketWrap').innerHTML="<p align='right'><img src='ajax-loader2.gif'><font face='tahoma' size='1'>لطفا كمي صبر نماييد </font></p>";

	}

	if (colorwa == "ChangeCity"){

		document.getElementById('city_city').innerHTML="<p align='right'><img src='ajax-loader2.gif'><font face='tahoma' size='1'>لطفا كمي صبر نماييد </font></p>";

	}

	if (colorwa == "TellFriend"){

		document.getElementById('Friend_Load').innerHTML="<p align='right'><img src='ajax-loader2.gif'><font face='tahoma' size='1'></font></p>";

	}

	if (colorwa == "ReloadModel"){

		//document.getElementById('ModelTD').innerHTML="<p align='right'><img src='ajax-loader2.gif'><font face='tahoma' size='1'></font></p>";

	}

	if (colorwa == "CheckEmailExist"){

		document.getElementById('ModelTD').innerHTML="<p align='right'><img src='ajax-loader2.gif'><font face='tahoma' size='1'></font></p>";

	}

	if (colorwa == "FactorCalc"){

		document.getElementById('TBLBasket').innerHTML="<p align='right'><img src='ajax-loader2.gif'><font face='tahoma' size='1'></font></p>";

	}

    if (colorwa == "RegFinalOrder"){

        document.getElementById('Javab').innerHTML="<p align='right'><img src='ajax-loader2.gif'><font face='tahoma' size='1'></font></p>";

    }

        

}





if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")

{ 

    if (colorwa == 'RegRecharge'){

        

        document.getElementById('RegRecharge').innerHTML=xmlHttp.responseText;

        RechargeFormRet.submit();

    }

    if (colorwa == "RegHavale"){

        document.getElementById('Havale').innerHTML='&nbsp;ارسال شد - تا 24 ساعت آینده به حساب شما اضافه خواهد شد ';

    }

    if (colorwa == "RegFinalOrder"){

       var responsea = xmlHttp.responseText;
       var citiesa=responsea.split('|');

       if (citiesa[0]== 'POST' && citiesa[1] != 0){
            window.parent.location.href='http://www.pardakht.ir/SpecialShoppingCart/Cart.cfm?ID=iranidoost&MP=31&ref=http://www.iranidoost.com&ProdID='+citiesa[1];
       }
       if (citiesa[0]== 'Online' && citiesa[1] != 0){
            document.getElementById('SamanForm').submit();
       }
       if (citiesa[0] != 'POST' && citiesa[0] != 'Online'){
            document.getElementById('Javab').innerHTML=xmlHttp.responseText;
       }

    }

    if (colorwa == "EditPassword"){

        if (xmlHttp.responseText == 'GHPASS'){

            alert('کلمه عبور قبلی صحیح نیست');

            document.getElementById('natije').innerHTML='کلمه عبور قبلی صحیح نیست';

        }

        if (xmlHttp.responseText == 'PICCode'){

            alert('کد امنیتی وارد شده صحیح نیست');

            document.getElementById('natije').innerHTML='کد امنیتی وارد شده صحیح نیست';

        }

        if (xmlHttp.responseText == ''){

            document.getElementById('natije').innerHTML='&nbsp;با موفقیت تغییر یافت ';

        }

    }

    if (colorwa == "EditUser"){

        //alert(xmlHttp.responseText);

        document.getElementById('RSuccess').innerHTML='&nbsp;با موفقیت تغییر یافت';

    }

	if (colorwa == "FactorCalc"){

	  // alert(xmlHttp.responseText);

		document.getElementById('TBLBasket').innerHTML=xmlHttp.responseText;

	}

	if (colorwa == "VijeLoad"){

		document.getElementById('sometext').innerHTML=xmlHttp.responseText;

		fadein('sometext');

	}

	if (colorwa == "CheckEmailExist"){//alert(xmlHttp.responseText);

		if (xmlHttp.responseText == "AlertEmailExist"){

			alert('آدرس ایمیل وارد شده تکراری است لطفا آدرس دیگری وارد نمایید');

			document.getElementById('Alert_xemail_reg').style.visibility="";

			document.getElementById('Alert_xemail_reg').innerHTML='این پست الکترونیک تکراری است! آدرس دیگری وارد نمایید.';				}

	}

	if (colorwa == "ReloadModel"){

       // Chon dar FireFox Optionhaie ke dar Darkhaste Ajax miad ro nemishnase va optionhaye ghabli ra mishnase , ba DOM Halesh kardim

        var list=document.getElementById("DestinatinSelect");

        while (list.childNodes[0]) {

            list.removeChild(list.childNodes[0])

        }



        var response = xmlHttp.responseText;

        var list=document.getElementById("DestinatinSelect");

        var cities=response.split('|');

        for (i=1; i<cities.length; i++) {

            

            var CValue=cities[i].split(';');

            var elOptNew = document.createElement('option');

            elOptNew.text = CValue[0];

            elOptNew.value = CValue[1];

            try {

                list.add(elOptNew, null); // standards compliant; doesn't work in IE

            }

            catch(ex) {

                 

                list.add(elOptNew); // IE only

            }



        }

		//document.getElementById('ModelTD').innerHTML=xmlHttp.responseText;

	}

	if (colorwa == "reloadpic"){

		document.getElementById('KOLL').innerHTML=xmlHttp.responseText;

	}

	if (colorwa == "TellFriend"){

		document.all.Send_FriendButt.disabled=false;

		document.getElementById('Friend_Load').innerHTML="";

		var MyRTTS = xmlHttp.responseText;

		JODAKONS = MyRTTS.split('PSplit');

		var xAMALS=decodeURI(JODAKONS[0]);



		var xAMAL_LANGS=decodeURI(JODAKONS[1]);

		if (xAMALS == "PICCode"){

			if (xAMAL_LANGS == "En"){

				alert('Entered Text Of Security Image Is Wrong !');

				document.getElementById('PicCode_Friend').style.bgColor='red';

			}

			if (xAMAL_LANGS == "Fa"){

				alert('عبارت موجود در تصویر امنیتی به درستی وارد نشده است');

				document.getElementById('PicCode_Friend').style.bgColor='red';

			}

		}

		if (xAMALS == "OK"){

			if (xAMAL_LANGS == "En"){

				alert('Sent successfully. Thank you for sharing information');

			}

			if (xAMAL_LANGS == "Fa"){

				alert('از شما برای  پیشنهاد این سایت به دوستان خود متشکریم');

			}

		}

	}

	

	if (colorwa == "LoginCheck"){

		var MyRTTS = xmlHttp.responseText;

		JODAKONS = MyRTTS.split('PSplit');

		

		var xAMALS=JODAKONS[0];

		var xAMALS2=JODAKONS[1];



		

		document.getElementById('LoginS').innerHTML="";

		if (xmlHttp.responseText == "NotCorrect"){

			alert('نام کاربری یا کلمه عبور صحیح نیست');

			document.getElementById('LoginS').innerHTML='&nbsp;معتبر نیست';

		}else{

		     // alert(window.parent.location.href);

            var url = window.location.pathname;

            var filename = url.substring(url.lastIndexOf('/')+1);

            if (filename == 'Order_2.php'){

                var xCopen = document.getElementById('XCOPEN').value;

                window.parent.location.href = "Order_3.php?xcopen_takhfif="+xCopen;

            }

			document.getElementById('MemberTable').innerHTML=xAMALS;

			document.getElementById('myBasket').innerHTML=xAMALS2;

			

		}

	}

	if (colorwa == "ChangeCity"){

		document.getElementById('city_city').innerHTML=xmlHttp.responseText;

	}

	if (colorwa == "FinalBuy"){

		document.getElementById('basketWrap').innerHTML=xmlHttp.responseText;

	}

	if (colorwa == "Retr_Fish"){

		//alert('bbbb');

		document.getElementById('KOLL').innerHTML=xmlHttp.responseText;

	}

	if (colorwa == "Reg_Class"){

		document.getElementById('LoadTD').innerHTML=xmlHttp.responseText;

	}

	

	

	



		

	if (colorwa == "Tosie"){

		var Myresponseokw = xmlHttp.responseText;

		IDCOMNAZAR = Myresponseokw.split('PSplit');

		okk1a=decodeURI(IDCOMNAZAR[0]);

		okk2a=decodeURI(IDCOMNAZAR[1]);

		

		document.getElementById('IDmovafegh2'+okk2a).innerHTML="";

		document.getElementById('IDmovafegh'+okk2a).innerHTML=okk1a;

	}



	if (colorwa == "Mokhalef"){

		var Myresponseokw = xmlHttp.responseText;

		IDCOMNAZAR = Myresponseokw.split('PSplit');

		okk1a=decodeURI(IDCOMNAZAR[0]);

		okk2a=decodeURI(IDCOMNAZAR[1]);

		

		document.getElementById('IDmokhalef2'+okk2a).innerHTML="";

		document.getElementById('IDmokhalef'+okk2a).innerHTML=okk1a;

	}

	

	if (colorwa == "Comment_Filter"){

		document.getElementById('Comment_DIV').innerHTML=xmlHttp.responseText;

	}

	

	if (colorwa == "FilterV"){

		document.getElementById('Filter_Listt').innerHTML=xmlHttp.responseText;

	}

	if (colorwa == "Send_Comment"){

		if (xmlHttp.responseText == "Ok"){

			document.getElementById('Comment_DIV').innerHTML="<span style='background-color: #008000'><font color='#FFFFFF'>&nbsp;نظر شما ثبت شد </font></span>";

		}

		if (xmlHttp.responseText == "SecureCode"){

			document.getElementById('Comment_DIV').innerHTML="<b>&nbsp;<font color='#FFFFFF'><span style='background-color: #990100'> کد امنیتی اشتباه وارد شده است</span></font></b>";

		}

		//document.getElementById('Comment_DIV').innerHTML=xmlHttp.responseText;

	}

	

	if (colorwa == "Send_CommentOp"){

		if (xmlHttp.responseText == "Ok"){

			document.getElementById('mComDiv').innerHTML="<span style='background-color: #008000'><font color='#FFFFFF'>&nbsp;نظر شما ثبت شد </font></span>";

		}

		if (xmlHttp.responseText == "SecureCode"){

			document.getElementById('mComDiv').innerHTML="<b>&nbsp;<font color='#FFFFFF' style='font-size:8pt'><span style='background-color: #990100'> کد امنیتی اشتباه وارد شده است</span></font></b>";

		}

	}

	



	

	

	if (colorwa == "SendContact"){

		

		if (xmlHttp.responseText == "PICCode"){

			alert('عبارت موجود در تصویر امنیتی به درستی وارد نشده است');

			document.getElementById('reg_DIVV').innerHTML="عبارت موجود در تصویر امنیتی به درستی وارد نشده است";

		}else{

			alert('از تماس شما متشکریم ، در اسرع وقت با شما تماس خواهیم گرفت');

			document.getElementById('reg_DIVV').innerHTML="از تماس شما متشکریم";

		}

	}

	if (colorwa == "AboutLoad"){

		var Myresponseokw = xmlHttp.responseText;

		

		document.getElementById('Main_Div').innerHTML=Myresponseokw;

	}

	if (colorwa == "MaxCount"){

		var Myresponseokw = xmlHttp.responseText;

		

		document.getElementById('tab_Menu').innerHTML=Myresponseokw;

		

	}

	

	if (colorwa == "Newest"){

		var Myresponseokw = xmlHttp.responseText;

		

		document.getElementById('tab_Menu').innerHTML=Myresponseokw;

			

	}

	if (colorwa == "Special"){

		var Myresponseokw = xmlHttp.responseText;

		

		document.getElementById('tab_Menu').innerHTML=Myresponseokw;

			

	}

	

	if (colorwa == "AgentsLoad"){

		var Myresponseokw = xmlHttp.responseText;

		document.getElementById('Main_Div').innerHTML=Myresponseokw;

	}

	if (colorwa == "ServicesLoad"){

			var Myresponseokw = xmlHttp.responseText;

			document.getElementById('Main_Div').innerHTML=Myresponseokw;

	}

	

	if (colorwa == "ArticlesLoad"){

		var Myresponseokw = xmlHttp.responseText;

		document.getElementById('Main_Div').innerHTML=Myresponseokw;

	}

	

	

	if (colorwa == "Order_product_buy"){

		var Myresponseokw = xmlHttp.responseText;

		HeadAzMatnN = Myresponseokw.split('PSplit');

		okk1=decodeURI(HeadAzMatnN[0]);

		document.getElementById('Buy_Product_'+okk1).innerHTML="";

		okk2=decodeURI(HeadAzMatnN[1]);

		if (okk2 == "UsernameError"){

			alert('نام کاربری وارد شده در سیستم وجود ندارد');

		}else{

			alert('سفارش شما ارسال شد ، منتظر تماس ما باشید');

		}

	}

	

	if (colorwa == "company"){

			document.getElementById('company_msg').innerHTML=xmlHttp.responseText;

	}

	if (colorwa == "RegisterNewUser"){

	   

      //alert(xmlHttp.responseText+'mmmm');

		document.getElementById('reg_DIVV').innerHTML="";



		

		if (xmlHttp.responseText == "PICCode"){

			alert('خطا : عبارت موجود در تصویر به طور صحیح وارد نشده است');

			return false;

		}else if (xmlHttp.responseText == "CompanyName"){

			alert('خطا : در نام شرکت کاراکترهای نامفهوم وجود دارد');

			}else if (xmlHttp.responseText == "PasswordEmpty"){

			alert('خطا : کلمه عبور وارد نشده است');

			}else if (xmlHttp.responseText == "NameEmpty"){

			alert('خطا : نام وارد نشده است');

			}else if (xmlHttp.responseText == "FamilyEmpty"){

			alert('خطا : نام خانوادگی وارد نشده است');

			}else if (xmlHttp.responseText == "UsernameEmpty"){

			alert('خطا : نام کاربری دلخواه خود را وارد نکرده اید');

		}else if (xmlHttp.responseText == "UsernameExist"){

			alert('این نام کاربری قبلا در سیستم ثبت شده است ، لطفا نام کاربری دیگری انتخاب نمایید');

		}else if (xmlHttp.responseText == "EmailExist"){

			alert('آدرس ایمیل وارد شده در سیستم وجود دارد ، لطفا آدرس ایمیل دیگری وارد نمایید');

		}else if (xmlHttp.responseText == "UserName"){

			alert('لطفا برای نام کاربری فقط از حروف انگلیسی و اعداد و یا کاراکتر _ استفاده نمایید');

		}else {

		        var url = window.location.pathname;

                var filename = url.substring(url.lastIndexOf('/')+1);

                if (filename == 'Order_4.php'){

                     window.parent.location.href='Order_5.php?xuser='+xmlHttp.responseText;

                }else{

			         window.parent.location.href='reg_ok.php?xuser='+xmlHttp.responseText;

                }

		}

		

		

	}

	

	if (colorwa == "v_detail"){

	var Myresponseokw = xmlHttp.responseText;

		HeadAzMatn = Myresponseokw.split('<JODASSHOD>');

		

		okk1=decodeURI(HeadAzMatn[1]);

		okk0=decodeURI(HeadAzMatn[0]);

		okk2=decodeURI(HeadAzMatn[2]);

		okk3=decodeURI(HeadAzMatn[3]);

		okk4=decodeURI(HeadAzMatn[4]);

		okk5=decodeURI(HeadAzMatn[5]);

		okk6=decodeURI(HeadAzMatn[6]);

		

		document.getElementById('Noe_Sang').value=okk2;

		document.getElementById('Analyse_Fiz').value=okk1 ;

		document.getElementById('Analyse_Shi').value=okk0 ;

		document.getElementById('Rang').value=okk4 ;

		document.getElementById('Location_madan').value=okk5 ;

		document.getElementById('Code').value=okk6 ;

		if (okk3 != ''){

			document.getElementById('PicCView').style.display='';

			document.getElementById('PicCView').style.visibility='visible';

			document.getElementById('PicCView').innerHTML=okk3;

		}else{

			document.getElementById('PicCView').style.display='none';

			document.getElementById('PicCView').style.visibility='hidden';

		}

}





}

}



function GetXmlHttpObject(handler){ 



var objXmlHttp=null;

if (navigator.userAgent.indexOf("Opera")>=0)

{

alert("This example doesn't work in Opera") ;

return ;

}



if (navigator.userAgent.indexOf("MSIE")>=0)

{ 

var strName="Msxml2.XMLHTTP";

if (navigator.appVersion.indexOf("MSIE 5.5")>=0)

{

strName="Microsoft.XMLHTTP";

} 

try

{

objXmlHttp=new ActiveXObject(strName);

objXmlHttp.onreadystatechange=handler ;

return objXmlHttp;

} 

catch(e)

{ 

alert("Error. Scripting for ActiveX might be disabled");

return;

} 

} 

if (navigator.userAgent.indexOf("Mozilla")>=0)

{

objXmlHttp=new XMLHttpRequest();

objXmlHttp.onload=handler;

objXmlHttp.onerror=handler;

return objXmlHttp;

}

}


