function view(file)
{
	kid=window.open(file, '_blank', 'channelmode=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizeable=1,width='+500+',height='+500+',left=150,top=150');
}


 function get_http(){  
     var xmlhttp;  
   //  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {  
     //   try {  
     //        xmlhttp = new XMLHttpRequest();  
     //    } catch (e) {  
     //       xmlhttp = false;  
     //    }  
    // }  
	 
	  if (window.XMLHttpRequest) {
        try {
            xmlhttp = new XMLHttpRequest();  
        } catch (e){
			xmlhttp = false;  
		  }
    } else if (window.ActiveXObject) {
        try {
           xmlhttp = new ActiveXObject('Msxml2.XMLHTTP');
        } catch (e){
			xmlhttp = false;  
		  }
        try {
            xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
        } catch (e){
			xmlhttp = false;  
		  }
    }
     return xmlhttp;  
 }  




function lookup(text) {  
         // Получаем объект XMLHTTPRequest  
       if(!this.http){  
            this.http = get_http();  
            this.working = false;  
			
        }  
         // Запрос 
		 
		
				if (!this.working && this.http) {  
					 var http = this.http;  
					 var url="/wherebuy/script.php";  
					 if (text.length <2 ) return; 
					 url = url + "?text="+encodeURIComponent(text);  
					 this.http.open("GET", url, true);  
					 this.http.onreadystatechange = function() {  
						 if (http.readyState == 4) {  
						  if (http.status == 200) {
							 var aa=http.responseText;
							var j=document.getElementById('citycontent');
							 j.innerHTML =aa;
							 this.working = false;  
						  }
						  }else{  
							  var j=document.getElementById('citycontent');
							  j.innerHTML ="<span style='color:green'>Ведется обработка информации. Подождите несколько секунд..</span>";
						  }  
					}  
					 //this.working = true;  
					this.http.send(null);  
				 }  
				if(!this.http){  
					alert('Ошибка при создании XMLHTTP объекта!')  
				} 
			
    }  


function showcity()
{
	var j=document.getElementById('city');
	var jj=j.value;
	//alert(jj);
	var j2=document.getElementById('informbcgr');
	j2.style.visibility='visible'; 
	j2.style.display='block'; 
	
	lookup(jj);
}

function email(form) {
	var j=document.getElementById('emailcontent');
	
	
	var aaa=form['capt'].value;
	var aaa2=form['who'].value;
	

	//j.innerHTML =aaa;
	
	 // Получаем объект XMLHTTPRequest  
       if(!this.http){  
            this.http = get_http();  
            this.working = false;  
        }  
         // Запрос 
		 
		
				if (!this.working && this.http) {  
					 var http = this.http;  
					 var url="/contacts/script2.php";  
					 url = url + "?text="+encodeURIComponent(aaa)+ "&who="+encodeURIComponent(aaa2);  
					 this.http.open("GET", url, true);  
					 this.http.onreadystatechange = function() {  
						 if (http.readyState == 4) {  
						  if (http.status == 200) {
							 var aa=http.responseText;
							var j=document.getElementById('emailcontent');
							 j.innerHTML =aa;
							 this.working = false;  
						  }
						  }else{  
							  var j=document.getElementById('emailcontent');
							  j.innerHTML ="<span style='color:green'>Ведется обработка информации. Подождите несколько секунд..</span>";
						  }  
					}  
					 //this.working = true;  
					this.http.send(null);  
				 }  
				if(!this.http){  
					alert('Ошибка при создании XMLHTTP объекта!')  
				} 

	
	return false;
}

function sendemail(text) {

	var j2=document.getElementById('sendemail');
	j2.style.visibility='visible'; 
	j2.style.display='block'; 

	  // Получаем объект XMLHTTPRequest  
       if(!this.http){  
            this.http = get_http();  
            this.working = false;  
        }  
         // Запрос 
		 
		
				if (!this.working && this.http) {  
					 var http = this.http;  
					 var url="/contacts/script.php";  
					 url = url + "?text="+encodeURIComponent(text);  
					 this.http.open("GET", url, true);  
					 this.http.onreadystatechange = function() {  
						 if (http.readyState == 4) {  
						  if (http.status == 200) {
							 var aa=http.responseText;
							var j=document.getElementById('emailcontent');
							 j.innerHTML =aa;
							 this.working = false;  
						  }
						  }else{  
							  var j=document.getElementById('emailcontent');
							  j.innerHTML ="<span style='color:green'>Ведется обработка информации. Подождите несколько секунд..</span>";
						  }  
					}  
					 //this.working = true;  
					this.http.send(null);  
				 }  
				if(!this.http){  
					alert('Ошибка при создании XMLHTTP объекта!')  
				} 


}



function showserver(id1){
	
	var j2=document.getElementById('servers');
	j2.style.visibility='visible'; 
	j2.style.display='block'; 
	
	  // Получаем объект XMLHTTPRequest  
       if(!this.http){  
            this.http = get_http();  
            this.working = false;  
        }  
         // Запрос 
		 
		
				if (!this.working && this.http) {  
					 var http = this.http;  
					 var url="/price/showserver.php";  
					 
					 url = url + "?id="+encodeURIComponent(id1);  
					 this.http.open("GET", url, true);  
					 this.http.onreadystatechange = function() {  
						 if (http.readyState == 4) {  
						  if (http.status == 200) {
							 var aa=http.responseText;
							var j=document.getElementById('servercontent');
							 j.innerHTML =aa;
							 this.working = false;  
						  }
						  }else{  
							  var j=document.getElementById('servercontent');
							  j.innerHTML ="<span style='color:green'>Ведется обработка информации. Подождите несколько секунд..</span>";
						  }  
					}  
					 //this.working = true;  
					this.http.send(null);  
				 }  
				if(!this.http){  
					alert('Ошибка при создании XMLHTTP объекта!')  
				} 
}


function showlinia(id1){
	
	var j2=document.getElementById('linia');
	j2.style.visibility='visible'; 
	j2.style.display='block'; 
	
	  // Получаем объект XMLHTTPRequest  
       if(!this.http){  
            this.http = get_http();  
            this.working = false;  
        }  
         // Запрос 
		 
		
				if (!this.working && this.http) {  
					 var http = this.http;  
					 var url="/price/showlinia.php";  
					 
					 url = url + "?id="+encodeURIComponent(id1);  
					 this.http.open("GET", url, true);  
					 this.http.onreadystatechange = function() {  
						 if (http.readyState == 4) {  
						  if (http.status == 200) {
							 var aa=http.responseText;
							var j=document.getElementById('liniacontent');
							 j.innerHTML =aa;
							 this.working = false;  
						  }
						  }else{  
							  var j=document.getElementById('liniacontent');
							  j.innerHTML ="<span style='color:green'>Ведется обработка информации. Подождите несколько секунд..</span>";
						  }  
					}  
					 //this.working = true;  
					this.http.send(null);  
				 }  
				if(!this.http){  
					alert('Ошибка при создании XMLHTTP объекта!')  
				} 
}




function showbuy(id1){
	
	var j2=document.getElementById('buy');
	j2.style.visibility='visible'; 
	j2.style.display='block'; 
	
	  // Получаем объект XMLHTTPRequest  
       if(!this.http){  
            this.http = get_http();  
            this.working = false;  
        }  
         // Запрос 
		 
		
				if (!this.working && this.http) {  
					 var http = this.http;  
					 var url="/price/showbuy.php";  
					 
					 url = url + "?id="+encodeURIComponent(id1);  
					 this.http.open("GET", url, true);  
					 this.http.onreadystatechange = function() {  
						 if (http.readyState == 4) {  
						  if (http.status == 200) {
							 var aa=http.responseText;
							var j=document.getElementById('buycontent');
							 j.innerHTML =aa;
							 this.working = false;  
						  }
						  }else{  
							  var j=document.getElementById('buycontent');
							  j.innerHTML ="<span style='color:green'>Ведется обработка информации. Подождите несколько секунд..</span>";
						  }  
					}  
					 //this.working = true;  
					this.http.send(null);  
				 }  
				if(!this.http){  
					alert('Ошибка при создании XMLHTTP объекта!')  
				} 
}


function showappreq()
{
	var j=document.getElementById('line1');
	var jj=j.value;	

       if(!this.http){  
            this.http = get_http();  
            this.working = false;  
        }  

		 
		
				if (!this.working && this.http) {  
					 var http = this.http;  
					 var url="/appreq2/script.php";  
					 url = url + "?text="+encodeURIComponent(jj);  
					 this.http.open("GET", url, true);  
					 this.http.onreadystatechange = function() {  
						 if (http.readyState == 4) {  
						  if (http.status == 200) {
							 var aa=http.responseText;
							 
							var j=document.getElementById('arrpeqcontent');
							 j.innerHTML =aa;
							 this.working = false;  
						  }
						  }else{  
							  var j=document.getElementById('arrpeqcontent');
							  j.innerHTML ="<span style='color:green'>Ведется обработка информации. Подождите несколько секунд..</span>";
						  }  
					}  
					 //this.working = true;  
					this.http.send(null);  
				 }  
				if(!this.http){  
					alert('Ошибка при создании XMLHTTP объекта!')  
				} 
	
	
}



function showconfig()
{
	var j=document.getElementById('line1');
	var jj=j.value;	

       if(!this.http){  
            this.http = get_http();  
            this.working = false;  
        }  

		 
		
				if (!this.working && this.http) {  
					 var http = this.http;  
					 var url="/appreq/script.php";  
					 url = url + "?text="+encodeURIComponent(jj);  
					 this.http.open("GET", url, true);  
					 this.http.onreadystatechange = function() {  
						 if (http.readyState == 4) {  
						  if (http.status == 200) {
							 var aa=http.responseText;
							 
							var j=document.getElementById('arrpeqcontent');
							 j.innerHTML =aa;
							 this.working = false;  
						  }
						  }else{  
							  var j=document.getElementById('arrpeqcontent');
							  j.innerHTML ="<span style='color:green'>Ведется обработка информации. Подождите несколько секунд..</span>";
						  }  
					}  
					 //this.working = true;  
					this.http.send(null);  
				 }  
				if(!this.http){  
					alert('Ошибка при создании XMLHTTP объекта!')  
				} 
	
	
}


function showcontractorcity(){
	
	var j=document.getElementById('city');
	var jj=j.value;	
	var j5=document.getElementById('informbcgr');
	j5.style.visibility='visible'; 
	j5.style.display='block'; 

       if(!this.http){  
            this.http = get_http();  
            this.working = false;  
        }  

		 
		
				if (!this.working && this.http) {  
					 var http = this.http;  
					 var url="/contractors/script.php";  
					 url = url + "?text="+encodeURIComponent(jj);  
					 this.http.open("GET", url, true);  
					 this.http.onreadystatechange = function() {  
						 if (http.readyState == 4) {  
						  if (http.status == 200) {
							 var aa=http.responseText;
							 
							var j=document.getElementById('citycontent');
							 j.innerHTML =aa;
							 this.working = false;  
						  }
						  }else{  
							  var j=document.getElementById('citycontent');
							  j.innerHTML ="<span style='color:green'>Ведется обработка информации. Подождите несколько секунд..</span>";
						  }  
					}  
					 //this.working = true;  
					this.http.send(null);  
				 }  
				if(!this.http){  
					alert('Ошибка при создании XMLHTTP объекта!')  
				} 
	
	
}


function hidecity()
{
	var j2=document.getElementById('informbcgr');
	j2.style.visibility='hidden'; 
	j2.style.display='none'; 
	
}


function showdiv(div)
{
	var j2=document.getElementById(div);
	j2.style.visibility='visible'; 
	j2.style.display='block'; 
	
}

function hidediv(div)
{
	var j2=document.getElementById(div);
	j2.style.visibility='hidden'; 
	j2.style.display='none'; 
	
}