$(window).load(function(e) {

	$('#slider').orbit({
                animation: 'fade', //fade, horizontal-slide, vertical-slide
             animationSpeed: 800, //how fast animations are
             advanceSpeed: 4000, //if timer advance is enabled, time between transitions 
             startClockOnMouseOut: true, //if timer should restart on MouseOut
             startClockOnMouseOutAfter: 3000, //how long after mouseout timer should start again
             directionalNav: true, //manual advancing directional navs
             captions: true, //if has a title, will be placed at bottom
             captionAnimationSpeed: 800, //how quickly to animate in caption on load and between captioned and uncaptioned photos
             timer: true //if the circular timer is wanted
            
            });
			
			
			$('.storeimages').orbit({
             animation: 'horizontal-slide', //fade, horizontal-slide, vertical-slide
             animationSpeed: 800, //how fast animations are
             advanceSpeed: 2000, //if timer advance is enabled, time between transitions 
             startClockOnMouseOut: true, //if timer should restart on MouseOut
             startClockOnMouseOutAfter: 3000, //how long after mouseout timer should start again
             directionalNav: false, //manual advancing directional navs
             captions: true, //if has a title, will be placed at bottom
             captionAnimationSpeed: 800, //how quickly to animate in caption on load and between captioned and uncaptioned photos
             timer: true //if the circular timer is wanted
            
            });
			
			if($("#nav").bind('click', function(e){
				recordSessionEvent(2,"menu: "+e.target.title+" :URL: "+e.target.href);
			}));
			if($("#leftnav").bind('click', function(e){
				recordSessionEvent(3,""+e.target.title);
			}));
			$('#_bread a').bind('click', function(e){
				recordSessionEvent(4,""+e.target.href);
			});
			$('#_paginationBottom a').bind('click', function(e){
				recordSessionEvent(5,""+e.target.href);
			});
			$('#_paginationTop a').bind('click', function(e){
				recordSessionEvent(5,""+e.target.href);
			});
			$('#redboxLink').bind('click', function(e){
				recordSessionEvent(6,""+e.target.name);
			});
			$('#bt_register').bind('click', function(e){
				recordSessionEvent(11,"name: "+$("#signUpName").val()+" :email: "+$("#signUpMail").val());
			});
			$('#_mainImageRef').bind('click', function(e){
				recordSessionEvent(14,""+$(e.target).attr('href'));
			});
			recordSessionEvent(9,document.location.href);
			
        });
		function recordSessionEvent(webEventId, webEventValue) {
			var requestUrl ="/web-analytics.htm";
			try{
					$.post(requestUrl, { webEventId: webEventId,webEventValue:webEventValue}, function(data) {
				}, 'json');
			}catch (e) {
				alert(e);
			}
}
		function navigateToRedBox() {
			 document.location.href = "/bigredbox.htm";
		}

