function DESemail(emailname,emailserver) {
	document.write("<a href='mailto:" + emailname + "@" + emailserver +"'>");
	document.write(emailname + "@" + emailserver); 
	document.write("</a>"); 
}


$(document).ready(function(){
	
	function openDest() {
		$(this).addClass("open");
		$("#dest_ul").slideDown("fast");
		$(this).blur();
		return false;
	}
	
	function hideDest() {
		$(this).removeClass("open");
		$("#dest_ul").slideUp("fast");
		$(this).blur();
		return false;
	}
	
	if (document.getElementById("dest_open")) {
		$("#dest_open").hoverIntent({
			sensitivity: 1,
			interval: 0,
			over: openDest,
			timeout: 6000,
			out: hideDest
		});
	}
	
	function openContentDest() {
		$(this).addClass("open");
		$("#content_dest_ul").slideDown("fast");
		$(this).blur();
		return false;
	}
	
	function hideContentDest() {
		$(this).removeClass("open");
		$("#content_dest_ul").slideUp("fast");
		$(this).blur();
		return false;
	}
	
	if (document.getElementById("content_dest_open")) {
		$("#content_dest_open").hoverIntent({
			sensitivity: 1,
			interval: 0,
			over: openContentDest,
			timeout: 6000,
			out: hideContentDest
		});
	}
	
	if (document.getElementById("product_details")) {
		jQuery('.jcarousel-skin-tango').jcarousel({
			scroll: 1,
			visible: 1
		});
	}
	
	$("#same_address").click(function(){
		if ($("#same_address").is(":checked"))
		{
			//show the hidden div
			$("#delivery_address_table").hide("fast");
		}
		else
		{	   
			//otherwise, hide it 
			$("#delivery_address_table").show("fast");
		}
	});
	
	$("input.btn").hover(
		function() { $(this).addClass('hovered'); },
		function() { $(this).removeClass('hovered'); }
	);
	
	$("input.def, textarea.def").focus( function() { $(this).addClass('focus'); });
	$("input.def, textarea.def").blur( function() { $(this).removeClass('focus'); });
	
	// focus on error messages
	/*
	if (document.getElementById("error_msg")) {
		var $target = $("#tandc");
		var targetOffset = $target.offset().top;
		$('html,body').animate({scrollTop: targetOffset}, 500);
		$("#error_msg").animate( { backgroundColor: '#FFDCDC' }, 750).animate( { backgroundColor: '#fff' }, 750);
		
		//$("input.error").animate( { backgroundColor: '#FFDCDC' }, 750).animate( { backgroundColor: '#fff' }, 750);
		//$("textarea.error").animate( { backgroundColor: '#FFDCDC' }, 750).animate( { backgroundColor: '#fff' }, 750);
	}
	*/
	
});
