/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

isIE6 = navigator.userAgent.toLowerCase().indexOf('msie 6') != -1;

function collb(hash){

}
$(document).ready(function(){

    

    $("li.block ul li a").hover(function(){
        $(this).find(".globFirst").animate({ marginTop:"-10px" },300)
                                .animate({ marginTop:"0px" },250)
                                .animate({ marginTop:"-6px" },250)
                                .animate({ marginTop:"0px" },150)
                                .animate({ marginTop:"-3px" },150)
                                .animate({ marginTop:"0px" },100);
    });


    $('#pickColor').ColorPicker({
                                color: '#0000ff',
                                onShow: function (colpkr) {
                                    $(colpkr).fadeIn(500);
                                    return false;
                                },
                                onHide: function (colpkr) {
                                    $(colpkr).fadeOut(500);
                                    return false;
                                },
                                onSubmit: function (hsb, hex, rgb) {
                                    $('#pickColor').css('backgroundColor', '#' + hex);
                                    $('#headSeperator').css('background', '#' + hex);
                                    //$('#footerSeperator').css('background', '#' + hex);
                                    $('#worldMap').css('background', '#' + hex);
                                }
                            });

    $("#loading").ajaxStart(function(){ $(this).show(); });
    $("#loading").ajaxStop(function(){ $(this).hide(); $("#content").fadeIn(300);});

    $("li.block ul").click(function(){
        $("input[name=page]").val(this.id);
        $("#content").hide();
        var lang = $("input[name=currentLang]").val();
        var link = $("input[name=link]").val();
        
        // restore ajax loaded state
        //if(!isIE6)
        //{
            $(".globBack").hide();
            $(".globFirst").show();
            $("#"+this.id).find(" li:first img.glob").toggle();
        //}

        $("#content div").load(link+this.id+"/",{"async":1,"lang":lang});
        return false;
    });


    /*$("#es").click(function(){
        $("#esForm").submit();
    });

    $("#en").click(function(){
        $("#enForm").submit();
    }); 

    $("#pl").click(function(){
        $("#plForm").submit();
    });*/



});
