function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function setuju (){
	if (document.getElementById("setuju").value){
		document.getElementById("dketentuan").style.display="none";
		document.getElementById("dformulirpk").style.display="block";
		window.location.hash="toppage";
	}
}

function openDateChooser() {
	newWindow = window.open("", '', 'scrollbars=no, toolbars=no, width=240, height=150');
	newWindow.self.location = 'assets/js/choose_date.php';
}

function setDateText(text) {
	document.compempform.Tgl_Penutupan.value = text;
}

function keurl(url){
	var url;
	window.location.replace(url);
}

function konfirmasihapus(url){
	var url;
	if (window.confirm("Anda Yakin ingin MENGHAPUS DATA ?")){
		setTimeout("keurl('"+url+"');",0);
	}
}

function CallPrint(strid){
	<!-- Grabs the area selected from div tag ...-->
	var prtContent = document.getElementById(strid);
	var WinPrint = window.open('','','letf=10,top=10,width="450",height="250",toolbar=1,scrollbars=1,status=0');
	
	<!-- Applying the css and title for the print document...-->
	
	WinPrint.document.write("<html><head><LINK rel=\"stylesheet\" type\"text/css\" href=\"css/print.css\" media=\"print\"><LINK rel=\"stylesheet\" type\"text/css\" href=\"css/print.css\" media=\"screen\"></head><body>");
	
	WinPrint.document.write(prtContent.innerHTML);
	WinPrint.document.write("</body></html>");
	WinPrint.document.close();
	WinPrint.focus();
	WinPrint.print();
	WinPrint.close();
}

function ajaxFunction(acn,pil,addinfo){
	var xmlHttp;
	try {
  		// Firefox, Opera 8.0+, Safari
  		xmlHttp=new XMLHttpRequest();
  	} catch (e) {
  		// Internet Explorer
  		try {
    		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    	} catch (e) {
    		try {
      			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      		} catch (e){
      			alert("Your browser does not support AJAX!");
      			return false;
      		}
    	}
  	}

	document.getElementById("loadcity").style.display="block";

  	xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState==4){
			if (xmlHttp.status == 200) {
				var response = xmlHttp.responseText;
				var list=document.getElementById("kota");
				while (list.childNodes[0]) {
					list.removeChild(list.childNodes[0])
				}
				var cities=response.split('|');
				for (i=1; i<cities.length; i++) {
					var x=document.createElement('option');
					var y=document.createTextNode(cities[i]);
					x.appendChild(y);
					list.appendChild(x);
				}
				document.getElementById("loadcity").style.display="none";
				document.getElementById("dispkota").style.display="block";
			}      	
		}
    }
	if (addinfo=="kotaapasaja"){
  		xmlHttp.open("GET","process/listcities1.php?a="+acn,true);
	} else {
		xmlHttp.open("GET","process/listcities.php?a="+acn,true);
	}
  	xmlHttp.send(null);
}

function checkload(kts){
	if (document.getElementById("provinsi").value!=""){
		document.getElementById("dispkota").style.display="block";
		document.getElementById("loadcity").style.display="none";
	}
}