
function hidestatus() {
    window.status = '';
    return true;
}

function resetstatus() {
    window.status = '';
    return true;
}

if (document.layers) 
{
    document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT);
    document.captureEvents(Event.MOUSEDOWN | Event.MOUSEOUT);
}

document.onmouseover = hidestatus;
document.onmousedown = hidestatus; 
document.onmouseout = resetstatus;





// Change page language on selection

function replaceAll(URL, from, to) {
    idx = 0;
    while (idx > -1) 
    {
        URL = URL.replace(from, to);
        idx = URL.indexOf(from);
    }
    
    return URL;
}

function changeLanguage(lan) {

    var URL = unescape(location.href);

    URL = replaceAll(URL, "://", "%3A%2F%2F");

    URL = replaceAll(URL, "/", "%2F");

    URL = replaceAll(URL, "?", "%3F");

    URL = replaceAll(URL, ",", "%2C");

    URL = replaceAll(URL, "&", "%26");

    URL = replaceAll(URL, "=", "%3D");

    Hostname = 'http://www.pp.gov.ae';

    var fullURL = Hostname + "/portal/pls/portal/PORTAL.wwctx_app_language.set_language?" + lan + "&p_requested_url=" + URL;

    location.href = fullURL;
    return true;

}
