
	$(document).ready(function(){

		var x = 0;
		
		$('.lightbox').lightBox();
		
		$(".productbox").each(function(i) { 
			
			
			if(x == 2) {
			
				$(this).addClass('nomarg');
				x = 0;
								
			} else x++;
			
		
		});
		
		$('#selectbrand-button').toggle(function() {
		
			$('#selectbrand-drop').slideDown(150);
		
		}, function() {
		
			$('#selectbrand-drop').slideUp(100);
		
		});
		
		$(".productbox").hover(function() {
		
			$(this).addClass('prodhover');
		
		}, function() {
		
			$(this).removeClass('prodhover');
		
		});
		
		$('#slider').cycle({ 
		    fx:     'fade', 
		    speed:   300, 
		    timeout: 3000, 
		    pager:  '#slidernav' 
		});
		
		$('#tab_review').hide();
		$('#tab_image').hide();
		$('#tab_related').hide();
		
		$('.tabs a').click(function() {
			
			$('.tabs a').removeClass('active');
			$(this).addClass('active');
						
		});
		
		$('.formsbtn').hover(function() {
		
			$(this).css({ opacity:0.8 });
		
		}, function() {
		
			$(this).css({ opacity:1 });
		
		});
				
	});
	
	function scrollTo(id) {
	
		$('html, body').animate({
			scrollTop: $(id).offset().top
		}, 1000);

	
	}
	
	function showTab(id) {
	
		$('#tab_review').hide();
		$('#tab_image').hide();
		$('#tab_related').hide();
		$('#tab_description').hide();
		
		$(id).show();
	
	}
	
	function bookmark(url, title) {
	
		if (window.sidebar) { // firefox
	    window.sidebar.addPanel(title, url, "");
		} else if(window.opera && window.print) { // opera
			var elem = document.createElement('a');
			elem.setAttribute('href',url);
			elem.setAttribute('title',title);
			elem.setAttribute('rel','sidebar');
			elem.click();
		} else if(document.all) {// ie
	   		window.external.AddFavorite(url, title);
		}
		
	}
