	//-----------------------------------------------------------------------
	function loadOfferSubTypeList( offer_type_id )
	{
		output		=	"text";
		url			=	"/?act=getofferlist&offer_type_id="+offer_type_id;
		responseHandler	=	"processEventResponseOfferList";
		ajaxPostRequest(url, "");		
		return false;
	}
	//-----------------------------------------------------------------------
	function processEventResponseOfferList(responseText)
	{
		document.getElementById('hidden_offer_sub_type_list').style.display = "";
		document.getElementById('offer_sub_type_list').style.display = "none";
		document.getElementById('hidden_offer_sub_type_list').innerHTML = responseText;
		return false;
	}
	//-----------------------------------------------------------------------
	function loadCityList( country_code , sel_city)
	{
		output		=	"text";
		url			=	"/?act=getCity&country_code="+country_code+"&location_city="+sel_city;
		responseHandler	=	"processEventResponseCityList";
		ajaxPostRequest(url, "");		
		return false;
	}
	//-----------------------------------------------------------------------
	function processEventResponseCityList(responseText)
	{
		document.getElementById('hidden_city_list').style.display = "";
		document.getElementById('city_list').style.display = "none";
		document.getElementById('hidden_city_list').innerHTML = responseText;
		loadCardTypeList();
		return false;
	}
	//-----------------------------------------------------------------------
	function loadCardTypeList()
	{
		//var country_code = document.getElementById('country').value;
		var country_code = document.frm.country.value;
		var sel_card_type = document.frm.hidden_card_type_id.value;
		output		=	"text";
		url			=	"/?act=getCardType&country_code="+country_code+"&sel_card_type="+sel_card_type;
		responseHandler	=	"processEventResponseCardTypeList";
		ajaxPostRequest(url, "");		
		return false;
	}
	//-----------------------------------------------------------------------
	function processEventResponseCardTypeList(responseText)
	{
		document.getElementById('hidden_card_type_list').style.display = "";
		document.getElementById('card_type_list').style.display = "none";
		document.getElementById('hidden_card_type_list').innerHTML = responseText;
		return false;
	}
	//-----------------------------------------------------------------------
	function filterSearchCategory(offer_type_id)
	{
		document.getElementById('filter_offer_type_id').value = offer_type_id;
		$("#testSubmit").click();
	}
	//-----------------------------------------------------------------------
	function filterSearchCountryAddl(country_code)
	{
		document.getElementById('filter_country').value = country_code;
		$("#testSubmit").click();
	}
	//-----------------------------------------------------------------------
	function filterSearchCountry(country_code , country_name)
	{
		document.getElementById('filter_country_code').value = country_code;
		document.getElementById('filter_country_name').value = country_name;
		filterMostSearched();
	}
	//-----------------------------------------------------------------------
	function filterMostSearched(offer_sub_type_id , offer_sub_type_name)
	{
		var offer_type_id = document.getElementById('filter_offer_type_id').value;
		var country_code = document.getElementById('filter_country_code').value;
		var country_name = document.getElementById('filter_country_name').value;
		if(offer_sub_type_id != "0" && offer_sub_type_id != undefined)
		{
			var offer_type_name = document.getElementById('filter_offer_type_name').value;
			var bread_crumb_cont = "";
			
			document.getElementById('filter_offer_sub_type_id').value = offer_sub_type_id;
			if (country_code != "global")
			{
				bread_crumb_cont = "<a href='/"+country_code+"/'>Home ("+country_name+")</a> &nbsp;&gt;&nbsp; <a href='/"+country_code+"/offer-types/"+offer_type_id+"/"+offer_type_name+"'>"+offer_type_name+"</a> &nbsp;&gt;&nbsp; "+offer_sub_type_name;
			}
			else
			{
				bread_crumb_cont = "<a href='/'>Home</a> &nbsp;&gt;&nbsp; <a href='/offer-types/"+offer_type_id+"/"+offer_type_name+"'>"+offer_type_name+"</a> &nbsp;&gt;&nbsp; "+offer_sub_type_name;
			}
			document.getElementById('bread_crumb_cont').innerHTML = bread_crumb_cont;
			output		=	"text";
			url			=	"/offer-types/?act=mostsearched&offer_sub_type_id="+offer_sub_type_id+"&country="+country_code;
			responseHandler	=	"processEventResponseMostSearched";
			ajaxPostRequest(url, "");		
			return false;
		}
		else
		{
			var offer_type_name = document.getElementById('filter_offer_type_name').value;
			var bread_crumb_cont = "";
			if (country_code != "global")
			{
				bread_crumb_cont = "<a href='/"+country_code+"/'>Home ("+country_name+")</a> &nbsp;&gt;&nbsp; "+offer_type_name;
			}
			else
			{
				bread_crumb_cont = "<a href='/'>Home</a> &nbsp;&gt;&nbsp; "+offer_type_name;
			}

			document.getElementById('bread_crumb_cont').innerHTML = bread_crumb_cont;
			output		=	"text";
			url			=	"/offer-types/?act=mostsearched&offer_type_id="+offer_type_id+"&country="+country_code;
			responseHandler	=	"processEventResponseMostSearchedAll";
			ajaxPostRequest(url, "");		
			return false;
		}
	}
	//-----------------------------------------------------------------------
	function processEventResponseMostSearched(responseText)
	{
		document.getElementById('most_searched_offers_cont').innerHTML = responseText;
		filterRecentOffers();
	}
	//-----------------------------------------------------------------------
	function processEventResponseMostSearchedAll(responseText)
	{
		document.getElementById('most_searched_offers_cont').innerHTML = responseText;
		filterRecentOffersAll();
	}
	//-----------------------------------------------------------------------
	function filterRecentOffers()
	{
		var offer_sub_type_id = document.getElementById('filter_offer_sub_type_id').value
		var country_code = document.getElementById('filter_country_code').value;
		output		=	"text";
		url			=	"/offer-types/?act=recentoffers&offer_sub_type_id="+offer_sub_type_id+"&country_code="+country_code;
		responseHandler	=	"processEventResponseRecentOffers";
		ajaxPostRequest(url, "");		
		return false;
	}
	//-----------------------------------------------------------------------
	function filterRecentOffersAll()
	{
		var offer_type_id = document.getElementById('filter_offer_type_id').value
		var country_code = document.getElementById('filter_country_code').value;
		output		=	"text";
		url			=	"/offer-types/?act=recentoffers&offer_type_id="+offer_type_id+"&country_code="+country_code;
		responseHandler	=	"processEventResponseRecentOffers";
		ajaxPostRequest(url, "");		
		return false;
	}
	//-----------------------------------------------------------------------
	function processEventResponseRecentOffers(responseText)
	{
		document.getElementById('recent_offers_cont').innerHTML = responseText;
		
	}
	//-----------------------------------------------------------------------
	function show(object1,object2)
	{
		obj1 = document.getElementById(object1);
		obj2 = document.getElementById(object2);

		if(obj1.style.display==''){
			obj1.style.display='none';
		}
		else{
			obj1.style.display='';
		}

		if(obj2.id=='rec_add' && obj1.style.display=='none'){
			obj2.src='/templates/default/images/rece_added_off.gif';
		}
		else if(obj2.id=='rec_add' && obj1.style.display==''){
			obj2.src='/templates/default/images/rece_added_on.gif';
		}
		else if(obj2.id=='rec_view' && obj1.style.display=='none'){
			obj2.src='/templates/default/images/rece_viewed_off.gif';
		}
		else{
			obj2.src='/templates/default/images/rece_viewed_on.gif';
		}
	}
	//------------------------------------------------------------------------------
	function ajaxPage(url,rh)
	{
		//alert("rh"+rh);
		//process		=	'loadResPage()';
		
		output		=	'text';
		responseHandler	=	rh;
		document.getElementById("body_cnt").innerHTML	=	"<div style='border:0px solid red;height:300px;valign:middle'><center><br ><br ><br ><br ><br ><br ><br ><br ><br ><br ><img src='/templates/default/images/loadingAnimation.gif'></center></div>";
		ajaxPostRequest(url, "");		
		return false;
	}
	//-----------------------------------------------------------------------
	function body_cnt(responseText)
	{
		document.getElementById('body_cnt').innerHTML = responseText;
		/*var noofrecords = document.getElementById("noofrecords").value;

		if( noofrecords == "0" )
		{
			initialize_region();
			return false;
		}
		else
		{
			initialize();
			return false;
		}*/
	}
	//-----------------------------------------------------------------------
	function change_position()
	{
		var agt=navigator.userAgent.toLowerCase();
		var suggestions_id=document.getElementById('suggestions');
		var city_suggestions_id=document.getElementById('city_suggestions');
		
		if (navigator.appName=="Microsoft Internet Explorer" && agt.indexOf('msie 6.0')!=-1)
		{
			suggestions_id.style.left='118px';
			suggestions_id.style.top='52px';
			city_suggestions_id.style.left='431px';
			city_suggestions_id.style.top='52px';
		}

		if (navigator.appName=="Microsoft Internet Explorer" && agt.indexOf('msie 7.0')!=-1)
		{

			suggestions_id.style.left='105px';
			suggestions_id.style.top='52px';
			city_suggestions_id.style.left='418px';
			city_suggestions_id.style.top='52px';
		}

		if (navigator.appName=="Netscape" && parseFloat(navigator.appVersion)>=4.7)
		{
			suggestions_id.style.left='118px';
			suggestions_id.style.top='50px';
			city_suggestions_id.style.left='431px';
			city_suggestions_id.style.top='50px';
		}

		/*if (navigator.appName=="Microsoft Internet Explorer" && agt.indexOf('msie 6.0')!=-1)
		{
			suggestions_id.style.left='118px';
			suggestions_id.style.top='52px';
			city_suggestions_id.style.left='431px';
			city_suggestions_id.style.top='52px';
		}

		if (navigator.appName=="Microsoft Internet Explorer" && agt.indexOf('msie 7.0')!=-1)
		{

			suggestions_id.style.left='105px';
			suggestions_id.style.top='52px';
			city_suggestions_id.style.left='418px';
			city_suggestions_id.style.top='52px';
		}

		if (navigator.appName=="Netscape" && parseFloat(navigator.appVersion)>=4.7)
		{
			suggestions_id.style.left='119px';
			suggestions_id.style.top='52px';
			city_suggestions_id.style.left='432px';
			city_suggestions_id.style.top='52px';
		}
		*/
	}
	//-----------------------------------------------------------------------
	function change_position1()
	{
		var agt=navigator.userAgent.toLowerCase();
		var suggestions_id=document.getElementById('suggestions');
		var city_suggestions_id=document.getElementById('city_suggestions');

		if (navigator.appName=="Microsoft Internet Explorer" && agt.indexOf('msie 6.0')!=-1)
		{
			suggestions_id.style.left='150px';
			suggestions_id.style.top='30px';
			suggestions_id.style.zIndex='100';
			suggestions_id.style.backgroundColor='#000000';
			suggestions_id.style.color='#FFFFFF';
			city_suggestions_id.style.left='490px';
			city_suggestions_id.style.top='30px';
		}

		if (navigator.appName=="Microsoft Internet Explorer" && agt.indexOf('msie 7.0')!=-1)
		{
			suggestions_id.style.left='120px';
			suggestions_id.style.top='30px';
			city_suggestions_id.style.left='459px';
			city_suggestions_id.style.top='30px';
		}

		if (navigator.appName=="Netscape" && parseFloat(navigator.appVersion)>=4.7)
		{
			suggestions_id.style.left='120px';
			suggestions_id.style.top='30px';
			city_suggestions_id.style.left='459px';
			city_suggestions_id.style.top='30px';
		}
	}
	//-----------------------------------------------------------------------
	function lookup(inputString) 
	{
		if(inputString.length == 0) {
			// Hide the suggestion box.
			$('#suggestions').hide();
		} else {

			var country_code = $('#country').val();
			$.post("/?act=getKeywords", {queryString: ""+inputString+"" , countryCode : ""+country_code+"" }, function(data){
				if(data == "No Records Found")
				{
				$('#suggestions').hide();
				}
				//if(data.length >0) {
				else{
					$('#suggestions').show();
					$('#autoSuggestionsList').html(data);
				}
			});
		}
	} // lookup
	//-----------------------------------------------------------------------

	function fill(thisValue) 
	{
		$('#keywords').val(thisValue);
		setTimeout("$('#suggestions').hide();", 200);
	}
	//-----------------------------------------------------------------------
	function citylookup(inputString) 
	{
		if(inputString.length == 0) {
			// Hide the suggestion box.
			$('#city_suggestions').hide();
		} else {
			var country_code = $('#country').val();
			$.post("/?act=getSearchCity", {queryString: ""+inputString+"" , countryCode : ""+country_code+"" }, function(data){
				if(data == "No Records Found")
				{
					$('#city_suggestions').hide();
				}
				//if(data.length >0) {
				else{
					$('#city_suggestions').show();
					$('#autoCitySuggestionsList').html(data);
				}
			});
		}
	} // lookup	
	//-----------------------------------------------------------------------
	function cityfill(thisValue) 
	{
		$('#location_city').val(thisValue);
		setTimeout("$('#city_suggestions').hide();", 200);
	}
	//-----------------------------------------------------------------------
	function validateRegistration(frm)
	{
		if ( isEmpty(frm.user_name) )
		{
			alert("Please enter your name");
			frm.user_name.focus();
			return false;
		}
		else if(!isAlpha1(frm.user_name))
		{
			alert("Please enter only alphabets");
			frm.user_name.focus();
			return false;
		}
		if ( isEmpty(frm.phone_no) )
		{
			alert("Please enter your phone number");
			frm.phone_no.focus();
			return false;
		}
		else if(!isNumeric(frm.phone_no))
		{
			alert("Please enter only numbers without any special characters or spaces");
			frm.phone_no.focus();
			return false;
		}
		if ( isEmpty(frm.cc_no) )
		{
			alert("Please enter the last four digits of your credit card number");
			frm.cc_no.focus();
			return false;
		}
		else if(!isNumeric(frm.cc_no))
		{
			alert("Please enter the card number without any special characters or spaces");
			frm.cc_no.focus();
			return false;
		}
		if ( isEmpty(frm.country_code) )
		{
			alert("Please select the country where the card has been issued");
			frm.country_code.focus();
			return false;
		}
	}
	//-----------------------------------------------------------------------
	function validateFeedback(frm)
	{
		if ( isEmpty(frm.user_name) )
		{
			alert("Please enter your name");
			frm.user_name.focus();
			return false;
		}
		else if(!isAlpha1(frm.user_name))
		{
			alert("Please enter only alphabets");
			frm.user_name.focus();
			return false;
		}
		if ( isEmpty(frm.phone_no) )
		{
			alert("Please enter your phone number");
			frm.phone_no.focus();
			return false;
		}
		else if(!isNumeric(frm.phone_no))
		{
			alert("Please enter only numbers without any special characters or spaces");
			frm.phone_no.focus();
			return false;
		}
		if ( isEmpty(frm.email) )
		{
			alert("Please enter your email");
			frm.email.focus();
			return false;
		}
		else if(!isEmail(frm.email))
		{
			alert("Please enter the valid email address");
			frm.email.focus();
			return false;
		}
		if ( isEmpty(frm.comment) )
		{
			alert("Please enter the feedback / comment");
			frm.comment.focus();
			return false;
		}
	}