
var winW;
var winH;

function screenwidth(){
    if (parseInt(navigator.appVersion)>3) {
         if (navigator.appName=="Netscape") {
          winW = window.innerWidth;
         }
         if (navigator.appName.indexOf("Microsoft")!=-1) {
          winW = document.body.offsetWidth;
         }
         return winW;
    }
}

function screenheight(){
    if (parseInt(navigator.appVersion)>3) {
        if (navigator.appName=="Netscape") {
            winH = window.innerHeight;
        }
        if (navigator.appName.indexOf("Microsoft")!=-1) {
            winH = document.body.offsetHeight;
        }
        return winH;
    }
}

function showHideDiv(divId){
    if(!document.getElementById(divId)){
        alert(divId);
    }
    else{
        showvis = document.getElementById(divId).style.display;
    }
    if(showvis == "none"){
        showDiv(divId);
    }
    else{
        hideDiv(divId);
    }
    
}

function showDiv(divId){
    if(document.getElementById(divId)){
        document.getElementById(divId).style.display = "block"
        document.getElementById(divId).style.visibility = "visible"
    }
}

function hideDiv(divId){
    if(document.getElementById(divId)){
        document.getElementById(divId).style.display = "none"
        document.getElementById(divId).style.visibility = "hidden"
    }
}

window.onresize = restoreboxpos;

function restoreboxpos(){
    //alert("currentPage = " + currPage)
    if(currPage == "register"){
        //alert ("resizing");
        var ss = document.getElementById("country_suggest");
        var sw = screenwidth() / 2;
        var boxpos = sw + 270;
        ss.style.left = boxpos;
    }
}

