jQuery(document).ready(function(){

jQuery('#manufacturers_id').selectbox({debug: true});
jQuery('#searchSelectSort').selectbox({debug: true});
jQuery('#sortBy').selectbox({debug: true});
jQuery('#perPage').selectbox({debug: true});
jQuery('#rating').selectbox({debug: true});
jQuery('#newsTickerContent').innerfade({speed: 2000,timeout: 6000,type: 'sequence',containerheight: '20px'});
jQuery('.fade').innerfade({speed: 1000,timeout: 6000,type: 'random_start',containerheight: '1.5em'});
jQuery('.adi').innerfade({speed: 'slow',timeout: 5000,type: 'random',containerheight: '150px'});

jQuery("#latestProducts").easySlider({
	'controlsBefore':	'<p id="controls">',
	'controlsAfter':	'</p>',
	'auto': true, 
	'continuous': true,
  'speed': 1000,
  'pause': 3200, 
  'prevId': 'prevBtn',
  'nextId': 'nextBtn'
});

jQuery("#reviewsBox").easySlider({
	'controlsBefore':	'<p id="controls2">',
	'controlsAfter':	'</p>',
	'auto': false, 
	'continuous': true,
  'speed': 1000,
  'pause': 3200,
  'prevId': 'prevBtn2',
  'nextId': 'nextBtn2'
});

jQuery("#specialsBox").easySlider({
	'controlsBefore':	'<p id="controls3">',
	'controlsAfter':	'</p>',
	'auto': false, 
	'continuous': true,
  'speed': 1000,
  'pause': 3200,
  'prevId': 'prevBtn3',
  'nextId': 'nextBtn3'
});
		
$("a.menuPopup").fancybox({
  'zoomSpeedIn'			: 600,
  'zoomSpeedOut'		: 500,
  'easingIn'				: 'easeOutBack',
  'easingOut'				: 'easeInBack',
  'hideOnContentClick': false
});
    	
$("a.popupIframe").fancybox({
  'zoomSpeedIn'			: 600,
 	'zoomSpeedOut'		: 500,
  'easingIn'				: 'easeOutBack',
  'easingOut'				: 'easeInBack',
  'frameWidth'      : 800,
  'frameHeight'     : 500,
  'hideOnContentClick': false
});
    
		$("a.popupTracking").fancybox({
		'zoomSpeedIn'			: 600,
		'zoomSpeedOut'		: 500,
		'easingIn'				: 'easeOutBack',
		'easingOut'				: 'easeInBack',
		'frameWidth'      : 600,
		'frameHeight'     : 200,
		'hideOnContentClick': false
	});



});

     
this.imagePreview = function(){	
	/* CONFIG */
		
		xOffset = 5;
		yOffset = 10;
		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result
		
	/* END CONFIG */
	jQuery("a.boxFeatureImage").hover(function(e){
		this.t = this.title;
		this.title = "";	
		var c = (this.t != "") ? "<br/>" + this.t : "";
		jQuery("body").append("<p id='preview'><img src='"+ this.rel +"' alt='Image preview' /><span>"+ c +"</span></p>");								 
		jQuery("#preview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");						
    },
	function(){
		this.title = this.t;	
		jQuery("#preview").remove();
    });	
	jQuery("a.boxFeatureImage").mousemove(function(e){
		jQuery("#preview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};


// starting the script on page load
jQuery(document).ready(function(){
	imagePreview();
});

                jQuery(function() {
                jQuery('#tabsMenu').tabs();

});
