var html;
var optionGroups;

$(document).ready(function(){
	$('#dowidth, #doheight, #dowall, #dwidth').click(function(){
		$(this).val('');
		$(this).unbind('click');
	});
	
	optionGroups = $('.swatches').size();
	
	$('.swatches li img').hover(function(){
		if($(this).parent().parent().find('.swatchLarge').find('img').size() > 0)$(this).parent().parent().find('.swatchLarge').show();
	},function(){
		$(this).parent().parent().find('.swatchLarge').hide();
	});
});

function yesno(val){
	switch(val){
	case 0:
		$('.no').fadeOut(function(){
			$('.yess').fadeIn();
		});
	break;
	case 1:
		$('.yess').fadeOut(function(){
			$('.no').fadeIn();
		});
	break;
	}
}

function displayWarning(){
	html = $('#customise #action').html();
	$('#customise #action').html('Non-Standard dimensions requested <a href="" onclick="tooltipShow(\'outOfRange\');return false;">More Info</a>');
}

function hideWarning(){
		$('#customise #action').html(html);

}

function tooltipShow(id)
{
	//var div = document.getElementById(id);
	var div = $('.'+id);
	
	if(div.size() != 0)
	{
		//div.style.display = 'block';
		$(div).fadeIn(function(){
			window.location.href="#error";
		});
		
	}
}

function tooltipHide(id)
{
	//var div = document.getElementById(id);
	var div = $('.'+id);
	
	if(div.size() != 0)
	{
		//div.style.display = 'none';
		$(div).fadeOut();
	}
}

