Ajax

/*
$.cookie("o4nline", 1, {
   expires : 10,           //expires in 10 days

   path    : '/',          //The value of the path attribute of the cookie 
                           //(default: path of page that created the cookie).

   domain  : ''//,  //The value of the domain attribute of the cookie
                           //(default: domain of page that created the cookie).

   //secure  : false         //If set to true the secure attribute of the cookie
                           //will be set and the cookie transmission will
                           //require a secure protocol (defaults to false).
});
$.ajaxSetup({
    type: "POST",
    
    dataType: 'html',

    crossDomain: true
});
*/ /*
         $.ajax({
            type: "POST",
data: {"do": "search"},
            url: api_url,
            dataType: 'html',
//xhrFields: {
// withCredentials: true
//},
// beforeSend: function(xhr){
    //   xhr.withCredentials = true;
    //},
            crossDomain: true, //true,          
            success: function (data, textStatus, xmLHttpRequest) {
                console.log("Data: " + data + " -search- " + api_url);

            },
            error: function (xhr, ajaxOptions, thrownError) {
                //alert('Somthing is wrong', 'Error');
            },

        });

*/

Keyboard Events
        // Wait for device API libraries to load
        //
        document.addEventListener("deviceready", onDeviceReady, false);

        function onDeviceReady () {
        window.addEventListener('native.hidekeyboard', keyboardHideHandler);
        window.addEventListener('native.showkeyboard', keyboardShowHandler);

        }

    function keyboardHideHandler(e){
    $("#chat").css("height", "258px");
    $.mobile.silentScroll($("#chat").offset().top);
    }
    function keyboardShowHandler(e){
    $("#chat").css("height", "20px");
    $.mobile.silentScroll($("#send").offset().top);
    }