var i=1;

var page="";
var httpRequest;
var data;
var objid="";
var sendinmethod="G";
var mymessage="";
 

function fndo(page1,data1,objid1,smethod,mymessage1)
{
page=page1;
   data=data1;
   objid=objid1;
  
   mymessage=mymessage1;

if (window.XMLHttpRequest)
           { // Mozilla, Safari, ...
             httpRequest = new XMLHttpRequest();
             if (httpRequest.overrideMimeType) 
                {
                httpRequest.overrideMimeType('text/xml');
                // See note below about this line
                }
           } 
        else if (window.ActiveXObject)
           { // IE
             try 
           {
                httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
           } 
            catch (e) 
           {
               
             try
           {
                    httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
           } 
           
              catch (e) {}
           }


  }


if (httpRequest) 
        { 
         if(sendinmethod=='P')
           {    
             httpRequest.open("POST",page,true); 
             httpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
             httpRequest.onreadystatechange = show;
             httpRequest.send(data); 
            }
          else if(sendinmethod=='G')
          
            {
            httpRequest.open("GET", page , true); 
            httpRequest.onreadystatechange = show;
            httpRequest.send(); 
            
            }
          
        } 


function show()
{
  if(httpRequest.readyState==1){ // loading
	document.getElementById(objid).innerHTML = '<center><table border="0"  width="100%" height="100%"  ><tr><td><center><img src="img/loading.gif" width="35" height="35" align="absmiddle" />'+mymessage+'</center></td></tr></table></center>';
	
  }
    if(httpRequest.readyState==4){ // page loaded
		 if(httpRequest.status == 200){ // if page found =OK
			document.getElementById(objid).innerHTML =httpRequest.responseText;
			
		 }
	}
	}

}

function n()
{
   FP_setLayerText(/*id*/'layer1', ' ')
   FP_changeProp('layer1',0,'style.filter','alpha(opacity=0)');
   FP_changeProp(/*id*/'layer1',0,'style.opacity','0');
   FP_changeProp(/*id*/'layer1',0,'style.width','0','style.height','0');
  
}
function neda(x,y,mess)
{
var txt="<table border='0' width='100%' cellspacing='0' cellpadding='0' height='100%' id='table1'>";
    txt+="<tr><td><p align='center' dir='rtl'><font face='Tahoma' style='font-size: 7pt' color='#FFFFFF'>";
    txt+="ق&#1740;مت تقر&#1740;ب&#1740; 	ا&#1740;ن دستگاه "+mess+" تومان م&#1740; باشد.";
    txt+="</font></p><p align='center' dir='rtl'><font face='Tahoma' style='font-size: 7pt' color='#FFFFFF'>";
    txt+="برا&#1740; سفارش به بخش نحوه خر&#1740;د مراجعه نمائ&#1740;د.";
    txt+="</font></td></tr></table>";
    FP_setLayerText(/*id*/'layer1', txt)
mstart();FP_changeProp(/*id*/'layer1',0,'style.left',x,'style.top',y);
FP_changeProp(/*id*/'layer1',0,'style.width','300','style.height','130');
FP_setLayerText(/*id*/'layer1', txt)


}

function paygah()
{
FP_changeProp(/*id*/'layer1',0,'style.filter','alpha(opacity=90)');
FP_changeProp(/*id*/'layer1',0,'style.opacity',0.9);
FP_changeProp(/*id*/'layer1',0,'style.left','0','style.top','0');FP_changeProp(/*id*/'layer1',0,'style.width','100%','style.height','100%');
mymess="<font face='Tahoma' size='2' color='#FF0000'><span lang='fa'>&#1604;&#1591;&#1601;&#1575; &#1705;&#1605;&#1740; &#1589;&#1576;&#1585;&#1705;&#1606;&#1740;&#1583;</span></font>";
fndo('./selectdars.php','dat=wwww' ,'layer1','G',mymess);
}


function mstart()
{
  
  if(i<=10)  
  {  
   j=i*9/10;
   FP_changeProp(/*id*/'layer1',0,'style.filter','alpha(opacity='+i*9+')');
   FP_changeProp(/*id*/'layer1',0,'style.opacity',j);
   i++;
   t=setTimeout('mstart()',0.01); 
  }
  else
  {
  i=1;
  
  }
  
}

function FP_setLayerText(id,txt) {//v1.0
 var d=document,el=FP_getObjectByID(id);		
 if(el.innerHTML)el.innerHTML=txt; 
}

function FP_getObjectByID(id,o) {//v1.0
 var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
 else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
 if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
 for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
 f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
 for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
 return null;
}

function FP_changeProp() {//v1.0
 var args=arguments,d=document,i,j,id=args[0],o=FP_getObjectByID(id),s,ao,v,x;
 d.$cpe=new Array(); if(o) for(i=2; i<args.length; i+=2) { v=args[i+1]; s="o"; 
 ao=args[i].split("."); for(j=0; j<ao.length; j++) { s+="."+ao[j]; if(null==eval(s)) { 
  s=null; break; } } x=new Object; x.o=o; x.n=new Array(); x.v=new Array();
 x.n[x.n.length]=s; eval("x.v[x.v.length]="+s); d.$cpe[d.$cpe.length]=x;
 if(s) eval(s+"=v"); }
}



function customize(url,mwidth,mheight)
   {    
    
   var op_heigh =mheight;                 
   var option = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width="+mwidth+" , height="+ op_heigh;
   var win3 = window.open("", "what_I_want", option);  
   var win4 = window.open(url, "what_I_want");
   }

function gotodars(adr)
{
var x=document.getElementById('combo1').value;
x=adr+x;
//alert(x);
//window.open(x,'','','');
mymess="<font face='Tahoma' size='2' color='#FF0000'><span lang='fa'>&#1604;&#1591;&#1601;&#1575; &#1705;&#1605;&#1740; &#1589;&#1576;&#1585;&#1705;&#1606;&#1740;&#1583;</span></font>";
fndo(x,'dat=wwww' ,'layer1','G',mymess);
}




function backtopaygah()
{


mymess="<font face='Tahoma' size='2' color='#FF0000'><span lang='fa'>&#1604;&#1591;&#1601;&#1575; &#1705;&#1605;&#1740; &#1589;&#1576;&#1585;&#1705;&#1606;&#1740;&#1583;</span></font>";
fndo('./selectdars.php','dat=wwww' ,'layer1','G',mymess);
}

function closew()
{
window.close();
}



function answers(url)
{
FP_changeProp(/*id*/'layer1',0,'style.filter','alpha(opacity=90)');
FP_changeProp(/*id*/'layer1',0,'style.opacity',0.9);
FP_changeProp(/*id*/'layer1',0,'style.left','0','style.top','0');FP_changeProp(/*id*/'layer1',0,'style.width','100%','style.height','100%');
mymess="<font face='Tahoma' size='2' color='#FF0000'><span lang='fa'>&#1604;&#1591;&#1601;&#1575; &#1705;&#1605;&#1740; &#1589;&#1576;&#1585;&#1705;&#1606;&#1740;&#1583;</span></font>";
fndo(url,'dat=wwww' ,'layer1','G',mymess);
}



