/*
$('aloader').innerHTML = '<p align="center"><img src="/images/icons/handpoint.gif" alt="searching" title="searching" /> Product Search Results returned here</p>';

$('librarysearch').addEvent('submit',function(e) {
	e.stop();
	
			if($('librarysearchselect').selectedIndex == 0){
				alert('Please Select Search Category');
				$('librarysearchselect').focus();
				return false;
			}
	
	if($('librarysearchtext').value == ''){
		alert('Please enter your keyword(s) to Search for..'); 
		$('librarysearchtext').focus();
		return false;
	}
	else{
		$('aloader').innerHTML = '<div style="padding-top: 25px;height:45px;background-color: #696969;color:white;">Searching.........Please wait for your search results.</div>';
		$('librarysearchbtn').disabled = true;
		$('librarysearchbtn').value = 'loading please wait...';
		
		//$('aloader').load('/server/response.php?action=str&find='+$('librarysearchtext').value+'');
		
		new Request.HTML({
			update: $('aloader'), 
			onComplete: function(){
		$('librarysearchbtn').disabled = false;
		$('librarysearchbtn').value = 'Search';			
			}
		}).get('/server/response.php?action='+$('librarysearchselect').value+'&find='+$('librarysearchtext').value+'');
		
		return false;
	}
});
*/
$('aloader').innerHTML = '<div style="padding-top: 25px;height:110px;background-color: #696969;color:white;"><br /><strong>Please enter your search keyword(s) above...</strong></div>';
var wait_alert = '<div align="center" style="text-align: center; padding-top: 10px;"><br /><br /><img src=/images/icons/loading.gif><br /><br /><br /></div>';
	$('librarysearch').onchange = function(){
				
	if($('librarysearchselect').selectedIndex == 0){
				alert('Please Select Search Category');
				$('librarysearchselect').focus();
				return false;
			}
	
	if($('librarysearchtext').value == ''){
		alert('Please enter your keyword(s) to Search for..'); 
		$('librarysearchtext').focus();
		return false;
	}
	else{
$('aloader').innerHTML = wait_alert;
		$('librarysearchbtn').disabled = true;
		$('librarysearchbtn').value = 'loading please wait...';
		
		//$('aloader').load('/server/response.php?action=str&find='+$('librarysearchtext').value+'');

			new Ajax('/server/response.php?action='+$('librarysearchselect').value+'&find='+$('librarysearchtext').value+'',{
				evalScripts: true,
				postBody: str,
				onRequest: function(){
				},
				onComplete: function(req){
				$('aloader').innerHTML = req;
				$('librarysearchbtn').disabled = false;
				$('librarysearchbtn').value = 'Search';			
				}			
			
			}).request();
			
		return true;
		}};



/*
$('typsch').addEvent('click',function(e) {
	e.stop();
	
	if($('party').value == ''){
		alert('Num traveling in your Party is Required'); 
		$('party').focus();
		return false;
	}
	else{
		$('typsch_rslts').innerHTML = '<div style="padding-top: 25px;height:45px;background-color: #696969;color:white;">Searching.........Please wait for your search results.</div>';
		$('typsch').disabled = true;
		$('typsch').value = 'loading please wait...';
		
		//$('typsch_rslts').load('/server/response.php?action=str&find='+$('librarysearchtext').value+'');
		
		new Request.HTML({
			update: $('typsch_rslts'), 
			onComplete: function(){
		$('typsch').disabled = false;
		$('typsch').value = 'Go';			
			}
		}).get('/server/vacations_search_by_Country.php?ctry='+$('ctry').options[$('ctry').selectedIndex].value+'&party='+$('party').value+'&min='+$('min').value+'&max='+$('max').value+'&rmtype='+$('rmtype').options[$('rmtype').selectedIndex].value+'');
		
		return false;
	}
});



$('realtytsch').addEvent('click',function(e) {

		$('realtysch_rslts').innerHTML = '<div style="padding-top: 25px;height:45px;background-color: #696969;color:white;">Searching.........Please wait for your search results.</div>';
		$('realtytsch').disabled = true;
		$('realtytsch').value = 'loading please wait...';
		
		//$('realtysch_rslts').load('/server/response.php?action=str&find='+$('dopsearch').value+'');
		
		new Request.HTML({
			update: $('realtysch_rslts'), 
			onComplete: function(){
				$('realtytsch').disabled = false;
				$('realtytsch').value = 'Search';
			}
		}).get('/server/search_realty.php?Category='+$('RealtyCategory').options[$('RealtyCategory').selectedIndex].value+'&country='+$('Realtycountry').options[$('Realtycountry').selectedIndex].value+'&bathrooms='+$('Realtybathrooms').options[$('Realtybathrooms').selectedIndex].value+'&bedrooms='+$('Realtybedrooms').options[$('Realtybedrooms').selectedIndex].value+'&price='+$('Rentprice').options[$('Realtyprice').selectedIndex].value+'&area='+$('Realtyarea').value+''));
		
		return false;
	}
});




		
$('rentsch').addEvent('click',function(e) {

		$('rentsch_rslts').innerHTML = '<div style="padding-top: 25px;height:45px;background-color: #696969;color:white;">Searching.........Please wait for your search results.</div>';
		$('rentsch').disabled = true;
		$('rentsch').value = 'loading please wait...';
		
		//$('rentsch_rslts').load('/server/response.php?action=str&find='+$('dopsearch').value+'');
		
		new Request.HTML({
			update: $('rentsch_rslts'), 
			onComplete: function(){
				$('rentsch').disabled = false;
				$('rentsch').value = 'Search';
			}
		}).get('/server/search_rentals.php?Category='+$('RentCategory').options[$('RentCategory').selectedIndex].value+'&country='+$('Rentcountry').options[$('Rentcountry').selectedIndex].value+'&bathrooms='+$('Rentbathrooms').options[$('Rentbathrooms').selectedIndex].value+'&bedrooms='+$('Rentbedrooms').options[$('Rentbedrooms').selectedIndex].value+'&price='+$('Rentprice').options[$('Rentprice').selectedIndex].value+'&rntype='+$('Rentrntype').options[$('Rentrntype').selectedIndex].value+'&area='+$('Rentarea').value+'');
		
		return false;
	}
});


*/




/*
var librarysearch = {
	start : function() {
		//$('aloader').innerHTML = '<p align="center"><img src="/images/icons/handpoint.gif" alt="searching" title="searching" /> Library Search Results returned here</p>';
		$('ploader').innerHTML = '<p align="center"><img src="/images/icons/handpoint.gif" alt="searching" title="searching" /> Product Search Results returned here</p>';
		$('typsch_rslts').innerHTML = '<p align="center"><img src="/images/icons/handpoint.gif" alt="searching" title="searching" /> Search Results for rooms returned here</p>';
		$('rentsch_rslts').innerHTML = '<p align="center"><img src="/images/icons/handpoint.gif" alt="searching" title="searching" /> Search Results for rooms returned here</p>';
		$('realtysch_rslts').innerHTML = '<p align="center"><img src="/images/icons/handpoint.gif" alt="searching" title="searching" /> Search Results for rooms returned here</p>';

		$('librarysearch').onsubmit = function() {
			if($('librarysearchselect').selectedIndex == 0){
				alert('Please Select Search Type');
				$('librarysearchselect').focus();
				return false;
			}
			if($('librarysearchtext').value == ''){
				alert('Search Required'); 
				$('librarysearchtext').focus();
				return false;
			}
			$('aloader').innerHTML = '<div style="padding-top: 25px;height:45px;background-color: #696969;color:white;">Searching.........Please wait for your search results.</div>';
			//var myCall = new Ajax ('/server/response.php', {evalScripts: true, postBody: 'action='+$('librarysearchselect').value+'&find='+$('librarysearchtext').value+'', update: $('aloader'), onComplete: librarysearch.run});
			//myCall.request();
			
		
			
			
			$('librarysearchbtn').disabled = true;
			$('librarysearchbtn').value = 'loading please wait...';
			return false;
};

$('productsearch').onsubmit = function() {
	if($('dopsearch').value == ''){
		alert('Search Required'); 
		$('dopsearch').focus();
		return false;
	}
	$('ploader').innerHTML = '<div style="padding-top: 25px;height:45px;background-color: #696969;color:white;">Searching.........Please wait for your search results.</div>';
			//var myCall = new Ajax ('/server/response.php', {evalScripts: true, postBody: 'action=str&find='+$('dopsearch').value+'', update: $('ploader'), onComplete: librarysearch.run2});
			//myCall.request();
		
		new Request.HTML({
			update: $('ploader'), 
			onComplete: librarysearch.run
		}).get('/server/response.php?action=str&find='+$('dopsearch').value+'');
			
			$('btnpsearch').disabled = true;
			$('btnpsearch').value = 'loading please wait...';
			return false;
		}
	},
	run : function() {
		$('librarysearchbtn').disabled = false;
		$('librarysearchbtn').value = 'Search';
	},
	run2 : function() {
		$('btnpsearch').disabled = false;
		$('btnpsearch').value = 'Search';
	}
};
//window.onDomReady(librarysearch.start);
window.addEvent('domready', function() {
	//librarysearch.start();
});*/