function addBookmark(title, url) {
	if (jQuery.browser.mozilla ) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} else if( jQuery.browser.msie ) { // IE Favorite
		window.external.AddFavorite( url, title); 
	} else {
		   alert("Sorry, your browser doesn't support this");
	}
}


function submitForm(formID, formValue) {
	$('#submitID').val(formValue);
	$(formID).submit();
	return false;
}

$(document).ready(function() {
	$('#sideSearch').click(function() {
		if ($(this).val() == 'Search:')
			$(this).val('');
	});
	$('#sideSearch').blur(function() {
		if ($(this).val() == '')
			$(this).val('Search:');
	});

	$(".pageForm input:not(.noEffect), .pageForm select, .pageForm textarea").not('.noEffect').focus(function () {
	         $(this).parent().addClass("focus");
	});
	$(".pageForm input:not(.noEffect), .pageForm select, .pageForm textarea").blur(function () {
	         $(this).parent().removeClass("focus");
	});

/*
	$('.pagemenu ul').geeAccordion({removeNonJsClass: 'nonJS',
									expandClass: 'expandedInternal',
									itemSelector: 'li.open:not(.expanded, .active)',
									actionSelector: 'a:first',
									contentSelector: 'ul.subpagemenu',
									closeOtherItems: true,
									speed: 500});
*/	
	
	$('.pagemenu li.open:not(.expanded, .active)').hoverIntent(function() {
			$(this).children('ul.subpagemenu').slideDown(500);
		}, function() {
			$(this).children('ul.subpagemenu').slideUp(500);
	});

	$('.currencyChange a').click(function() {
		$('.productCost').addClass('hidden');
		var currency = $(this).attr('href').replace('#','');

		$('.'+currency).removeClass('hidden');
		return false;
	});

		//$('#menu > ul > li').each(function(obj){
		//		registerJSHover(obj)
		//	});

		$('#menu > ul > li').mouseover(function(){
			$(this).addClass('jsHover');
		})
		$('#menu > ul > li').mouseout(function(){
			$(this).removeClass('jsHover');
		})


});

$(function(){
		var delay = 3500;
		var fadeTime = 500;

		var curr = 1;
		var isFading = false;

		function intFunc(){
			var prev = curr;
			curr++;
			if ($('#imageRotator img:nth-child(' + curr + ')').length == 0){
				curr = 1;
			}
			isFading = true;
			$('#imageRotator > img:nth-child(' + prev + ')').fadeOut(fadeTime, function(){
				$('#imageRotator > img:nth-child(' + curr + ')').fadeIn(fadeTime, function(){
						isFading = false;
				});
			});
		}
		var interval = window.setInterval(intFunc, delay);
})
