 function mainmenu(){
$(" div.submenulist ").css({display: "none"}); // Opera Fix
$("#menucontent ul.menu li div.submenulist").fadeTo(0, 0.97);
$(" li.level1").hover(function(){
		$(this).find('div.submenulist:hidden').css({visibility: "visible",display: "none"}).fadeIn(0);
		},function(){
		$(this).find('div.submenulist').css({visibility: "hidden",display: "none"});
		});
}

$(document).ready(function(){	
						   
	mainmenu();
	
		// FadeRoll
	$('a').hover(function(){
		$(this).find('.faderoll').stop().fadeTo(0, 0.80);
	}, function(){
		$(this).find('.faderoll').stop().fadeTo(500, 1.00);
 	});	
	
	// Rollovers (instant)
	rollover_triggered = 'no';
	$('.rollover img, img.rollover').parent('a').focus(function(){
		$(this).children('img').attr('src', $(this).children('img').attr('src').replace(/\_off\./gi, '_on\.'));
		rollover_triggered = 'yes';
	});
	$('.rollover input, input.rollover').focus(function(){
		$(this).attr('src', $(this).attr('src').replace(/\_off\./gi, '_on\.'));
		rollover_triggered = 'yes';
	});
	$('.rollover img, .rollover input, img.rollover, input.rollover').parent('a').blur(function(){
		$(this).children('img').attr('src', $(this).children('img').attr('src').replace(/\_on\./gi, '_off\.'));
		rollover_triggered = 'no';
	});
	$('.rollover input, input.rollover').blur(function(){
		$(this).attr('src', $(this).attr('src').replace(/\_on\./gi, '_off\.'));
		rollover_triggered = 'no';
	});
	$('.rollover img, .rollover input, img.rollover, input.rollover').hover(function(){
		$(this).attr('src', $(this).attr('src').replace(/\_off\./gi, '_on\.'));
	},
	function(){
		if ( rollover_triggered != 'yes' ) {
			$(this).attr('src', $(this).attr('src').replace(/\_on\./gi, '_off\.'));
		}
	});
	// Rollovers (preload)
	$('.rollover img, .rollover input, img.rollover, input.rollover').each(function(){
		var source_image = $(this).attr('src');
		var rollover_image = source_image.replace(/\_off\./gi, '_on\.');
		$('<img>').attr('src', rollover_image);
	});
	
	
	//jcarousel
	
//	function mycarousel_initCallback(carousel)
//	{

//    // Pause autoscrolling if the user moves with the cursor over the clip.
//    carousel.clip.hover(function() {
//        carousel.stopAuto();
//    }, function() {
//        carousel.startAuto();
//    });
//	};

//	jQuery('#mycarousel').jcarousel({
//        auto: 3,
//        wrap: 'circular',
//		'scroll': 6,
//        initCallback: mycarousel_initCallback
//    });
//	
//	// Clear field value when clicked
//	$(".has_default_value").focus(function (){
//		if ( $(this).val() == $(this).attr("title") ) { 
//			$(this).val("");
//		}
//	});
//	$(".has_default_value").blur(function (){ 
//		if ( $(this).val() == "" ) {
//			$(this).val($(this).attr("title"));
//		}
//});
	
	
	
	
	// Thumby
	$(".thumb1 img").hover(function(){
		$('#homeimage-images').stop().animate({"left": "0"}, 300)
	});
	$(".thumb2 img").hover(function(){
		$('#homeimage-images').stop().animate({"left": "-314px"}, 300)
	});
	$(".thumb3 img").hover(function(){
		$('#homeimage-images').stop().animate({"left": "-628px"}, 300)
    });
    $(".thumb4 img").hover(function() {
        $('#homeimage-images').stop().animate({ "left": "-942px" }, 300)
    });
    $(".thumb5 img").hover(function() {
        $('#homeimage-images').stop().animate({ "left": "-1256px" }, 300)
    });
    $(".thumb6 img").hover(function() {
        $('#homeimage-images').stop().animate({ "left": "-1570px" }, 300)
    });
	
	
	// Product page tabs
	$('div.changable_tabs ul.tabs').show();
	$('div.changable_tabs div.content').hide();
	$('div.changable_tabs div.content h2').hide();
	$('div.changable_tabs div.content_1').show();
	$('div.changable_tabs ul.tabs li.tab_1 a').click(function(){ 
		$('div.changable_tabs ul.tabs li a').removeClass('current');
		$('div.changable_tabs ul.tabs li.tab_1 a').addClass('current');
		$('div.changable_tabs div.content').hide();
		$('div.changable_tabs div.content_1').show();
		$('div.changable_tabs div.content_1 h2').show();
		return false;
	});
	$('div.changable_tabs ul.tabs li.tab_2 a').click(function(){ 
		$('div.changable_tabs ul.tabs li a').removeClass('current');
		$('div.changable_tabs ul.tabs li.tab_2 a').addClass('current');
		$('div.changable_tabs div.content').hide();
		$('div.changable_tabs div.content_2').show();
		$('div.changable_tabs div.content_2 h2').show();
		return false;
	});
	$('div.changable_tabs ul.tabs li.tab_3 a').click(function(){ 
		$('div.changable_tabs ul.tabs li a').removeClass('current');
		$('div.changable_tabs ul.tabs li.tab_3 a').addClass('current');
		$('div.changable_tabs div.content').hide();
		$('div.changable_tabs div.content_3').show();
		$('div.changable_tabs div.content_3 h2').show();
		return false;
	});
	$('div.changable_tabs ul.tabs li.tab_4 a').click(function(){ 
		$('div.changable_tabs ul.tabs li a').removeClass('current');
		$('div.changable_tabs ul.tabs li.tab_4 a').addClass('current');
		$('div.changable_tabs div.content').hide();
		$('div.changable_tabs div.content_4').show();
		$('div.changable_tabs div.content_4 h2').show();
		return false;
	});
		
	
});
