if (/MSIE (\d+\.\d+);/.test(navigator.userAgent))
{ //test for MSIE x.x;
 var ieversion=new Number(RegExp.$1); 
}




$(document).ready(function(){
	$(".categories_menu li").each(function(){
		var thiswidth = $(this).width() / 2;
		$(this).find('.arrow').css({'left':thiswidth-13})
		$(this).find("ul").parent("li").find("a:first").addClass("submenu");
	})
	
	
	$(".categories_menu > ul > li").hover( function(){
		$(this).find("a:first").addClass("hactive");
	}, function(){
		$(this).find("a:first").removeClass("hactive");
	});
	
	$(".categories_menu li").hover( function(){
		$(this).find("ul:first").show();
		$(this).find("a:first").addClass("sactive");
		$(this).find("ul:first > li:last").find("a:first").addClass("last");
	}, function(){
		$(this).find("ul:first").hide();
		$(this).find("a:first").removeClass("sactive");
	});
	
	$("#navigation ul li a").hover(function(){
		$(this).parent("li").addClass("hactive");										
	}, function(){
		$(this).parent("li").removeClass("hactive");	
	});
	
	$("#subnavigation ul li").hover(function(){
			
		$(this).find("ul:first").show();									
	}, function(){
		$(this).find("ul:first").hide();
	});
	
	
	/* Map */
	$(".mapstet").hover(function(){
		$(this).addClass("zindex");
		$(".mapstet").removeClass("sabactive");
		
	},function(){
		$(this).removeClass("zindex");
		$(this).removeClass("sabactive");
		});
	$(".point").hover(function(){
		$(this).parent(".mapstet").addClass("active");					   
		},function(){
			$(this).parent(".mapstet").removeClass("active");
			$(this).parent(".mapstet").addClass("sabactive");
		});
/*--------------------------------------------------------------------------*/
// tooltip js start here 
/*--------------------------------------------------------------------------*/	
	
	

	if(ieversion>=8 || ieversion>=7 || ieversion>=6)
   {
	
	$(function () {
        $('.bubbleInfo').each(function () {
            var distance = 10;
            var time = 400;
            var hideDelay = 100;

            var hideDelayTimer = null;

            var beingShown = false;
            var shown = false;
            var trigger = $('.trigger', this);
            var info = $('.popup', this).css({display:'none'});
		
			//$(".pro_bar ").addClass("forieinfo");
			//var getinforamtion = $(".pro_bar ").find(".bubbleInfo").index();
			
            $([trigger.get(0), info.get(0)]).mouseover(function () {
				
				$(this).parents(".bubbleInfo").addClass('zindextforie');
				$(this).parents(".product_box_top").addClass('zindextforie');
				
                if (hideDelayTimer) clearTimeout(hideDelayTimer);
                if (beingShown || shown) {
                    // don't trigger the animation again
					
					info.css({display: 'block'});
                    return;
                } else {
                    // reset position of info box
				
				
				//$(this).parents(".pro_bar").addClass("ontop");
                    beingShown = true;
				//	var thiheight = trigger.height() + 'px';
					//var thiwidth = trigger.width() ;
					//alert (thiheight);
                    info.css({display: 'block'}, time, 'swing', function() {
                        beingShown = false;
                        shown = true;
                    });
                }

                return false;
            }).mouseout(function () {
				$(this).parents(".bubbleInfo").removeClass('zindextforie');
				$(this).parents(".product_box_top").removeClass('zindextforie');
				//$(this).parents(".pro_bar").removeClass("ontop");
                if (hideDelayTimer) clearTimeout(hideDelayTimer);
				
                hideDelayTimer = setTimeout(function () {
					
                    hideDelayTimer = null;
                    info.css({display: 'none'}, time, 'swing', function () {
                        shown = false;
                        info.css('display', 'none');
						$(".mapstet").removeClass("sabactive");
						
                    });

                }, hideDelay);

                return false;
            });
        });
    });}else {
		$(function () {
        $('.bubbleInfo').each(function () {
            var distance = 10;
            var time = 400;
            var hideDelay = 100;

            var hideDelayTimer = null;

            var beingShown = false;
            var shown = false;
            var trigger = $('.trigger', this);
            var info = $('.popup', this).css('opacity', 0);
			$(".bubbleInfo").removeClass("ontop");
			
            $([trigger.get(0), info.get(0)]).mouseover(function () {
			
                if (hideDelayTimer) clearTimeout(hideDelayTimer);
                if (beingShown || shown) {
                    // don't trigger the animation again
                    return;
                } else {
                    // reset position of info box
					$(this).parent(".bubbleInfo").addClass("ontop");
                    beingShown = true;
				//	var thiheight = trigger.height() + 'px';
					//var thiwidth = trigger.width() ;
					//alert (thiheight);
                    info.css({
                      //  bottom: '-' + thiheight,
                        //left:"50%px;",
                        display: 'block'
                    }).animate({
                        //top: /*'-=' + distance + 'px'*/ -140,
                        opacity: 1
                    }, time, 'swing', function() {
                        beingShown = false;
                        shown = true;
                    });
                }

                return false;
            }).mouseout(function () {
				$(this).parent(".bubbleInfo").removeClass("ontop");
                if (hideDelayTimer) clearTimeout(hideDelayTimer);
                hideDelayTimer = setTimeout(function () {
					
                    hideDelayTimer = null;
                    info.animate({
                        //top: /*'-=' + distance + 'px'*/ 0,
                        opacity: 0
                    }, time, 'swing', function () {
                        shown = false;
                        info.css('display', 'none');
						
                    });

                }, hideDelay);

                return false;
            });
        });
    });
		
		};
	
	
});

	function show(a)
	{
		document.getElementById('bigimg').src = a;
	}
	$(function()
	{
		var defa_img = $('#bigimg').attr('src');
		
		var defa_image = document.getElementById('bigimg').src;
		$('.more_product a').mouseover(function()
		{
			var str = $(this).attr('rel');
			//alert(str);
			document.getElementById('bigimg').src = str;
		});
		/*$('.more_product a').mouseout(function()
		{
			document.getElementById('bigimg').src = defa_img;
		});*/
	});
	
	
	$(function()
	{
		var defa_img = $('#bigimg').attr('src');
		
		var defa_image = document.getElementById('bigimg').src;
		$('.more_product2 a').mouseover(function()
		{
			var str = $(this).attr('rel');
			//alert(str);
			document.getElementById('bigimg').src = str;
		});
		/*$('.more_product2 a').mouseout(function()
		{
			document.getElementById('bigimg').src = defa_img;
		});*/
	});
	

