function popup(url,name,windowWidth,windowHeight){    myleft=(screen.width)?(screen.width-windowWidth)/2:50;	mytop=(screen.height)?(screen.height-windowHeight)/2:50;	properties = "width="+windowWidth+",height="+windowHeight+",scrollbars=no,location=no,toolbar=no, top=1,left="+myleft;    window.open(url,name,properties)
}

function winPopup(url,name,windowWidth,windowHeight){    myleft=(screen.width)?(screen.width-windowWidth)/2:50;	mytop=(screen.height)?(screen.height-windowHeight)/2:50;	properties = "width="+windowWidth+",height="+windowHeight+",scrollbars=no,resizable=no,location=no,toolbar=no,top="+mytop+",left="+myleft;    window.open(url,name,properties,'_top')
}

function winpoptox(mod,wh,hh,vb,target,sb) {
	if (sb == null) { sb='yes'; }
	w_x=(screen.width-wh)/2;
	w_y=(screen.height-hh)/2;
	window.open(mod + '.php?' + vb,target,"scrollbars="+ sb +",toolbar=yes,top=1,left=1,resizable=no,screenX=1,screenY=1,menubar=no,location=no,toolbar=no,width="+ wh +",height="+ hh +",status=no");
}

function winpoptopr(mod,wh,hh,vb,target,sb) {
	if (sb == null) { sb='no'; }
	w_x=(screen.width-wh)/2;
	w_y=(screen.height-hh)/2;
	window.open(mod + '.php?' + vb,target,"scrollbars="+ sb +",toolbar=no,top=1,left=1,resizable=no,screenX=1,screenY=1,menubar=yes,location=no,width="+ wh +",height="+ hh +",status=no");
}

function winopen(href) {
	window.open(href,'_top');
}

function wopen(href) {
	window.open(href,'_top');
}

function cfmDel(msg) {
	cfm=confirm(msg);
	if (cfm == false) { return false }
}

function cekFm(fmName) {
	infoData="Info Data \n";
	fmLenght=fmName.elements.length;
	for (i=0;i<fmLenght;i++) {
		if (fmName.elements[i].value == "") {
			alert('Lengkapi semua form isian');
			fmName.elements[i].focus();
			return false;
		}
	}
	cfmReg=confirm('Apakah Anda yakin data sudah benar ?');
	if (cfmReg == false) { return false; }
}

function checkAll(field)
{
for (i = 0; i < field.length; i++)
field[i].checked = true ;
}

function uncheckAll(field)
{
for (i = 0; i < field.length; i++)
field[i].checked = false ;
}

function fillAll(fmName,chk) {
	if (chk == true) { checkAll(fmName); }
	if (chk == false) { uncheckAll(fmName); }
}

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=350');");
}

function tS(){ x=new Date(); x.setTime(x.getTime()); return x; } 
function lZ(x){ return (x>9)?x:'0'+x; } 
function dT(){ if(fr==0){ fr=1; document.write('<span id="tP">'+eval(oT)+'</span>'); } tP.innerText=eval(oT); setTimeout('dT()',1000); } 
function y4(x){ return (x<500)?x+1900:x; }
var dN=new Array('Sunday','Monday, ','Tuesday, ','Wednesday, ','Thursday, ','Friday, ','Saturday, '),mN=new Array('January','February','March','April','May','June','July','August','September','October','November','December'),fr=0,oT="dN[tS().getDay()]+' '+mN[tS().getMonth()]+' '+tS().getDate()+', '+y4(tS().getYear())+' '+'-'+' '+lZ(tS().getHours())+':'+lZ(tS().getMinutes())+':'+lZ(tS().getSeconds())+' '";

function confirmClose() { 
	if (confirm( "Anda yakin untuk Keluar?" )) { 
		window.close(); 
	} else { 
		return false; 
	} 
}

// Copyright 2006-2007 javascript-array.com

var timeout	= 500;
var closetimer	= 0;
var ddmenuitem	= 0;

// open hidden layer
function mopen(id)
{
	// cancel close timer
	mcancelclosetime();

	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';

}
// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

// close layer when click-out
document.onclick = mclose;