/* javascript for kingfisherprint.co.uk by stuart sillitoe / pulse8 2008 */



// on dom load
$(function()
{
	


	// open external links in new window
	$('a[@href^=http]').each(function()
	{
		$(this).attr('target', '_blank');
	});
	


	
	$('#populateDeliveryAddressLink').click(function()
	{
		// populateDeliveryAddress this is defined in the footer, and only printed in the /portal/ area...
		populateDeliveryAddress();
		$('#clearDeliveryAddressLink').show();
		$(this).hide();
	});
	
	$('#clearDeliveryAddressLink').click(function()
	{
		// clearDeliveryAddress is in the footer too.
		clearDeliveryAddress();
		$('#populateDeliveryAddressLink').show();
		$(this).hide();
	});
	

		
	// add required fields to estimate request form
	$('#jobRequestForm label.required').each(function()
	{
		$(this).append(' <span class="error">*</span>');
	});
	

	
	
	
	// h2s
	$('h2').each(function()
	{
		if ( $(this).attr('id') )
		{
			var theId = $(this).attr('id').replace(/text_/, '');
			var theText = $(this).text();
			$(this).text('', true);
			$(this).append('<img src="/images/text/text_' + theId + '.gif" alt="' + theText + '" />');
		}
	});
	
	
	
	
});