jQuery(document).ready(function() {
    jQuery("#dialog-error").dialog({
        resizable: false,
        modal: true,
        buttons: {
            Ok: function() {
                jQuery(this).dialog('close');
            //                $("#overlay").fadeOut();
            }
        }
    });
    jQuery("#dialog-message-sent").dialog({
        resizable: false,
        modal: true,
        buttons: {
            Ok: function() {
                jQuery(this).dialog('close');
                window.location='index.php';
            //                $("#overlay").fadeOut();
            }
        }
    });
    $("#freepack").colorbox({
        width:"440px", 
        inline:true, 
        href:"#inline_superbutt3"
    });
    
    $("#freepack11").colorbox({
        width:"440px", 
        inline:true, 
        href:"#inline_superbutt11"
    });
    
    $("#freepack1201").colorbox({
        width:"440px", 
        inline:true, 
        href:"#inline_superbutt1201"
    });
    
    $(".menu a").hover(
        function() {                    
            var id=$(this).parent().attr("id");
            id=id.substring(4,5);
            $("#arrow"+id).animate({
                opacity: 1                        
            }, 500);
        },
        function() {
            var id=$(this).parent().attr("id");
            id=id.substring(4,5);
            $("#arrow"+id).animate({
                opacity: 0.05
            }, 500);
        }
        );  
});

function refresh_menu(code) {
    $('#citytd').html('Loading...');
    $.ajax({
        type: "POST",
        url: "ajax.php?code="+code,
        error: function(){
            $("#citytd").html('Error! Please try again later!');
        },
        success: function(responseText){
            //alert( responseText);
            $("#citytd").html(responseText);
        }
    });
}
