// The following will run as soon as the page is loaded and the DOM is ready, but images might still be loading.
$(function(){	 







//$(".header").corner("top");
$(".prodItem:nth-child(3)").addClass("noPad");

$("#discover .prodItem:nth-child(2)").addClass("noPad");

$("#asButton").click(function() {
		$("#aSearch").fadeIn();
		// return false to stop default link action
		return false;
	});
$("#ssButton").click(function() {
		$("#aSearch").fadeOut();
		// return false to stop default link action
		return false;
	});




$('#asEdin').click(function(){
        $searchterm = $('#ajaxSearch_input2').val();
		top.location.href = "http://edinburghbrand.com/search_this_site.aspx?terms=" + $searchterm;	
		return false;
      })
$('#asGlasgow').click(function(){
        $searchterm = $('#ajaxSearch_input2').val();
		top.location.href = "http://www.google.com/search?hl=en&safe=off&q=[ " + $searchterm + " site:seeglasgow.com ]";	
		return false;
      })



$("div#accordion").accordion({ collapsible: true , active: -1 });



$("table").tablesorter(); 

$("#trigger-name-asc").click(function() {
		// set sorting column and direction, this will sort on the first and third column the column index starts at zero
		var sorting = [ [1,0] ];
		// sort on the first column
		$("table").trigger("sorton",[sorting]);
		// return false to stop default link action
		return false;
	});
$("#trigger-name-desc").click(function() {
		// set sorting column and direction, this will sort on the first and third column the column index starts at zero
		var sorting = [ [1,1] ];
		// sort on the first column
		$("table").trigger("sorton",[sorting]);
		// return false to stop default link action
		return false;
	});
$("#trigger-org-asc").click(function() {
		// set sorting column and direction, this will sort on the first and third column the column index starts at zero
		var sorting = [ [2,0] ];
		// sort on the first column
		$("table").trigger("sorton",[sorting]);
		// return false to stop default link action
		return false;
	});
$("#trigger-org-desc").click(function() {
		// set sorting column and direction, this will sort on the first and third column the column index starts at zero
		var sorting = [ [2,1] ];
		// sort on the first column
		$("table").trigger("sorton",[sorting]);
		// return false to stop default link action
		return false;
	});
$("#trigger-date-asc").click(function() {
		// set sorting column and direction, this will sort on the first and third column the column index starts at zero
		var sorting = [ [3,0] ];
		// sort on the first column
		$("table").trigger("sorton",[sorting]);
		// return false to stop default link action
		return false;
	});
$("#trigger-date-desc").click(function() {
		// set sorting column and direction, this will sort on the first and third column the column index starts at zero
		var sorting = [ [3,1] ];
		// sort on the first column
		$("table").trigger("sorton",[sorting]);
		// return false to stop default link action
		return false;
	});
$('ul.quickNav li ul li:even').addClass("alt");

$("img.menu_head").click(function () {
$("ul.quickNav").slideToggle();
});

$('ul.quickNav li a').mouseover(function () {
	$(this).animate({ paddingLeft: "11px" }, 50 );
});
$('ul.quickNav li a').mouseout(function () {
	$(this).animate({ paddingLeft: "7px" }, 50 );
});
$('ul.quickNav li a').click(function () {
	$("ul.quickNav").slideToggle();
});

});


