﻿/*
http://www.JSON.org/json2.js
2009-09-29

Public Domain.

NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.

See http://www.JSON.org/js.html
*/
if (!this.JSON) { this.JSON = {} } (function() { function l(c) { return c < 10 ? '0' + c : c } if (typeof Date.prototype.toJSON !== 'function') { Date.prototype.toJSON = function(c) { return isFinite(this.valueOf()) ? this.getUTCFullYear() + '-' + l(this.getUTCMonth() + 1) + '-' + l(this.getUTCDate()) + 'T' + l(this.getUTCHours()) + ':' + l(this.getUTCMinutes()) + ':' + l(this.getUTCSeconds()) + 'Z' : null }; String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function(c) { return this.valueOf() } } var o = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, p = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, h, m, r = { '\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '"': '\\"', '\\': '\\\\' }, j; function q(a) { p.lastIndex = 0; return p.test(a) ? '"' + a.replace(p, function(c) { var f = r[c]; return typeof f === 'string' ? f : '\\u' + ('0000' + c.charCodeAt(0).toString(16)).slice(-4) }) + '"' : '"' + a + '"' } function n(c, f) { var a, e, d, i, k = h, g, b = f[c]; if (b && typeof b === 'object' && typeof b.toJSON === 'function') { b = b.toJSON(c) } if (typeof j === 'function') { b = j.call(f, c, b) } switch (typeof b) { case 'string': return q(b); case 'number': return isFinite(b) ? String(b) : 'null'; case 'boolean': case 'null': return String(b); case 'object': if (!b) { return 'null' } h += m; g = []; if (Object.prototype.toString.apply(b) === '[object Array]') { i = b.length; for (a = 0; a < i; a += 1) { g[a] = n(a, b) || 'null' } d = g.length === 0 ? '[]' : h ? '[\n' + h + g.join(',\n' + h) + '\n' + k + ']' : '[' + g.join(',') + ']'; h = k; return d } if (j && typeof j === 'object') { i = j.length; for (a = 0; a < i; a += 1) { e = j[a]; if (typeof e === 'string') { d = n(e, b); if (d) { g.push(q(e) + (h ? ': ' : ':') + d) } } } } else { for (e in b) { if (Object.hasOwnProperty.call(b, e)) { d = n(e, b); if (d) { g.push(q(e) + (h ? ': ' : ':') + d) } } } } d = g.length === 0 ? '{}' : h ? '{\n' + h + g.join(',\n' + h) + '\n' + k + '}' : '{' + g.join(',') + '}'; h = k; return d } } if (typeof JSON.stringify !== 'function') { JSON.stringify = function(c, f, a) { var e; h = ''; m = ''; if (typeof a === 'number') { for (e = 0; e < a; e += 1) { m += ' ' } } else if (typeof a === 'string') { m = a } j = f; if (f && typeof f !== 'function' && (typeof f !== 'object' || typeof f.length !== 'number')) { throw new Error('JSON.stringify'); } return n('', { '': c }) } } if (typeof JSON.parse !== 'function') { JSON.parse = function(i, k) { var g; function b(c, f) { var a, e, d = c[f]; if (d && typeof d === 'object') { for (a in d) { if (Object.hasOwnProperty.call(d, a)) { e = b(d, a); if (e !== undefined) { d[a] = e } else { delete d[a] } } } } return k.call(c, f, d) } o.lastIndex = 0; if (o.test(i)) { i = i.replace(o, function(c) { return '\\u' + ('0000' + c.charCodeAt(0).toString(16)).slice(-4) }) } if (/^[\],:{}\s]*$/.test(i.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) { g = eval('(' + i + ')'); return typeof k === 'function' ? b({ '': g }, '') : g } throw new SyntaxError('JSON.parse'); } } } ());


// jXHR.js (JSON-P XHR)
// v0.1 (c) Kyle Simpson
// MIT License

(function(global) {
    var SETTIMEOUT = global.setTimeout, // for better compression
		doc = global.document,
		callback_counter = 0;

    global.jXHR = function() {
        var script_url,
			script_loaded,
			jsonp_callback,
			scriptElem,
			publicAPI = null;

        function removeScript() { try { scriptElem.parentNode.removeChild(scriptElem); } catch (err) { } }

        function reset() {
            script_loaded = false;
            script_url = "";
            removeScript();
            scriptElem = null;
            fireReadyStateChange(0);
        }

        function ThrowError(msg) {
            try { publicAPI.onerror.call(publicAPI, msg, script_url); } catch (err) { throw new Error(msg); }
        }

        function handleScriptLoad() {
            if ((this.readyState && this.readyState !== "complete" && this.readyState !== "loaded") || script_loaded) { return; }
            this.onload = this.onreadystatechange = null; // prevent memory leak
            script_loaded = true;
            if (publicAPI.readyState !== 4) ThrowError("Script loading failed [" + script_url + "].");
            removeScript();
        }

        function fireReadyStateChange(rs, args) {
            args = args || [];
            publicAPI.readyState = rs;
            if (typeof publicAPI.onreadystatechange === "function") publicAPI.onreadystatechange.apply(publicAPI, args);
        }

        publicAPI = {
            onerror: null,
            onreadystatechange: null,
            readyState: 0,
            open: function(method, url) {
                reset();
                internal_callback = "cb" + (callback_counter++);
                (function(icb) {
                    global.jXHR[icb] = function() {
                        try { fireReadyStateChange.call(publicAPI, 4, arguments); }
                        catch (err) {
                            publicAPI.readyState = -1;
                            ThrowError("Script failed to run [" + script_url + "].");
                        }
                        global.jXHR[icb] = null;
                    };
                })(internal_callback);
                script_url = url.replace(/=\?/, "=jXHR." + internal_callback);
                fireReadyStateChange(1);
            },
            send: function() {
                SETTIMEOUT(function() {
                    scriptElem = doc.createElement("script");
                    scriptElem.setAttribute("type", "text/javascript");
                    scriptElem.onload = scriptElem.onreadystatechange = function() { handleScriptLoad.call(scriptElem); };
                    scriptElem.setAttribute("src", script_url);
                    doc.getElementsByTagName("head")[0].appendChild(scriptElem);
                }, 0);
                fireReadyStateChange(2);
            },
            setRequestHeader: function() { }, // noop
            getResponseHeader: function() { return ""; }, // basically noop
            getAllResponseHeaders: function() { return []; } // ditto
        };

        reset();

        return publicAPI;
    };
})(window);

var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.";
//var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
function encode64(input) {
    var output = new StringMaker();
    var chr1, chr2, chr3;
    var enc1, enc2, enc3, enc4;
    var i = 0;

    while (i < input.length) {
        chr1 = input.charCodeAt(i++);
        chr2 = input.charCodeAt(i++);
        chr3 = input.charCodeAt(i++);

        enc1 = chr1 >> 2;
        enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
        enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
        enc4 = chr3 & 63;

        if (isNaN(chr2)) {
            enc3 = enc4 = 64;
        } else if (isNaN(chr3)) {
            enc4 = 64;
        }

        output.append(keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4));
    }

    return output.toString();
}


function decode64(input) {
    var output = new StringMaker();
    var chr1, chr2, chr3;
    var enc1, enc2, enc3, enc4;
    var i = 0;

    // remove all characters that are not A-Z, a-z, 0-9, +, /, or =
    input = input.replace(/[^A-Za-z0-9\-\_\.]/g, "");
    //input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");

    while (i < input.length) {
        enc1 = keyStr.indexOf(input.charAt(i++));
        enc2 = keyStr.indexOf(input.charAt(i++));
        enc3 = keyStr.indexOf(input.charAt(i++));
        enc4 = keyStr.indexOf(input.charAt(i++));

        chr1 = (enc1 << 2) | (enc2 >> 4);
        chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
        chr3 = ((enc3 & 3) << 6) | enc4;

        output.append(String.fromCharCode(chr1));

        if (enc3 != 64) {
            output.append(String.fromCharCode(chr2));
        }
        if (enc4 != 64) {
            output.append(String.fromCharCode(chr3));
        }
    }

    return output.toString();
}

var ua = navigator.userAgent.toLowerCase();
if (ua.indexOf(" chrome/") >= 0 || ua.indexOf(" firefox/") >= 0 || ua.indexOf(' gecko/') >= 0) {
    var StringMaker = function() {
        this.str = "";
        this.length = 0;
        this.append = function(s) {
            this.str += s;
            this.length += s.length;
        }
        this.prepend = function(s) {
            this.str = s + this.str;
            this.length += s.length;
        }
        this.toString = function() {
            return this.str;
        }
    }
} else {
    var StringMaker = function() {
        this.parts = [];
        this.length = 0;
        this.append = function(s) {
            this.parts.push(s);
            this.length += s.length;
        }
        this.prepend = function(s) {
            this.parts.unshift(s);
            this.length += s.length;
        }
        this.toString = function() {
            return this.parts.join('');
        }
    }
}


function getReqObjStory(strStoryId, strProvider, newReqId) {
    //var newReqId = ++globalCurrentReqId;
    var tempReqObj = {
        t: 4, // unsigned byte for message type (REQUEST_NEWS_STORY = 4)
        i: newReqId, // int indicating the request id
        s: strStoryId,
        p: strProvider
    };
    return tempReqObj;
}


function getReqObjHeadlines(strSource, intMax, strProvider, boolMonitor, reqId) {
    var newReqId = reqId; //++globalCurrentReqId;
    var tempReqObj = {
        t: 3, // unsigned byte for message type (REQUEST_MONITOR_HEADLINES = 3)
        i: newReqId, // int indicating the request id
        m: boolMonitor ? 1 : 0, // byte indicating subscription mode (SUBSCRIPTION_MODE_SNAPSHOT=0, SUBSCRIPTION_MODE_MONITOR=1)
        s: strSource,
        p: strProvider,
        max: intMax
    };
    return tempReqObj;
}


function getReqObjStory(strStoryId, strProvider, newReqId) {
    //var newReqId = ++globalCurrentReqId;
    var tempReqObj = {
        t: 4, // unsigned byte for message type (REQUEST_NEWS_STORY = 4)
        i: newReqId, // int indicating the request id
        s: strStoryId,
        p: strProvider
    };
    return tempReqObj;
}


var sessionId;
var pollinngInterval = 10000;
var globalConnectHost = "http://balancer.netdania.com/StreamingServer/StreamingServer";
var byteConnBehavior = 2; // CONNECTION_STREAMING = 1, CONNECTION_POLLING = 2, CONNECTION_LONG_POLLING = 3
var byteDeliveryType = 1; // Delivery-type (JSON/0, JSONP/1, SCRIPT-TAG/2).


var handshake = {
    g: "netdania.com",
    g: "netdania.com",
    ai: "MyAppId",
    au: "http://netdania.com/test.html",
    pr: byteConnBehavior // CONNECTION_STREAMING = 1, CONNECTION_POLLING = 2, CONNECTION_LONG_POLLING = 3
};
var strHandshake = JSON.stringify(handshake);
strHandshake = encode64(strHandshake);


var appId;

function doit(appletName)
{}

function doitOld(appletName) {


    appId = appletName;




    // Now lets make some initial requests (always in an array):
    var arrRequests = new Array();
    arrRequests.push(getReqObjHeadlines("netdania_website", 25/*max*/, "netdania_newschannel", true, 1));
    //arrRequests.push(getReqObjHeadlines("YahooBusiness", 25/*max*/, "rssnews", false, 1));

    var strArrRequests = JSON.stringify(arrRequests);
    strArrRequests = encode64(strArrRequests);


    var url = globalConnectHost + "?" +
                    "xstream=1&" +
                    "v=1&" +
                    "dt=1&" +
                    "h=" + strHandshake + "&" +
                    "xcmd=" + strArrRequests + "&" +
                    "cb=?" +
                    "&ts=" + Math.random();

    var x1 = new jXHR();


    /* #1 will work correctly */
    x1.onerror = handleError;
    x1.onreadystatechange = function(data) {
        if (x1.readyState === 4) {
            //alert("Success:"+data);
            sessionId = data[1].m;
            setInterval("doPolling(" + byteDeliveryType + ")", pollinngInterval);
        }
    };

    x1.open("GET", url);
    x1.send();

}
//var start = 1;
//function callback(data) {
//    if (start == 1){
//        sessionId = data[1].m;
//        setInterval("doPolling(" + byteDeliveryType + ")", pollinngInterval);
//        start++;
//    }
//    else {
//        if (data[0]) {
//            for (var i = 0; i < data.length; i++) {
//                //alert(data[i].h.h);
//                alert("<a href='http://www.google.ro'>google</a>");
//            }
//        }
//    }
//}



function doPolling(byteDeliveryType) {
    //alert("About to poll!");
    if (sessionId == null) {
        //alert("TODO: We cannot poll as we do not have a session-id from the server!");
        return;
    }

    var url2 = globalConnectHost + "?" +
                    "dt=" + byteDeliveryType + "&" +
                    "sessid=" + sessionId + "&" +
                    "cb=?&" +
                    "xpoll&" +
                    "&ts=" + Math.random();

    var x2 = new jXHR();

    /* #1 will work correctly */
    x2.onerror = handleError;
    x2.onreadystatechange = function(data) {
        if (x2.readyState === 4) {
            //alert("Success: " + data);
            if (data !== '') {
                if (data) {
                    for (var j = 0; j < data.length; j++) {
                        //document.getElementById("response_log").innerHTML = data[j].h.h + "<br><br>" + document.getElementById("response_log").innerHTML;
                        //var storyId = data[j].h.i;
                        //setTimeout('getStory(' + storyId + ',"'+ data[j].h.h + '")', 500);
                        //getStory(storyId, data[j].h.h);
                        var storyAndStory = data[j].h.h;
                        var arrStrStory = storyAndStory.split("####");
                        var headline = arrStrStory[0].substring(2, arrStrStory[0].length);
                        var story = arrStrStory[1];
                        //alert(story);
                        //alert(headline);
			showMask(headline, story, appId);
                    }
                }
            }
        }
    };
    x2.open("GET", url2);
    x2.send();
}

function handleError(msg, url) {
    //alert(msg);
}


var ARef;
var divmask;
var showMask = function(header, story, appletid) {

    ARef = document.getElementById(appletid);

    divmask = new maskpanel();
    divmask.show();
    //header = "0000000000000000000 00000000";
    //story = "aaaaaaaaa aaaaaaaaaaaaaa<br> bbbbbbbbbbbbbbbbbbbbbbb bbb<br>cccccccccccccccccccccccccccccccc<br>";
    var demodiv = document.getElementById("viewdemodiv");
    demodiv.innerHTML = '<div style="font-weight: bold; height: 30px; padding-top:2px; text-align:left; background: url(/App_Themes/Default/images/popup_back.png)">&nbsp;' + header + '</div>' +
			'<div style="text-align:left;background-color:white;color:black;border:solid 0px #cecece;padding:10px;">' + story + '</div>' +
				'<input style="margin:5px;height: 25px;width: 60px;" type="button" value="OK" onclick="hideMask();" />';
    demodiv.style.display = "block";
    demodiv.style.top = 200; //((document.body.clientHeight/2) - (demodiv.clientHeight/2))+'px';
    demodiv.style.left = ((document.body.clientWidth / 2) - (demodiv.clientWidth / 2)) + 'px';
}
var hideMask = function() {
    divmask.hide();
    document.getElementById("viewdemodiv").style.display = "none";
    showApplet();
}
var hideApplet = function() {

    ARef.style.visibility = "hidden";
}
var showApplet = function() {
    ARef.style.visibility = "visible";
}
var maskpanel = function() {

    this.divobj;
    this.show = function() {
        hideApplet();
        if (!document.getElementById("xdivmasking")) {
            var divEle = document.createElement('div');
            divEle.setAttribute("id", "xdivmasking");

            document.body.appendChild(divEle);
            var divSty = document.getElementById("xdivmasking").style;
            divSty.position = "absolute"; divSty.top = "0px"; divSty.left = "0px";
            divSty.zIndex = "46"; divSty.opacity = ".50"; divSty.backgroundColor = "#000";
            divSty.filter = "alpha(opacity=50)";

            var divFram = document.createElement('iframe');
            divFram.setAttribute("id", "xmaskframe");
            document.body.appendChild(divFram);
            divSty = document.getElementById("xmaskframe").style;
            divSty.position = "absolute"; divSty.top = "0px"; divSty.left = "0px";
            divSty.zIndex = "45"; divSty.border = "none"; divSty.filter = "alpha(opacity=0)";
        }

        this.divobj = document.getElementById("xdivmasking");
        this.waitifrm = document.getElementById("xmaskframe");

        var dsh = document.documentElement.scrollHeight;
        var dch = document.documentElement.clientHeight;
        var dsw = document.documentElement.scrollWidth;
        var dcw = document.documentElement.clientWidth;

        var bdh = (dsh > dch) ? dsh : dch;
        var bdw = (dsw > dcw) ? dsw : dcw;

        this.waitifrm.style.height = this.divobj.style.height = bdh + 'px';
        this.waitifrm.style.width = this.divobj.style.width = bdw + 'px';
        this.waitifrm.style.display = this.divobj.style.display = "block";
    };
    this.hide = function() {
        this.waitifrm.style.display = this.divobj.style.display = "none";
    };
}

function isAppletVisible() {
    var isVis = true;
    var hide = getCookieNew("hideApplets");
    if (hide == null || hide == "") {
        isVis = false;
    }
    else {
        isVis = true;
    }
    return isVis;
    //return true;
}

function hideApplets() {

    var hide = getCookieNew("hideApplets");
    if (hide == null || hide == "") {

        var ql = document.getElementById('qlApplet');
        if (ql != null) {
            ql.style.display = 'none';
        }
        var fc = document.getElementById('fcApplet');
        if (fc != null) {
            fc.style.display = 'none';
        }

        //csApplet
        var cs = document.getElementById('csApplet');
        if (cs != null) {
            cs.style.display = 'none';
        }
        //quoteApplet
        var qa = document.getElementById('quoteApplet');
        if (qa != null) {
            qa.style.display = 'none';
        }

        //thinChart
        var tc = document.getElementById('thinChart');
        if (tc != null) {
            tc.style.display = 'none';
        }

        //newsApplet
        var na = document.getElementById('newsApplet');
        if (na != null) {
            na.style.display = 'none';
        }

        //marketTicker
        var mt = document.getElementById('marketTicker');
        if (mt != null) {
            mt.style.display = 'none';
        }

        //front page
        var fp = document.getElementById('divApplet');
        if (fp != null) {
            fp.style.display = 'none';
        }

        //netstation
        var ns = document.getElementById('netstation');
        if (ns != null) {
            ns.style.display = 'none';
        }


    }
}

// Returns the value of the cookie with the given name //
// this fixes an issue with the old method, ambiguous values 
// with this test document.cookie.indexOf( name + "=" );
function getCookieNew(check_name) {
    // first we'll split this cookie up into name/value pairs
    // note: document.cookie only returns name=value, not the other components
    var a_all_cookies = document.cookie.split(';');
    var a_temp_cookie = '';
    var cookie_name = '';
    var cookie_value = '';
    var b_cookie_found = false; // set boolean t/f default f

    for (i = 0; i < a_all_cookies.length; i++) {
        // now we'll split apart each name=value pair
        a_temp_cookie = a_all_cookies[i].split('=');


        // and trim left/right whitespace while we're at it
        cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');

        // if the extracted name matches passed check_name
        if (cookie_name == check_name) {
            b_cookie_found = true;
            // we need to handle case where cookie has no value but exists (no = sign, that is):
            if (a_temp_cookie.length > 1) {
                cookie_value = unescape(a_temp_cookie[1].replace(/^\s+|\s+$/g, ''));
            }
            // note that in cases where cookie is initialized but no value, null is returned
            return cookie_value;
            break;
        }
        a_temp_cookie = null;
        cookie_name = '';
    }
    if (!b_cookie_found) {
        return null;
    }
}

// Sets cookie values. Expiration date is optional // 
function setCookieNew(name, value, expire) {
    document.cookie = name + "=" + escape(value) + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()));
}



    function hideModalPopupViaClient() {
        var modalPopupBehavior = $find('programmaticModalPopupBehavior');
        modalPopupBehavior.hide();
        setCookieNew("hideApplets", "false");
        showApplets();
    }


    function showApplets() {
        var quotelist = document.getElementById('qlApplet');
        if (quotelist != null) {
            quotelist.style.display = 'block';
        }


        var financeChart = document.getElementById('fcApplet');
        if (financeChart != null) {
            financeChart.style.display = 'block';
        }

        var cs = document.getElementById('csApplet');
        if (cs != null) {
            cs.style.display = 'block';
        }

        //quoteApplet
        var qa = document.getElementById('quoteApplet');
        if (qa != null) {
            qa.style.display = 'block';
        }

        //thinChart
        var tc = document.getElementById('thinChart');
        if (tc != null) {
            tc.style.display = 'block';
        }


        //newsApplet
        var na = document.getElementById('newsApplet');
        if (na != null) {
            na.style.display = 'block';
        }

        //marketTicker
        var mt = document.getElementById('marketTicker');
        if (mt != null) {
            mt.style.display = 'block';
        }

        //front page
        var fp = document.getElementById('divApplet');
        if (fp != null) {
            fp.style.display = 'block';
        }

        //netstation
        var ns = document.getElementById('netstation');
        if (ns != null) {
            ns.style.display = 'block';
        }
    }

    function show(tab) {
        var intro = document.getElementById("intro");
        var features = document.getElementById("features");
        var screenshots = document.getElementById("screenshots");
        var showIntro = tab == 'intro';
        var showFeatures = tab == 'features';
        var showScreenshots = tab == 'screenshots';

        if (showIntro) {
            intro.style.display = "block";
        }
        else {
            intro.style.display = "none";
        }

        if (showFeatures) {
            features.style.display = "block";
        }
        else {
            features.style.display = "none";
        }

        if (showScreenshots) {
            screenshots.style.display = "block";
        }
        else {
            screenshots.style.display = "none";
        }
    }

    function showSlideShow(tab) {
        var iphone = document.getElementById("wrapperiPhone");
        var ipad = document.getElementById("wrapperiPad");
        var android = document.getElementById("wrapperAndroid");
        var blackberry = document.getElementById("wrapperBlackberry");
        var showIPhone = tab == 'iphone';
        var showIPad = tab == 'ipad';
        var showAndroid = tab == 'android';
        var showBlackberry = tab == 'blackberry';

        var logoIPad = document.getElementById('iPadLogo');
        var logoIPhone = document.getElementById('iPhoneLogo');
        var logoAndroid = document.getElementById('androidLogo');
        var logoBlackberry = document.getElementById('blackberryLogo');

      

        if (showIPhone) {
            iphone.style.display = "block";
            ipad.style.display = "none";
            android.style.display = "none";
            blackberry.style.display = "none";
            logoIPhone.src = "/App_Themes/Default/iphone/menupopup/logo_iPhone.png";
            logoIPad.src = "/App_Themes/Default/iphone/menupopup/logo_iPad_unsel.png";
            logoAndroid.src = "/App_Themes/Default/iphone/menupopup/logo_Android_unsel.png";
            logoBlackberry.src = "/App_Themes/Default/iphone/menupopup/logo_Blackberry_unsel.png";
        }
        else if (showIPad)
        {
            iphone.style.display = "none";
            ipad.style.display = "block";
            android.style.display = "none";
            blackberry.style.display = "none";
            logoIPhone.src = "/App_Themes/Default/iphone/menupopup/logo_iPhone_unsel.png";
            logoIPad.src = "/App_Themes/Default/iphone/menupopup/logo_iPad.png";
            logoAndroid.src = "/App_Themes/Default/iphone/menupopup/logo_Android_unsel.png";
            logoBlackberry.src = "/App_Themes/Default/iphone/menupopup/logo_Blackberry_unsel.png";
        }
        else if (showAndroid) {
            iphone.style.display = "none";
            ipad.style.display = "none";
            android.style.display = "block";
            blackberry.style.display = "none";
            logoIPhone.src = "/App_Themes/Default/iphone/menupopup/logo_iPhone_unsel.png";
            logoIPad.src = "/App_Themes/Default/iphone/menupopup/logo_iPad_unsel.png";
            logoAndroid.src = "/App_Themes/Default/iphone/menupopup/logo_Android.png";
            logoBlackberry.src = "/App_Themes/Default/iphone/menupopup/logo_Blackberry_unsel.png";
        }
        else if (showBlackberry) {
            iphone.style.display = "none";
            ipad.style.display = "none";
            android.style.display = "none";
            blackberry.style.display = "block";
            logoIPhone.src = "/App_Themes/Default/iphone/menupopup/logo_iPhone_unsel.png";
            logoIPad.src = "/App_Themes/Default/iphone/menupopup/logo_iPad_unsel.png";
            logoAndroid.src = "/App_Themes/Default/iphone/menupopup/logo_Android_unsel.png";
            logoBlackberry.src = "/App_Themes/Default/iphone/menupopup/logo_Blackberry.png";
        }
    }


