// JavaScript Document untuk MyCMS

function HideContent(d) {
document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
document.getElementById(d).style.display = "block";
}
function ReverseDisplay(d) {
if(document.getElementById(d).style.display == "none") { document.getElementById(d).style.display = "block"; }
else { document.getElementById(d).style.display = "none"; }
}

function setPointer(theRow, thePointerColor)
{
    if (thePointerColor == '' || typeof(theRow.style) == 'undefined') {
        return false;
    }
    if (typeof(document.getElementsByTagName) != 'undefined') {
        var theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        var theCells = theRow.cells;
    }
    else {
        return false;
    }

    var rowCellsCnt  = theCells.length;
    for (var c = 0; c < rowCellsCnt; c++) {
        theCells[c].style.backgroundColor = thePointerColor;
    }

    return true;
} // end of the 'setPointer()' function

function popitup(url)
{
   newwindow = window.open(url, '', 'height=500, width=400, resizable=0, status=1, left=250, top=60, scrollbars=1');
   if (window.focus)
      { newwindow.focus() }
	  return false;
}

function openPop(url,w,h,n) 
{
    var url=url;
    var height = h;
    var width = w;
    var wname = n;
    var winleft = (screen.width - width) / 2;
    var winUp = (screen.height - height) / 2;
    winProp = 'width='+width+',height='+height+',left='+winleft+',top='+winUp+',scrollbars,resizable'
    win = window.open(url, wname, winProp)
    if (parseInt(navigator.appVersion) >= 4) 
		{ win.window.focus(); }
}

//get confirmation upon user's action
function verify(act,url) {
	var answer = confirm("Anda pasti untuk memadam " + act + "?")
	if (answer){
		window.location = url;
	}
}

