var subWindow;
function openWindow(url,w,h) {
  if (!subWindow || subWindow.closed) {
    var width  = w;
    var height = h;
    // Mendapatkan posisi kiri atas (dari layar)
    var left   = parseInt((screen.availWidth/2) - (width/2));
    var top    = parseInt((screen.availHeight/2) - (height/2));
    // Menetapkan fitur window
    var fitur  = "width=" + width + ", height=" +
        height + ",resizable=0, menubar=0, toolbar=0, titlebar=0,scrollbars=0, status=0, addressbars=0, left=" +
        left + ",top=" + top + ",screenX=" +
        left + ",screenY=" + top;
    // Membuka window
    subWindow  = window.open(url, "sub", fitur);
  } else {
    // Sub window sudah dibuka, sehingga tinggal
    // memberinya fokus
    subWindow.focus();
  }
}

function printFoto(zz,sss) {
    document.getElementById(zz).innerHTML="<img  src=\data/temp/"+sss+"'  alt='' width='50'  height='70'>";
}

function insertpict(el,px) {
    document.getElementById(el).innerHTML=document.getElementById(px).innerHTML;	 
} 
function collapse(area) {
  var e = document.getElementById(area);
  if (!e) {
    return true;
  }
  if (e.style.display == "none") {
    e.style.display = "block"
  } else {
    e.style.display = "none"
  }
  return true;
}

function ex(area) {
document.getElementById(area).style.display = "block"
  return true;
}
function coll(area) {
    document.getElementById(area).style.display = "none"
  return true;
}

function hideme(el) {
  var e =document.getElementById(el);
  if (!e) {
    return true;
  }
	{ e.style.display = "none";	   }
  return true;
}

function showme(el) {
  var e =document.getElementById(el);
  if (!e) {
    return true;
  }
	{ e.style.display = "block";	   }
  return true;
}
function showmeS(el,ww) {
if (ww=='5')	 {	 showme(el);	  }
}
function recolorme(exl,cl) {
  var ex =document.getElementById(exl);

  {
  ex.style.backgroundColor=cl;
  }
    return true;
}

function recolormefront(exl,cl) {
  var ex =document.getElementById(exl);
  if (!ex) {
    return true;
  }
  {ex.style.color=cl; }
    return true;
}
/* onmouseout="this.style.backgroundColor='<?php  echo $menuBgColor ?>';hideme('popuppresentto');"
onmouseover="this.style.backgroundColor='<?php  echo $menuColor ?>';showme('popuppresentto');">
*/



function contexMenu(){
window .status=event.clientX + ' ' + event.clientY;
}
function contexMenuOver(el,elx){
var e=$x(el);
e.style.left=event.clientX-200;	// elx.pageX+100;
e.style.top=event.clientY;//	elx.pageY;
showme(el);    return false;

}
function dispX(idx,ss){
var vidx=document.getElementById(idx);
vidx.style.visibility='hidden';
vidx.innerHTML=ss;
vidx.style.visibility='visible';
}
/*========*/
function bgelout_1(el1,el2,bg1){
var e1=document.getElementById(el1);
var e2=document.getElementById(el2);
     e2.style.display="none";
     e1.style.backgroundColor=bg1;
}
function bgelout_1a(el1,el2,bg1,cl1){
var e1=document.getElementById(el1);
var e2=document.getElementById(el2);
     e2.style.display="none";
     e1.style.backgroundColor=bg1;
     e1.style.color=cl1;
}



function bgelovr_1(el1,el2,bg1){
var e1=document.getElementById(el1);
var e2=document.getElementById(el2);
     e1.style.backgroundColor=bg1;
     e2.style.backgroundColor=bg1;
     e2.style.display="block";
}
function bgelovr_1a(el1,el2,bg1,cl1){
var e1=document.getElementById(el1);
var e2=document.getElementById(el2);
     e1.style.backgroundColor=bg1;
     e1.style.color=cl1;
     e2.style.backgroundColor=bg1;
     e2.style.display="block";
}


function bgelovr_2(el1,el2,bg1,bg2){
var e1=document.getElementById(el1);
var e2=document.getElementById(el2);
     e1.style.backgroundColor=bg1;
     e2.style.backgroundColor=bg2;
     e1.style.display="block";
     e2.style.display="block";
}

function bgelovr_3(el1,el2,el3,bg1,bg2,bg3){
var e1=document.getElementById(el1);
var e2=document.getElementById(el2);
var e3=document.getElementById(el3);
     e1.style.backgroundColor=bg1;
     e2.style.backgroundColor=bg2;
     e3.style.backgroundColor=bg3;
     e2.style.display="block";
     e3.style.display="block";
}


