/* 
-------------------------------------------------------- 
Fire when document is ready...
-------------------------------------------------------- 
*/

//alert(this.location.href);
$(function(){
	
//	$.getScript("js/jquery.jcalendar.js");	
	
	var obj = null;
	
	// stop side menu logo jumping up and down when the menu expands
	$('#nav').css({height : '430px'});
		
	$gallerylinks = $('#gallery a');
	if ($gallerylinks.size()!=0)
	{
		$gallerylinks.lightBox({
			imageBtnClose: 'images/lightbox/close.gif',
			imageBtnPrev: 'images/lightbox/prev.gif',
			imageBtnNext: 'images/lightbox/next.gif'
		});
	}
	
	$("ul.subMenu").hide();
	
	$('#nav>li').each(function(){
		var $navtop = $(this);
		if ($navtop.find('a.current').size()!=0) {
			$('ul.subMenu', $navtop).slideDown(500);
		}
	});
	
	// clear default message for search box...
	obj = $('#keywords');
	if (obj.size()>0) {
		obj.focus(function(){
			var oSearchBox = $(this);
			if (oSearchBox.attr('value')==oSearchBox.attr('alt')) {
				oSearchBox.val('');
			}
		});
	}
	// tiger stripe tables...
	$('table.tiger-stripe tr:even').addClass('odd');
	
	// shop...
	obj = $('div.sub-category');
	if (obj.size()>0) {
		$(obj).hover(function(){
			$(this).find('a.title').addClass('title-hover');
		},
		function(){
			$(this).find('a.title').removeClass('title-hover');
		});
	}
	
	obj = $('div.sub-similar');
	if (obj.size()>0) {
		$(obj).hover(function(){
			$(this).find('a.title').addClass('title-hover');
		},
		function(){
			$(this).find('a.title').removeClass('title-hover');
		});
	}
	
});


/*
-------------------------------------------------------- 
KeepSessionAlive [v2.0]
-------------------------------------------------------- 
*/
function KeepSessionAlive() {
	// prevent session from server timeout...
	//var sTimeoutUrl = '<<domain>>w_Timeout.Home';
	$.get(sTimeoutUrl);
	KeepSessionAliveTimer = setTimeout("KeepSessionAlive()", 10 * 60000);
}


