function getIEVersion() {
	var dataString = navigator.userAgent;
	var index = dataString.indexOf("MSIE");
	if (index == -1) return;
	return parseFloat(dataString.substring(index + 5));
}	

function nextEmail() {
	//   Reset the width
	$("#cluetip").width("258px");

	//   Reset the position
	var newLeft = parseInt($("#cluetip").css("left")) - 153;
	$("#cluetip").css("left", newLeft + "px");

	//   Load the content
	$("#cluetip-inner").load("email1.html", function() {
		//   Set event handlers for the new content
		$("a.cluetip-close").click(function() {
			//   Close the popup
			$("#cluetip-inner").empty();
			$("#cluetip").hide();
			return false;
		});

		$("#ttEmailFormButton").bind("click", function() {

			//   Load the content
			$("#cluetip-inner").load("includes/tooltip/email2.html", function() {

				//   Set event handlers for the new content
				$("a.cluetip-close").click(function() {
					//   Close the popup
					$("#cluetip-inner").empty();
					$("#cluetip").hide();
					return false;
				});
			});
			return false;
		});
	});
	return false;
}

function nextCart() {
	//   Reset the width
	$("#cluetip").width("258px");

	//   Reset the position
	var newLeft = parseInt($("#cluetip").css("left")) - 153;
	$("#cluetip").css("left", newLeft + "px");

	//   Load the content
	$("#cluetip-inner").load("includes/tooltip/addtocart.html", function() {
		//   Set event handlers for the new content
		$("a.cluetip-close").click(function() {
			//   Close the popup
			$("#cluetip-inner").empty();
			$("#cluetip").hide();
			return false;
		});
	});
	return false;
}

function emailForm(productName, prodUrl){

var subject = productName;
var body_message = "Link to the Product: " + prodUrl ;

var mailto_link = 'mailto:'+'?subject='+escape(subject)+'&body=' + escape(body_message);

win = window.open(mailto_link,'emailWindow');
if (win && win.open &&!win.closed) win.close();
} 

$(document).ready(function(){
//   Add corners to each tab container content region
	$.each($(".tabContainer").children().filter("div"), function(i, n) {
		if ($(n).css("background-image") != "none")
			$(n).addClass("hasBackground");
		$(n).after($(n).clone().addClass("tempTab").empty().prepend('<div class="corners"><div class="hd"><div class="c"></div></div><div class="bd"><div class="c"><div class="s"></div></div></div><div class="ft"><div class="c"></div></div></div>'));
		$(n).next().children().children(".bd").children().children().prepend($(n).children())
		$(n).next().removeClass("tempTab");
		$(n).remove();
	});


	//   Setup tab containers
	$('.tabContainer').tabs({ fxFade: true, fxSpeed: 'fast' });
	
	//   Email tooltip link
	$('a#ttEmailLink').cluetip({
		local: true,
		width: '105px',
		delay: 250
	});

	//   Print tooltip link
	$('a#ttPrintLink').cluetip({
		local: true,
		width: '105px',
		delay: 250
	});

	//   Add to Cart tooltip link
	$('input.ttCartButton').cluetip({
		local: true,
		width: '105px',
		delay: 250
	});

	$('a.load-local').cluetip({
		local: true,
		sticky: true,
		closeText: '<img src="images/buttons/x.gif" alt="" />',
		delay: 250
	});
	
	
	

});// end $(document).ready(function()