$(window).load(function () 
    {
      $(".pulsate").effect("pulsate", { times:2 }, 1500);
    });

$(document).ready(function() {	

    $("#management-container, #seller-container, #buyer-container").hide();
	$(".round-bottom").corner("bl br");
	$(".round-top").corner("tl tr");	
	
	
	$("#location-container, #specialDetails").hide();

	$(".location-changer-demigod-v-1").hide();
	$("#location-options").hide();	
	$("table.location-data tr td").click(function () { 
      $("#location-options").show();	  
	  $("#new-locale").text($(this).html());
    });
    

    $(".establishment-terms-and-conditions").hide();

    $(".show-establishment-terms-and-conditions").click(function() {
        $(".establishment-terms-and-conditions").toggle();
    });
    
    $("#button-one").click(function() {
        $("#div-one").show(); $("#div-two").hide(); $("#div-three").hide();
        $("#b-1-box").removeClass("active-tab").addClass("other-tab");
        $("#b-2-box").removeClass("other-tab").addClass("active-tab");
        $("#b-3-box").removeClass("other-tab").addClass("active-tab");
    });

    $("#button-two").click(function() {
        $("#div-two").show(); $("#div-one").hide(); $("#div-three").hide();
        $("#b-2-box").removeClass("active-tab").addClass("other-tab");
        $("#b-1-box").removeClass("other-tab").addClass("active-tab");
        $("#b-3-box").removeClass("other-tab").addClass("active-tab");
    });

    $("#button-three").click(function() {
        $("#div-three").show(); $("#div-one").hide(); $("#div-two").hide();
        $("#b-3-box").removeClass("active-tab").addClass("other-tab");
        $("#b-1-box").removeClass("other-tab").addClass("active-tab");
        $("#b-2-box").removeClass("other-tab").addClass("active-tab");
    });     
    
    
});

function disableBtn(btnID, newText, validationGroup) {
    //initialize to avoid 'Page_IsValid is undefined' JavaScript error
    Page_IsValid = null;
    //check if the page request any validation    
    // if yes, check if the page was valid
    if (typeof (Page_ClientValidate) == 'function') {
        Page_ClientValidate(validationGroup);
        //you can pass in the validation group name also
    }
    //variables
    var btn = document.getElementById(btnID);
    var isValidationOk = Page_IsValid;
    /********NEW UPDATE************************************/    
    //if not IE then enable the button on unload before redirecting/ rendering    
    if (navigator.appName !== 'Microsoft Internet Explorer') 
    {
           EnableOnUnload(btnID, btn.value);    
    }    
    /***********END UPDATE ****************************/    
    // isValidationOk is not null
    if (isValidationOk !== null) {
        //page was valid
        if (isValidationOk) {
            btn.disabled = true;
            btn.value = newText;
            //btn.style.background = "url(12501270608.gif)";
        }
        else {//page was not valid
            btn.disabled = false;
        }
    }
    else {//the page don't have any validation request
        setTimeout("setImage('"+btnID+"')", 10);
        btn.disabled = true;
        btn.value = newText;
    }
}
//set the background image of the button
function setImage(btnID) {
    var btn = document.getElementById(btnID);
    //btn.style.background = 'url(12501270608.gif)';
}
//enable the button and restore the original text value
function EnableOnUnload(btnID, btnText) 
{
    window.onunload = function()
    {
            var btn = document.getElementById(btnID);
            btn.disabled = false;
            btn.value = btnText;
    }
}
