function SetCountryNew(val)
{
	var BaseSitePath = $('#BaseSitePath').val();
	var urlpath = BaseSitePath+"/functions/setcountry.php";
	var getval  = 'q=' + val;
	
	$.ajax({
		url: urlpath,	
		type: "GET",
		data: getval,		
		cache: false,
		timeout: 20000,
		success: function (html) {				
			window.location.reload(true);
		}		
	});
}

function showSpLists(sptype){
	$("#sp_lst_"+sptype+"_load .loading").show();
	var BaseSitePath = $('#BaseSitePath').val();
	
	$.ajax({
		url: "sponsors_lists_show.php",	
		type: "GET",
		data: "sptype="+sptype,		
		cache: false,
		timeout: 20000,
		success: function (html) {				
			$("#sp_lst_"+sptype+"_load .loading").hide();		
			$("#yp_spnsr_list_"+sptype).html(html);
			// yp listing click
			var $loading = $("<img src='"+BaseSitePath+"/images/ajax-loader.gif' alt='loading' class='loading'>");
			$("#yp_spnsr_list_"+sptype+" li a").each(function() {
				var $dialog = $('<div></div>').append($loading.clone());
				var $link = $(this).one('click', function() {
					$dialog.load($link.attr('href') + ' #content').dialog({
						title: $link.attr('title'),
						width: 700,
						height: 400,
						resizable: false
					});
					
					$link.click(function() {
						$dialog.dialog('open');
						return false;
					});

					return false;
				});
			});
		}		
	});
}

$(document).ready(function() {

	//Default Tab Action
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content
	
	//On Click Tab Event
	$("ul.tabs li").click(function() {
		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});
	
	showSpLists("a");
	showSpLists("b");
	showSpLists("c");
	
	$("div.jMyCarousel1").jMyCarousel({
		visible: '990px',
		auto: true
	});
	
	$('div.vertical_scroller').SetScroller({
		velocity: 80,
		direction: 'vertical',
		onmouseover: 'pause',
		onmouseout:  'play'
	});		


});
