var iPub = {

 openPrivacyPolicy: function()
 {
  Swc.OpenPopup("Privacy Policy");
  $('divPopup').update($('privacypolicy').innerHTML);
 },

 openTermsConditions: function()
 {
  Swc.OpenPopup("Terms and Condition");
  $('divPopup').update($('termscondition').innerHTML);
 },
 
 submitFilterSearch: function() 
	{
		//Priority is given to the drop down list 
		//If no inn is selected from the drop dow, 
		//only then will the other search fields be taken into consideration
		if($F('PubUrl') != '0') {
			window.location.href = $F('PubUrl');
		}
		
		else {
			if($F('PostcodeTown') == '' || $F('PostcodeTown') == 'Enter town or postcode'){
				alert('Please enter a town or postcode, or select an inn from the list.');
				return;
//				$('PostcodeTown').value = 'any';
			}

			if($F('Distance') == '' || $F('Distance') == 'Any distance'){
				$('Distance').value='0';
			}
			
			var t = new Array();

			$$('input[type=checkbox]').each(function( n ){
				if(n.checked){
					t.push(n.identify())
					};
				})

			xajax_facilityFilter($F('PostcodeTown'),$F('Distance'), t);
		}
	}

}



//CONTROLLING EVENTS IN jQuery
$j(document).ready(function(){
 $j('.footeraera').wrapInner('<div class="footerBg"><div class="footerpad"></div></div>');

});







