// JavaScript Document

$(document).ready(function(){
	
	$("#menu ul li").hover(function(){
			$(this).children("ul").show();
			$(this).children("a:first").addClass("hover");
	}, function(){
			$(this).children("ul").hide();
			$(this).children("a:first").removeClass("hover");
	   }
	);

	$.scrollTo.defaults.axis = 'xy'; 			
	//this one is important, many browsers don't reset scroll on refreshes
	$('div.pane').scrollTo( 0 );//reset all scrollable panes to (0,0)
	$.scrollTo( 0 );//reset the screen to (0,0)
	
	
	var $paneOptions = $('#pane-options');
	
	$('#slider a').click(function(){//only scroll horizontally
		var num  =  $(this).attr("id");
		var numArr = num.split("_");
		if(numArr[1]){
			num = numArr[1];
			$paneOptions.scrollTo( 'li.section:eq('+num+')', 500, { axis:'x' } );
			$('#slider a').removeClass("selected");
			$(this).addClass("selected");
		}
		//var index = $("#matix tr").index($(this).parent());
		//$("#left .product").hide();
		//$("#left .product:eq("+num+")").fadeIn("normal");
		
		//$("#catNum_"+num).click();
		
	});
						   
});


/* Returns true if user is using IE */

function isIE() {

  var ua = navigator.userAgent.toLowerCase();

  return ((ua.indexOf('msie') != -1) && (ua.indexOf('opera') == -1) && 

          (ua.indexOf('webtv') == -1) &&

          (location.href.indexOf('seenIEPage') == -1));

}



/* Creates a popup of specified url */

function popup(name, pg, width, height, scrollbars) {

	var popup = window.open(pg, name, "toolbar=0,scrollbars=" + scrollbars + ",location=0,statusbar=0," + 

									"menubar=0,resizable=0,width=" + width + ",height=" + height);

}



/** Show specified table row of specified table */

function showTblRow(tbl, row) {

	tbl = gEBI(tbl);

	for (i=0; i<tbl.rows.length; i++)

		tbl.rows[i].style.display='none';

	tbl.rows[row-1].style.display='';

}



