/* debe tener incluido utils.js*/

includeOnce("ajax.js");

var backpanel="flotating_details_backpanel";

function show_backpanel(){
    var div = document.createElement('div');
    var ws = getWindowSize();
    div.id=backpanel;
    div.style.backgroundColor="black";
    div.style.position="absolute";
    div.style.top="0px";
    div.style.left="0px";    
    div.style.filter="alpha(opacity=50)";
    div.style["opacity"]=".50";
    div.style["z-index"]="1000";
    div.style.height=ws.scrollHeight+"px";
    div.style.width=document.width+"px";
    document.body.appendChild(div);
}

function hide_backpanel(){
    document.body.removeChild(document.getElementById(backpanel));
}


var containerid="flotating_details_container";

function show_container(){
    var div = document.createElement('div');
    var ws = getWindowSize();
    document.body.appendChild(div);
    div.id=containerid;
    div.style.position="absolute";
    div.style.top="0px";
    div.style.left="0px";
    div.style["z-index"]="1001";
    div.style.height=document.height+"px";
    div.style.width=document.width+"px";
}

function hide_container(){
    document.body.removeChild(document.getElementById(containerid));
}


function charge_details(id,text){
    document.getElementById("flotating_interior").innerHTML=text;
}

function show_details_arloak(id,language){
    show_backpanel();
    show_container();
    var div = document.getElementById(containerid);
    var ws = getWindowSize();
    div.innerHTML +='<center><div style=" text-align:left;  margin-top:'+(((ws.height-340)/2)+ws.scrollTop)+'px; background-image:url(/images/salatu.png); width:454px; height:340px"><div id="flotating_topbase"><img src="/images/spacer.gif" width="0" height="0"/></div><img src="/images/x_gray.png" widget="button" onclick="hide_details()" style="position:absolute; margin-left:405px; margin-top: 30px;"/><div id="flotating_interior" style="background-color:white;margin: 44px 40px; height:260px; overflow:auto;"></div></div></center>';
    lk_callByAjax("",charge_details,"/services/show_arloak_details.php","ar_id="+id+"&language="+language);
}

function show_details(id,type){
    show_backpanel();
    show_container();
    var div = document.getElementById(containerid);
    var ws = getWindowSize();
    if(type=='video'){
        div.innerHTML +='<center><div style=" text-align:left;  margin-top:'+(((ws.height-420)/2)+ws.scrollTop)+'px; background-image:url(/images/wb_'+type+'.png); width:500px; height:420px"><div id="flotating_topbase"><img src="/images/spacer.gif" width="0" height="0"/></div><img src="/images/x_gray.png" widget="button" onclick="hide_details()" style="position:absolute; margin-left:435px; margin-top: 25px;"/><div id="flotating_interior" style="background-color:white;margin: 45px 45px 45px 41px; height:340px; overflow:hidden;"></div></div></center>';
    }else{
        div.innerHTML +='<center><div style=" text-align:left;  margin-top:'+(((ws.height-500)/2)+ws.scrollTop)+'px; background-image:url(/images/wb_'+type+'.png); width:700px; height:500px"><div id="flotating_topbase"><img src="/images/spacer.gif" width="0" height="0"/></div><img src="/images/x_gray.png" widget="button" onclick="hide_details()" style="position:absolute; margin-left:660px; margin-top: 25px;"/><div id="flotating_interior" style="background-color:white;margin: 48px 30px; height:420px; overflow:hidden;"></div></div></center>';
    }
    lk_callByAjax("",charge_details,"/services/show_program_details.php","multi_id="+id);
}

function hide_details(){
    document.getElementById(containerid).innerHTML='';
    hide_container();
    hide_backpanel();
}

/*
   <center>
        <div style="margin-top:'+(((ws.height-340)/2)+ws.scrollTop)+'px; background-image:url(/images/salatu.png); width:454px; height:340px">
            
        </div>
    </center>';

*/
