    function search_results(srch)
    {
		    JsHttpRequest.query(
	            'http://www.igun.com.ua/search.php', // backend
	            { 
					'srch':srch
	            }, 
	            function(result,errors) {           
	            	if (result['str']==undefined)
	            	{
	            		document.getElementById('values').innerHTML='';
	            	}
	            	else
	            	{
	            		document.getElementById('values').innerHTML = result['str'];
	            	}
	            },
	            false  // do not disable caching
	      		);  
    }
	
function search_click(id)
{
	document.location='http://www.igun.com.ua/detail/'+id+'/';
}

function ajj(val)
	{	
		if (val!='')
		{
		$.ajax({
   			 // the URL for the request
   			 url : 'http://www.igun.com.ua/test3.php',

   				 // whether this is a POST or GET request
  			 method : 'GET',
  			  
  			 
  			 data : { category : val },

  				  // the type of data we expect back
 			 dataType : 'text',

 			   // code to run if the request succeeds;
 				   // the response is passed to the function
    		 success : function(text) {
      			 $('#values').html($(text));
  				  }

			});}
	}
	
	function ajj_2()
	{	
			$('#values').html('');
	}
	
		function ajj_4(loc,phrase,search)
	{	
			top.location.href=loc;
		
			$.ajax({
   			 // the URL for the request
   			 url : 'http://www.igun.com.ua/test4.php',

  			  // the data to send 
   			 // (will be converted to a query string)
   			 data : { phrase_set : phrase, phrase_search : search },

   				 // whether this is a POST or GET request
  			  method : 'GET'
			})
			
	}
		
	function ajj_3(cat)
	{	
			$('#input').attr('value', cat);
			
	}
	
	        function buy_count(id) {
                   document.getElementById(id).innerHTML = '<form method=post action=\"http://www.igun.com.ua/new_cart.php\"><table width=100% border=0><tr><td><font color=#1f6e91 face=arial size=3><b>Количество:</b></font</td><td align=center><input type=hidden name=id value='+id+'><input type=text name=count value=1 style=\" font-family:Arial; font-size:16px; line-height:normal; padding:2px 0 0 5px; border:1px solid #1f6e91; width:30px; height:24px; vertical-align:top;\" autofocus> &nbsp;<input type=submit value=\"Купить\" style=\"font-family:Arial; font-size:14px; padding:0px 0 0 0px; width:100px; height:28px; vertical-align:top;\"></td></tr></table></form>';
   							 }
	
	
		
/*
$(document).ready(function() {
		$.ajax({
   			 // the URL for the request
   			 url : 'test1.php',

  			  // the data to send 
   			 // (will be converted to a query string)
   			 data : { country_id : 1 },

   				 // whether this is a POST or GET request
  			  method : 'GET',

  				  // the type of data we expect back
 			   dataType : 'text',

 			   // code to run if the request succeeds;
 				   // the response is passed to the function
    		success : function(text) {
      			 $('#text1').html($(text));
  				  }
		})
		
		function setfocus() {
			$('#input').focus()
						}
		
		setfocus();

				
	$('#text1').change(function(){
		$.ajax({
   			 // the URL for the request
   			 url : 'test2.php',

  			  // the data to send 
   			 // (will be converted to a query string)
   			 data : { category : $("#text1 :selected").html() },

   				 // whether this is a POST or GET request
  			  method : 'GET',

  				  // the type of data we expect back
 			   dataType : 'text',

 			   // code to run if the request succeeds;
 				   // the response is passed to the function
    		success : function(text) {
      			 $('#text2').html($(text));
  				  }

			});
		})
		
	
		
    
});*/
