$(document).ready(function() {	
						   
	function gup( name ) {
		name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
		var regexS = "[\\?&]"+name+"=([^&#]*)";
		var regex = new RegExp( regexS );
		var results = regex.exec( window.location.href );
		if( results == null ) return "";
		else return results[1];
		}
	var urlpos = gup('pos');
	var urlerror = gup('Errors');
	if (urlpos == 'assistant') {
		$('#HMC').attr('id', 'vlink2');
	}
	else if (urlpos == 'receptionist') {
		$('.so_right').attr('id', 'vlink3');
	}
	$('#urlError').append(urlerror);
	$('input#email').attr('value', urlpos);	
	$("a, button").bind("focus",function(){if(this.blur)this.blur();});
	//Commented next line out as causing JS error on live site
	//$("#smallPostCodeSearchControl_txtPostCode").Watermark("Enter postcode");
	//$('img[@src$=.png]').ifixpng(); 
	$("#Accordian div.accordhead").click(function() {$(this).next("div.accordbody").slideToggle(400).siblings("div.accordbody").slideUp(500);});
	$("div.modwrap div.lastmod div.mod:gt(1)").css("margin-top","1em");	
	$("h3.sc1").click(function () {$("#Showcase1").show();$("#Showcase2,#Showcase3,#Showcase4").hide();});	
	$("h3.sc2").click(function () {$("#Showcase2").show();$("#Showcase1,#Showcase3,#Showcase4").hide();});	
	$("h3.sc3").click(function () {$("#Showcase4").show();$("#Showcase1,#Showcase2,#Showcase3").hide();});	
	$("h3.sc4").click(function () {$("#Showcase3").show();$("#Showcase1,#Showcase2,#Showcase4").hide();});	
	$('#Promofader').cycle({ fx:'fade', speed: 500, timeout: 5000});
	$('a.toggle').click(function() {var id = $(this).attr('id');$('#Faq' + id).toggle(1);return false;});
	$('a.show').click(function() {var id = $(this).attr('id');$('#info-' + id).toggle(1);return false;});
	$('#Hmclub .skipLinks li:first').before('<li><a href="/admin/hmclub/new-subscribers.aspx">Manage HM Club</a></li>');
	$('#SalonFinder').show();
	
});

