//pop-over related functions

function shownote(txt,reglink_onclick,title,loglink_onclick){
    var obj = document.getElementById('postitdiv');
    obj.style.visibility = "visible";
    var msg = document.getElementById('message');
    msg.innerHTML = txt;
    if(document.getElementById('_reglink_')){
	    document.getElementById('_reglink_').onclick = function() {
	    	eval(reglink_onclick);
	    	return true;
	    }
    }
    if(document.getElementById('_reglink_')){
	   document.getElementById('_reglink_').href = 'javascript:'+reglink_onclick;
    }
    if(title && title != ''){
        var titlu = document.getElementById('top_message');
        titlu.innerHTML = title;
    }
    if(loglink_onclick && document.getElementById('_loglink_')) {
    	document.getElementById('_loglink_').onclick = function() {
	    	eval(loglink_onclick);
	    	return true;
	    }
	    document.getElementById('_loglink_').href = 'javascript:'+loglink_onclick;
    }
    blockObj();
    centerBox(document.getElementById('postitdiv'));
}

function closenote(){
    var obj = document.getElementById('postitdiv');
    obj.style.visibility = "hidden";
    deblockObj();   
}


function centerBox(obj){    
    var b=(document.documentElement?document.documentElement:document.body);
    var wH=window.innerHeight?window.innerHeight:(document.documentElement.clientHeight>=document.body.clientHeight?document.documentElement.clientHeight:document.body.clientHeight);
    var wW=window.innerWidth?window.innerWidth:(document.documentElement.clientWidth>=document.body.clientWidth?document.documentElement.clientWidth:document.body.clientWidth);
    obj.style.top=parseInt(parseInt(wH-obj.offsetHeight)/2+parseInt((document.documentElement.scrollTop>=document.body.scrollTop?document.documentElement.scrollTop:document.body.scrollTop)))+'px';
    obj.style.left=parseInt(parseInt(wW-obj.offsetWidth)/2)+'px';
}

function blockObj(){
    var op=50;
    var color='#999';

    if(!document.getElementById('_blocked_')){
        var o=document.createElement("div");
        o.id='_blocked_';
        document.body.appendChild(o);
        var p=document.createElement("iframe");
        p.style.height='100%';
        p.style.width='100%';
        o.appendChild(p);

    }else{
        var o=document.getElementById('_blocked_');
    }
    o.style.top=0+'px';
    o.style.left=0+'px';
    document.body.style.hight='100%';
    
    /*o.style.height=(document.body.offsetHeight>=document.documentElement.offsetHeight?document.body.offsetHeight:document.documentElement.offsetHeight)+30+'px';
    var s=0;
    for(var i in document.body.childNodes) if(document.body.childNodes[i].offsetHeight){
            s+=document.body.childNodes[i].offsetHeight;
    }*/
    //o.style.height=s+30+'px';
    //o.style.width=document.body.offsetWidth+19+'px';
    var wW = document.documentElement.clientWidth || document.body.clientWidth;
    var wH = document.documentElement.clientHeight || document.body.clientHeight;
    if (document.body.scrollHeight > wH)  {
    	wH = document.body.scrollHeight;
    }
    o.style.height=wH;
    o.style.width=wW;
    o.style.opacity=op/100;
    o.style.filter='alpha(opacity='+op+')';
    o.style.backgroundColor=color;
    o.style.position='absolute';
    o.style.display='block';
    o.style.zIndex=190; 
}

function deblockObj(){
    document.getElementById('_blocked_').style.display='none';
}