$(document).ready(function(){
	// Sets hover class to function in IE6
	$('#nav1 ul.tabs li').hover(function() {
		$(this).addClass('hover');
	}, function() {
		$(this).removeClass('hover');
	});
	// Product slider
	$(function() {
    $(".our_bestsellers").accessProducts({
        scrollSpeed: "slow"
    });	
	// Form hints
	//$("#content input").toggleVal();
	// Nav2
	$('#nav2 ul li div ul li:last-child').css({ border: "none"});
	$('#nav2 li').hover(
		function() {
		$(this).css({ background: "#be6916"}).children('div').css({ display: "block"});
			$myPosition = $(this).position().left; // Determine left position of li
			$myWidth = $(this).width(); // Determine width of li
			if($myPosition>700){ // Value at which submenu would exceed page width
				$(this).children('div').css({ 
					left:-(250-$myWidth), // Change left position of submenu
					background:'url(/images/bg_sub_menu.gif) no-repeat left top' // Change submenu background
					});
			}
		}, 
		function() {
		$(this).css({ background: "none"}).children('div').css({ display: "none"});
		});
	});
});

function popup(url, windowname, width, height, scrollable)
{
	var Win;
	Win = window.open(url,windowname,'resizable=yes,width=' + width + ',height=' + height + ',scrollbars=' + scrollable + ',left = 10,top = 10');		
	Win.focus();
}