/*
 * JS for mobilescreen1 generated by Exadel Tiggzi
 *
 * Created on: Tuesday, November 06, 2012, 02:26:27 PM (PST)
 */
/************************************
 * JS API provided by Exadel Tiggzi  *
 ************************************/
/* Setting project environment indicator */
Tiggr.env = "bundle";
Tiggr.getProjectGUID = function() {
    return 'fbde6832-9b47-4871-ab62-30592a1248e5';
}
Tiggr.getTargetPlatform = function() {
    return '0';
}

function navigateTo(outcome, useAjax) {
    Tiggr.navigateTo(outcome, useAjax);
}

function adjustContentHeight() {
    Tiggr.adjustContentHeight();
}

function adjustContentHeightWithPadding() {
    Tiggr.adjustContentHeightWithPadding();
}

function setDetailContent(pageUrl) {
    Tiggr.setDetailContent(pageUrl);
}
/**********************
 * SECURITY CONTEXTS  *
 **********************/
/*******************************
 *      SERVICE SETTINGS        *
 ********************************/
var Settings = {
    "Host IP": "127.0.0.1"
}
/*************************
 *      SERVICES          *
 *************************/
var RESTServiceCONTROL_PREVIOUS = new Tiggr.RestService({
    'url': 'http://127.0.0.1:8082/cmds?Control(Previous)',
    'dataType': 'xml',
    'type': 'post',
    'contentType': 'application/x-www-form-urlencoded',
    'serviceSettings': Settings
});
var RESTServiceShowMovie = new Tiggr.RestService({
    'url': 'http://127.0.0.1:8082',
    'dataType': 'xml',
    'type': 'post',
    'contentType': 'application/x-www-form-urlencoded',
});
var RESTGetCache = new Tiggr.RestService({
    'url': 'http://127.0.0.1:8082/cmds?getCache',
    'dataType': 'xml',
    'type': 'post',
    'contentType': 'application/x-www-form-urlencoded',
});
createSpinner("files/resources/lib/jquerymobile/images/ajax-loader.gif");
Tiggr.AppPages = [{
    "name": "PosterCache",
    "location": "PosterCache.html"
}, {
    "name": "Remote",
    "location": "Remote.html"
}, {
    "name": "mobilescreen1",
    "location": "mobilescreen1.html"
}];
j_42_js = function(runBeforeShow) { /* Object & array with components "name-to-id" mapping */
    var n2id_buf = {
        'mobilegrid20': 'j_46',
        'mobilegridcell409': 'j_47',
        'mobilelabel131': 'j_48',
        'mobilegridcell410': 'j_49',
        'mobiletextinput59': 'j_50',
        'mobilebutton2': 'j_51'
    };
    if ("n2id" in window && window.n2id !== undefined) {
        $.extend(n2id, n2id_buf);
    } else {
        window.n2id = n2id_buf;
    }
    Tiggr.CurrentScreen = 'j_42';
    /*************************
     * NONVISUAL COMPONENTS  *
     *************************/
    var datasources = [];
    /************************
     * EVENTS AND HANDLERS  *
     ************************/
    j_42_beforeshow = function() {
        Tiggr.CurrentScreen = 'j_42';
        for (var idx = 0; idx < datasources.length; idx++) {
            datasources[idx].__setupDisplay();
        }
    }
    // screen onload
    screen_F68C_onLoad = j_42_onLoad = function() {
        screen_F68C_elementsExtraJS();
        j_42_windowEvents();
        screen_F68C_elementsEvents();
    }
    // screen window events
    screen_F68C_windowEvents = j_42_windowEvents = function() {
        $('#j_42').bind('pageshow orientationchange', function() {
            adjustContentHeightWithPadding();
        });
    }
    // screen elements extra js
    screen_F68C_elementsExtraJS = j_42_elementsExtraJS = function() {
        // modalPanel (screen-F68C) extra code
    }
    // screen elements handler
    screen_F68C_elementsEvents = j_42_elementsEvents = function() {
        $("a :input,a a,a fieldset label").live({
            click: function(event) {
                event.stopPropagation();
            }
        });
        $('#j_45 [name="mobilebutton2"]').die().live({
            click: function() {
                if (!$(this).attr('disabled')) {
                    closePopup();
                    Tiggr.navigateTo('PosterCache', {
                        reverse: false
                    });
                }
            },
        });
    }
    $("#j_42").die("pagebeforeshow").live("pagebeforeshow", function(event, ui) {
        j_42_beforeshow();
    });
    if (runBeforeShow) {
        j_42_beforeshow();
    } else {
        j_42_onLoad();
    }
}
$("#j_42").die("pageinit").live("pageinit", function(event, ui) {
    j_42_js();
});