﻿// JScript File 






$(document).ready(function () {

	//var colNewHieght=$('.col1').innerHeight();
	//var colNewHieght2=$('.col2').innerHeight();
	//var colNewHieght3=$('.col3').innerHeight();
	
	//alert(colNewHieght); alert(colNewHieght2); alert(colNewHieght3)
	
	//$('.col1').css('height',colNewHieght);

	//--------------- iFrame Menu hiding script ----------------------//

		$('iframe').each(function(){
		var url = $(this).attr("src");
		$(this).attr("src",url+"?&wmode=transparent")
		});

    //================= Search Box Text =====================
    $('div.globalNav div.search input').focus(function () {
        if ($(this).val() == 'Search') {
            $(this).val('');
        }
    });

    $('div.globalNav div.search input').blur(function () {
        if ($(this).val() == '') {
            $(this).val('Search');
        }
    });
    
//    $('a.galleryUpload').click(function(e){
//        e.preventDefault();
//        $('div.upload-image-background').css('display','block')
//    });
//    $('a.galleryUploadClose').click(function(e){
//        e.preventDefault();
//        $('div.upload-image-background').css('display','none')
//    });


    //================= Sub Menu =====================

    $('div.mainNav ul.level1 > li').hover(
        function () {
            $(this).find('ul.level2:hidden').slideDown(300);
            $(this).addClass('over')
        },
        function () {
            $(this).find('ul.level2:visible').slideUp(300);
            $(this).removeClass('over')
            $.clearQueue();
        });

    $('div.mainNav ul.level2 > li').hover(
        function () {
            $(this).find('ul.level3:hidden').animate({ width: 'toggle' }, 200);
        },
        function () {
            $(this).find('ul.level3:visible').animate({ width: 'toggle' }, 200);
            $.clearQueue();
        });

    $('div.mainNav ul.level3').hover(
        function () {
            $(this).parent().find('a:first').addClass('over');
        },
        function () {
            $(this).parent().find('a:first').removeClass('over');
            $.clearQueue();
        });

    //================= Facets =====================     
    $('ul.search-facet > li > a').click(function (event) {
        $(this).parent().find('ul').slideToggle();
        $(this).parent().toggleClass('plus');
        event.preventDefault();
    })

    $('a.inactive').click(function (event) {
        event.preventDefault();
    });

    //================= Equal height script =====================    
    $.fn.equalHeights = function (px) {
        $(this).each(function () {
            var currentTallest = 0;
            $(this).children().each(function (i) {
                if ($(this).height() > currentTallest) { currentTallest = $(this).height(); }
            });
            //if (!px || !Number.prototype.pxToEm) currentTallest = currentTallest.pxToEm(); //use ems unless px is specified
            // for ie6, set height since min-height isn't supported
            if ($.browser.msie && $.browser.version == 6.0) { $(this).children().css({ 'height': currentTallest }); }
            $(this).children().css({ 'min-height': currentTallest });
        });
        return this;
    };


    $('ul.sitemap li:nth-child(4n+1)').css('clear', 'both')
    $('ul.sitemap li:nth-child(4n)').css('margin', '0')

    $('div.library-table div.table-body tr:last td').css('border', '0');

    $('div.library-related .section:first').css('margin-right', '20px')

    //================= Form styling =====================       
    if (typeof (Custom) != "undefined") {
        Custom.init();
    }
});



/*Santhosh Scripts Starts*/
$(document).ready(function () {


    $(".showDSlider").click(function () {
        var imgId = (this.id).substring(6);
        //var imgScr ="style/images/GE_Lighting/homeimg"+imgId+".jpg";
        //$("img#bigImgChange").attr("src",imgScr)

       // $("div.bigImgChange").hide();
       // var bigImg = "#bigImg" + imgId
      //  $(bigImg).show();

        $("div.sliderMain").hide();
        var slideId = "#slid" + imgId
        $(slideId).show();

        /*
        var slideId="#mycarousel"+imgId;
        jQuery(slideId).jcarousel();*/

        

    });


    /* Gallery Right Content Change */
    $(".rightContent").click(function () {
        var count = ($(this).attr('id')).substring(4)
        $(".descriptions").hide()
        var contid = "#des" + count
        $(contid).show()
    });
    /* Gallery Right Content Change Ends*/

    /*Tab active onclick change starts*/

    $(".tabAdjestNormal").click(function () {

        $('.tabAdjestNormal').removeClass('tabAdjest');
        $(this).addClass('tabAdjest');

    }, function () {
        $('.tabAdjestNormal').removeClass('tabAdjest');
    });
    
    
    $(".tabAdjestNormal").mouseover(function () {
       $(this).addClass('tabAdjest1');
       });
    
    $(".tabAdjestNormal").mouseout(function() {
            $('.tabAdjestNormal').removeClass('tabAdjest1');
    });

    /*Tab onclick change Ends*/
});


// Home page Thumbnial Image slid (for setting the UI width) starts - [for Chrome & Safari]
/*
$('.showDSlider').live('click', function() { 
        var changeID = (this.id).substring(6);
        var newID = "#slid" + changeID + " li";
        var licount = $(newID).length;
       // alert(licount);
        
        var liPaddingCount=licount*40; 
        for (i = 1; i <= licount; i++) {
            if (i == 1) { 
             var total = 1 
            }
            else { 
                total = total1 
            }
            var imgId = "#slide" + i;
            var total1 = total + parseInt($(imgId).attr("width"))
          //  alert(total1);
        }
           // alert(liPaddingCount)
         var ulwidth = liPaddingCount + total1 + "px";
        $(".sliderMain ul").css("width", ulwidth)
})

$(window).load(function () {
    var licount = $("#slid1 li").length;
    var liPaddingCount=licount*40; 
       for (i = 1; i <= licount; i++) {
        if (i == 1) { var total = 0 }
        else { total = total1 }
        var imgId = "#slide" + i;
        var total1 = total + parseInt($(imgId).attr("width"))
    }
    var ulwidth = liPaddingCount + total1 + "px";
    $("#slid1 ul").css("width", ulwidth)
});
*/


