function over(param){
    document.getElementById(param).className = "buttonH";
}
function out(param){
    document.getElementById(param).className = "button";
}
function setP(id,p){
    document.getElementById(id).style.backgroundImage = "url(\'"+p+"\')";
    //alert(document.getElementById(id).style.backgroundImage);
}

function verticalAlign(param,width,height){
    document.getElementById(param).style.top = ((screen.height-height)/2 - 100)+"px";
    document.getElementById(param).style.left =((screen.width-width)/2)+"px";
    
}
function ieAlign(outside,param,width,height){
    document.getElementById(param).style.position= "absolute";
    //alert("top="+document.getElementById(outside).parentNode.offsetTop);
    //alert("left="+document.getElementById(outside).parentNode.offsetLeft);
    document.getElementById(param).style.top = ((screen.height-height)/2 - document.getElementById(outside).parentNode.offsetTop)+"px";
    document.getElementById(param).style.left =((screen.width-width)/2 - document.getElementById(outside).parentNode.offsetLeft)+"px";
    
}
function blockAlign(outside,param,width,height){
    document.getElementById(param).style.top = ((document.getElementById(outside).parentNode.offsetHeight-height)/2 + document.getElementById(outside).parentNode.offsetTop)+"px";
    document.getElementById(param).style.left =((document.getElementById(outside).parentNode.offsetWidth-width)/2 +document.getElementById(outside).parentNode.offsetLeft)+"px";
    
}
function showTab(mainPaneContents)
{ 
    source = mainPaneContents;
    showPage(mainPaneContents);
}
function showPage(mainPaneContents)
{ 
    AjaxRequest("GET",mainPaneContents+"ssq="+Math.random(),stateChanged);
}
function loadAdsense(){
    var adPage = document.getElementById("ads");
    if(adPage!=null){
        adPage.src = "Ads.jsp?ssq="+Math.random();
    }            
}
function stateChanged() 
{ 
    if (xmlHttp.readyState==4)
        { 
            //var xmlDoc=xmlHttp.responseXML.documentElement;
            document.getElementById("mainPane").innerHTML= xmlHttp.responseText;
            if(xmlHttp.responseText.indexOf("msgBoxCont")!=-1){
                document.getElementById("msgBox").innerHTML="";
                showMsgDlg("mainPane");
            }
            loadAdsense();
        }
    }
    function showMsgBox(msg)
    {    
        AjaxRequest("GET",msg+"ssq="+Math.random(),msgResult);
    }
    function showMsgDlg(outside){
        if(document.getElementById("role")!=null){
            document.getElementById("role").style.visibility = "hidden";
        }
        if(navigator.appName=="Microsoft Internet Explorer"){
            ieAlign(outside,"msgBoxCont",300,200);
        }else{
        verticalAlign("msgBoxCont",300,200);
    }
    document.getElementById("msgBoxCont").style.display="block";   
    
}
function hideMsgBox(){
    if(document.getElementById("role")!=null){
        document.getElementById("role").style.visibility = "visible";
    }
    if(document.getElementById("msgBoxCont")!= null){
        document.getElementById("msgBoxCont").style.display="none";
    }
}

function msgResult() 
{ 
    if (xmlHttp.readyState==4)
        { 
            //var xmlDoc=xmlHttp.responseXML.documentElement;
            document.getElementById("msgBox").innerHTML= xmlHttp.responseText;
            showMsgDlg("msgBox");
        }
    }