// JavaScript Document

function emptyField (fieldId, defaultValue) {
	var obj = document.getElementById(fieldId);
	if(obj.value == defaultValue) {
		obj.value = '';
	}
	return false;
}
function NewWindow(mypage, myname, w, h, scroll) {
 var winl = (screen.width - w) / 2;
 var wint = (screen.height - h) / 2;
 winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',menubar=yes,resizable'
 win = window.open(mypage, myname, winprops)
 if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function fullWindow(url) {
 var str = "left=0,screenX=0,top=0,screenY=0,resizable,menubar=yes,";
 if (window.screen) {
  var ah = screen.availHeight - 30;
  var aw = screen.availWidth - 10;
  str += ",height=" + ah;
  str += ",innerHeight=" + ah;
  str += ",width=" + aw;
  str += ",innerWidth=" + aw;  
 }
 win=window.open(url, "w", str);
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function buatFocus (fieldId) {
	var obj = document.getElementById(fieldId);
	obj.focus();
}

function Hide(name) {
	if (document.layers)
		document[name].visibility = 'hide';
	else {
		var g = document.all ? document.all[name] : document.getElementById(name);
		g.style.visibility = 'hidden';
		g.style.display = 'none';
	}
}

function Show(name) {
	if (document.layers)
		document[name].visibility = 'show';
	else {
		var g = document.all ? document.all[name] : document.getElementById(name);
		g.style.visibility = 'visible';
		g.style.display = 'block';
	}
}

function SwitchMenu(name) {
	var g = document.all ? document.all[name] : document.getElementById(name);
	if (g.style.visibility == 'hidden') {
		Show(name);
	} else {
		Hide(name);
	}
}

