//=====================================================//
var LoadReadyLocal = {
    setupPrintDialog: function(){
        $(function() {
            $("#divId").dialog({
                autoOpen: false,
                modal: true,
                height: 600,
                width: 700
            });

            $('#print a').click(function(e){
                e.preventDefault();
                Dialog.showDialog.call(this);
            });
        });
    },
    emailToFriend: function(){
        $(function() {
            $('#btnEmailToFriend').click(function(e){
                e.preventDefault();
                var exp = {
                    validate: true,
                    callbackOnSuccess: function(json) {
                        if (json.returnText != ''){
                            Util.alert(json.returnText);
                            $('#dialog').dialog('close');
                            $('#dialog').dialog('destroy');
                        }
                    }
                }

                Util.openFormInDialog.call(this, 'emailToFriendForm', 'Email This To a Friend', 520, 400, exp);
            });
        });
    },

    enquireThisPage: function(){
        $(function() {
            $('#btnEnquireThisPage').click(function(e){
                e.preventDefault();
                var exp = {
                    validate: true,
                    callbackOnSuccess: function(json) {
                        if (json.returnText != ''){
                            Util.alert(json.returnText);
                            $('#dialog').dialog('close');
                            $('#dialog').dialog('destroy');
                        }
                    }
                }
                Util.openFormInDialog.call(this, 'enquireThisPage', 'Enquire About This', 520, 300, exp);
            });
        });
    },

    twitterFeed: function(){
        $(function(){
            $('#tweets').jTweetsAnywhere({
                username: 'pilotsimplesoft',
                count: 5,
                tweetProfileImagePresent: true

            });
        });
    }
};

LoadReady = $.extend(LoadReady, LoadReadyLocal);


$(function() {
    $('#cloud').pan({
        fps: 25, 
        speed: 0.25, 
        dir: 'left'
    });

    // set the border right of last item to 0 //
    $('#list li:nth-child(even)').css({
        'background-color': '#eff3ef'
    });
    $('table.generic tr:nth-child(even)').css({
        'background-color': '#f3f3f3'
    });
    $('#keyword').focus(function(){
        var value = $(this).val();
        if ($(this).val() == 'keyword search'){
            $(this).val("");
        }
    });

    $('#fontsizer').jfontsizer({
        applyTo: '#col3_content',
        changesmall: '2',
        changelarge: '3',
        expire: 0
    });

    //Cufon.replace('h1') ('h2') ('h3') ('h4') ('h5') ('h6');
    
    $("input[name='lang']").livequery('click', function(e) {
        e.preventDefault();
        
        var lang = $(this).val();
		
        document.location =  '/' + lang + '/';
    });

	//$('body').tubular('48zOm2-Zh6U','cloud');

    $.reject({
        closeCookie: true // Set cookie to remmember close for this session
    });
    
});

