
/****************************************************************************/
//common jscript functions
/****************************************************************************/



/*
page load function
Assumptions:	jquery included
				jquery UI included
				jquery cross slide included
				div id of imageSlider is on the page for the slider

/****************************************************************************/
 var imgs = [];

 $(document).ready(function() {
	getPics();

	$('#imageSlider').crossSlide({
	  speed: 15,
	  fade: 1
	}, imgs);



	var icons = {
		header: "ui-icon-circle-arrow-e",
		headerSelected: "ui-icon-circle-arrow-s"
	};


	$("#productAccordion").accordion({
		event: "mouseover",
		autoHeight: false,
		icons: icons
	});
	
  });




/*
image scroller - get all the pics on the page with class "imgSliderPic" and add them to the image array for the scroller to use.  Every second pic changes direction.
Assumptions:	jquery included
				div id of imageSlider is on the page
*/
function getPics ()
{
	var dir = "";
	$.each($(".imgSliderPic"), function(index, img){
		dir = "up";
		if ((index % 2) == 0)
		{
			dir = "down";
		}
//				alert("mod=" + (index % 2));
		imgs.push({ "src": $(img).attr("src"), "dir": dir });
//				alert(index +":"+$(img).attr("src"));
	});
}


/****************************************************************************/
