function propergateformfeild(idname,valuetext){
	
	values = jQuery(idname).attr('value');

	if(values != valuetext && values == ''){
		jQuery(idname).attr('value',valuetext);
		jQuery(idname).click(function(){	
			jQuery(idname).attr('value','');
		});
	}

}

jQuery(document).ready(function(){

	propergateformfeild('#search input','search website');
	propergateformfeild('#posted-postcode','click here to search by postcode');
	propergateformfeild('#posted-surname','click here to search by surname');

	jQuery('#select_quantity button').hover(function(){

		jQuery(this).find('img').attr('src','/images/add_to_basket_black.gif');

	},function(){

		jQuery(this).find('img').attr('src','/images/select_quantity_button.jpg');

	});

	jQuery('.table_td_marg tr').hover(function(){

		jQuery(this).find('td').css('background','#EFEFEF');

	},function(){

		jQuery(this).find('td').css('background','#CCCCCC');

	});

	jQuery('.table_td_marg tr td').css('cursor','pointer');

	jQuery('.table_td_marg tr td').click(function(){

		table_link = jQuery(this).parent().find('td.link a').attr('href');
		window.location = table_link;

	});
		
	jQuery('#acc1.accordian').css('display','block');
	nam = jQuery('#nav a').length-=1;
	jQuery('#nav a').eq(0).css("padding-left","0px");
	jQuery('#nav a').eq(nam).css("border","0px");
	fam = jQuery('#footer_nav a').length-=1;
	jQuery('#footer_nav a').eq(0).css("padding-left","0px");
	jQuery('#footer_nav a').eq(fam).css("border","0px");

	jQuery('.accordian_title').hover(function(){

		jQuery(this).find('.off').show();
		jQuery(this).find('.on').hide();
			
	},function(){
			
		jQuery(this).find('.off').hide();
		jQuery(this).find('.on').show();

	});

	jQuery('.accordian_title').click(function(){
			
		jQuery('.off').hide();
		jQuery('.on').show();
		mvar  = jQuery(this).find('.acclink').html();
		jQuery(this).find('.off').show();
		jQuery(this).find('.on').hide();
		jQuery('.accordian').slideUp();
		jQuery(mvar).slideDown('slow');

	});

});