// JavaScript Document
// JavaScript Document
/*
function hide(div) {
	
  if (document.getElementById)
     document.poppedLayer = eval('document.getElementById(div)');
  else if (document.all)
     document.poppedLayer = eval('document.all[div]');
  else
     document.poppedLayer = eval('document.layers[div]');
  document.poppedLayer.style.display = "none";
}

function show(div) {
  if (document.getElementById)
     document.poppedLayer = eval('document.getElementById(div)');
  else if (document.all)
     document.poppedLayer = eval('document.all[div]');
  else
     document.poppedLayer = eval('document.layers[div]');
  document.poppedLayer.style.display = "block";
}
*/

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(); }
}

////////////////jump menu//////////////////////////////////
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->

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


///////////////////////clear default value onFocus////////////////////////////////////////
/*
// specify the name of your form
var thisForm = "userform";

// load field names and default values into list
var defaultVals = new Array();
defaultVals[0] = new Array("username", "NAMA PENGGUNA");
defaultVals[1] = new Array("password", "123456");

// populate fields with default values on page load
function MPLoadDefaults() {
with (document.forms[thisForm]) {
for (var n=0; n<defaultVals.length; n++) {
var thisField = defaultVals[n][0];
var thisDefault = defaultVals[n][1];
if (elements[thisField].value == '')
elements[thisField].value = thisDefault;
}}}

// clear default value from field when selected
function MPClearField(field) {
var fieldName = field.name;
for (var n=0; n<defaultVals.length; n++) {
var thisField = defaultVals[n][0];
var thisDefault = defaultVals[n][1];
if (thisField == fieldName) {
if (field.value == thisDefault) field.value = '';
break;
}}}

// clear all defaults when form is submitted
function MPClearAll() {
with (document.forms[thisForm]) {
for (var n=0; n<defaultVals.length; n++) {
var thisField = defaultVals[n][0];
var thisDefault = defaultVals[n][1];
if (elements[thisField].value == thisDefault)
elements[thisField].value = '';
}}}
*/


