	function getElementPosition(elemID){
		var offsetTrail = document.getElementById(elemID);
		var offsetLeft = 0;
		var offsetTop = 0;
		while (offsetTrail){
			offsetLeft += offsetTrail.offsetLeft;
			offsetTop += offsetTrail.offsetTop;
			offsetTrail = offsetTrail.offsetParent;
		}
		if (navigator.userAgent.indexOf('Mac') != -1 && typeof document.body.leftMargin != 'undefined'){
			offsetLeft += document.body.leftMargin;
			offsetTop += document.body.topMargin;
		}
		return {left:offsetLeft,top:offsetTop};
	}
		
var wait_alert = '<div align="center" style="text-align: center; padding-top: 10px;"><br /><br /><img src=/images/icons/21.gif><br /><br /><br /></div>';		

$('CatScroller1').addEvent('change',function(e) {
			e.stop();
			var thecat = $('CatScroller1').options[$('CatScroller1').selectedIndex].value;
			var show = $('pagesize').options[$('pagesize').selectedIndex].value;
			//alert(thecat);
			
			$('boxpage').innerHTML = wait_alert;		
		new Request.HTML({
			update: $('boxpage'), 
			onComplete: function(){
				window.scroll(0,getElementPosition('lineup').top);
			}
		}).get('/server/boxads_home.php?id='+thecat+'&show='+show+'');			
		
		return true;
		});

/*
$('pagesize').addEvent('change',function(e) {
			e.stop();
			var thecat = $('CatScroller1').options[$('CatScroller1').selectedIndex].value;
			var show = $('pagesize').options[$('pagesize').selectedIndex].value;
			//alert(thecat);
			$('boxpage').innerHTML = wait_alert;
			
		new Request.HTML({
			update: $('boxpage'), 
			onComplete: function(){
				window.scroll(0,getElementPosition('lineup').top);
			}
		}).get('/server/boxads_home.php?id='+thecat+'&show='+show+'');			
		
		return true;
		});

*/


$('brandScroller').addEvent('change',function(e) {
			e.stop();
			var thecat = $('brandScroller').options[$('brandScroller').selectedIndex].value;
			var show = $('pagesize').options[$('pagesize').selectedIndex].value;
			//alert(thecat);
			$('boxpage').innerHTML = wait_alert;
			
		new Request.HTML({
			update: $('boxpage'), 
			onComplete: function(){
				window.scroll(0,getElementPosition('lineup').top);
			}
		}).get('/server/boxads_home_brands.php?id='+thecat+'&show='+show+'');			
		
		return true;
		});

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


$('productsearch').addEvent('submit',function(e) {
	e.stop();
	if($('dopsearch').value == ''){
		alert('Search Required'); 
		$('dopsearch').focus();
		return false;
	}
	else{
		$('ploader').innerHTML = '<div style="padding-top: 25px;height:45px;background-color: #696969;color:white;">Searching.........Please wait for your search results.</div>';
		$('btnpsearch').disabled = true;
		$('btnpsearch').value = 'loading please wait...';
		
		//$('ploader').load('/server/response.php?action=str&find='+$('dopsearch').value+'');
		
		new Request.HTML({
			update: $('ploader'), 
			onComplete: function(){
				$('btnpsearch').disabled = false;
				$('btnpsearch').value = 'Search';
			}
		}).get('/server/response.php?action=str&find='+$('dopsearch').value+'');
		
		return false;
	}
});





$('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;
	}
});





$('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();
});*/