﻿
var oldHeight;
$(document).ready(function() {

    $('a[href="#tab1_1"]').click(function() {

        $("#mtab1").css('display', 'block');
        $("#mtab2").css('display', 'none');
        $("#mtab3").css('display', 'none');
    });
    $('a[href="#tab2_1"]').click(function() {
        $("#mtab1").css('display', 'none');
        $("#mtab2").css('display', 'block');
        $("#mtab3").css('display', 'none');

    });
    $('a[href="#tab8_1"]').click(function() {
        $("#mtab1").css('display', 'none');
        $("#mtab2").css('display', 'none');
        $("#mtab3").css('display', 'block');

    });

    //Aded by Hemant on 13/JAN/2012

    $('#ctl02_txtEmailAddress').css('color', '#A7A7A9');
    $('#ctl02_txtEmailAddress').css('font-style', 'italic');

    $('#ctl02_txtEmailAddress').val('Please enter a full valid email address');

    $('#ctl02_txtEmailAddress').click(function() {
    if ($(this).val() == 'Please enter a full valid email address') {
            $(this).val('');
            $('#ctl02_txtEmailAddress').css('color', '#000000');
            $('#ctl02_txtEmailAddress').css('font-style', 'normal');
        }
    });
    
    $('#ctl02_txtEmailAddress').blur(function() {
    if ($(this).val() == 'Please enter a full valid email address') {
            $(this).val('');
        
        }
        else if ($(this).val() == '') {
            $('#ctl02_txtEmailAddress').css('color', '#A7A7A9');
            $('#ctl02_txtEmailAddress').css('font-style', 'italic');
            $(this).val('Please enter a full valid email address');
        }
    });

    //    $("#divContainer ul li").click(function() {
    //        alert($("#divContainer ul li").index(this));
    //    });
});

    //to show popup tab on mouse over
function showtab(tabid, numtabs, tabfamily) {

    //alert('showtab');
        var tempTabId;
        var currentTabId = tabfamily + tabid;
//        alert('currentTabId    ' + currentTabId);

        //1. get parent div id of current div
        ////alert($('#' + currentTabId).parents('div:eq(0)').attr('id'));
         var parentTabID=$('#' + currentTabId).parents('div:eq(0)').attr('id')

         //2. get inset css class name and change height-width on mouse over
         ////alert($('#mtab1').parent().attr('class'));
         var insetClassName = $('#' + parentTabID).parent().attr('class');
         oldHeight = $('.' + insetClassName).height();
         oldWidth = $('.' + insetClassName).width();
         // alert(oldHeight);
         //Change by Hemant
         $('.' + insetClassName).height(750);
         $('.' + insetClassName).width(750);
         
         

//         $('.' + insetClassName).height(oldHeight);
//         $('.' + insetClassName).width(oldWidth);
         
         //  $('.inset_77_1').height(700);
         //  $('.inset_77_1').width(700);
         //  $('.inset_77_1').css("background", "yellow");
        
        for (i = 1; i <= numtabs; i++) {
            tempTabId = tabfamily + i;
            getEl(tempTabId).style.display = "none";
        }
        getEl(currentTabId).style.display = "block";
    }

    //to get element by ID
    function getEl(id) {
        return document.getElementById(id);
    }

    //to hide popup tab on mouse out
    function hidetab(tabname) {
        
        tempTabId = tabname;
        getEl(tempTabId).style.display = "none";

        //alert('tempTabId - ' + tempTabId);
        
        //get parent id of current tab/div
        var parentTabID = $('#' + tempTabId).parents('div:eq(0)').attr('id')
        
        //get inset css class name of parent
        var insetClassName = $('#' + parentTabID).parent().attr('class');
        $('.' + insetClassName).height(oldHeight);
        $('.' + insetClassName).width(oldWidth);
        
        //  $('.inset_77_1').css("background", "none");
        //$('.inset_77_1').height(70);
        //$('.inset_77_1').width(200);
        
        if (document.getElementById("officelisttab2")) {
            getEl("officelisttab2").style.display = "none";
        }
        if (document.getElementById("officelisttab3")) {
            getEl("officelisttab3").style.display = "none";
        }

    }

    
