function TampilkanSPT()
{
	var tahunpajak = trim(window.document.getElementById("cbotahunpajak").value);
	if (tahunpajak != 0)
	{
		window.document.getElementById("txtCommand").value = "3";
		window.document.getElementById("frmSPT").submit();
	}
	else
	{
		alert("Tahun Pajak belum dipilih.");
		window.document.getElementById("cbotahunpajak").focus();
	}
}

function TampilkanDaftarRekam()
{

	if (ValidasiTampilkan()==true)
	{

		window.document.getElementById("txtCommand").value = "3";
		window.document.getElementById("frmDaftarRekam").submit();

	}
}

function TampilDataNAB()
{

	if (ValidasiTampilkan()==true)
	{

		window.document.getElementById("txtCommand").value = "1";
		window.document.getElementById("frmLookUpDataNAB").submit();

	}
}

function TampilkanDaftarBrgPerKategori()
{

	if (ValidasiTampilkan()==true)
	{

		window.document.getElementById("txtCommand").value = "3";
		window.document.getElementById("FrmLapPerKategoriAmil").submit();

	}
}

function TampilkanDataBarang()
{

	if (ValidasiTampilkan()==true)
	{

		window.document.getElementById("txtCommand").value = "3";
		window.document.getElementById("frmDaftarMuzaki").submit();

	}
}

function pilihemail(email,txtemail)
{
var emailasli = trim(window.document.getElementById(email).value);
var txtemailasli = trim(window.document.getElementById(txtemail).value);

var iLen = String(trim(window.document.getElementById(email).value)).length;
var iLen1 = String(trim(window.document.getElementById(txtemail).value)).length;
var email1 = String(trim(window.document.getElementById(email).value)).substring(iLen, iLen - 1);
var txtemail1 = String(trim(window.document.getElementById(txtemail).value)).substring(iLen1, iLen1 - 1);
	
if (txtemail1 == ';')
	{
		window.document.getElementById("txtemailpenerima").value = txtemailasli + " " + emailasli;
		/*window.document.getElementById("txtCommand").value = "1";
		window.document.getElementById("frmDaftarRekam").submit();*/
		
	}	
	else{
		window.document.getElementById("txtemailpenerima").value = txtemailasli + " " + emailasli;
		/*window.document.getElementById("txtCommand").value = "1";
		window.document.getElementById("frmDaftarRekam").submit();*/
		}
}

function ValidasiTampilkan()
{

	if (validasiTanggal('tbTglByrAwal') != "1")
	{
		return false;
	}
	if (validasiTanggal('tbTglByrAkhir') != "1")
	{
		return false;
	}
	
	return true;
}

function isikelurahan()
{
	var kelurahan = trim(window.document.getElementById("cbokelurahan").value);
	if (kelurahan != 0)
	{
		window.document.getElementById("txtKelurahan").value = kelurahan;
	}
	else
	{
		window.document.getElementById("txtKelurahan").value = '';
		
	}
		
}

function KonfSetoran()
{
	if (ValidasiKonfSetoran()==true)
	{
		window.document.getElementById("txtCommand").value = "1";
		window.document.getElementById("frmKonfSetoran").submit();
	}
}


function HapusUbahLinkBerita()
{
		window.document.getElementById("txtCommand").value = "2";
		window.document.getElementById("frmUbahLinkBerita").submit();

}

function SimpanUbahLinkBerita()
{
	if (ValidasiUbahLinkBerita()==true)
	{
		window.document.getElementById("txtCommand").value = "1";
		window.document.getElementById("frmUbahLinkBerita").submit();
	}
}

function LihatPolling()
{

		window.document.getElementById("txtCommand").value = "2";
		window.document.getElementById("frmPolling").submit();

}

function OkDefaultLayar()
{

		window.document.getElementById("txtCommand").value = "1";
		window.document.getElementById("frmKonfLogin").submit();

}

function SimpanPolling()
{

		window.document.getElementById("txtCommand").value = "1";
		window.document.getElementById("frmPolling").submit();

}

function ValidasiUbahLinkBerita()
{
	var keterangan = trim(window.document.getElementById("txtKeterangan").value);
	var link = trim(window.document.getElementById("txtLink").value);
	var myFile = trim(window.document.getElementById("myFile").value);
	
	if (keterangan == "")
	{
		alert("Keterangan harus diisi");
		window.document.getElementById("txtKeterangan").focus();
		return false;
	}	
	
	if (link == "")
	{
		alert("Link harus diisi");
		window.document.getElementById("txtLink").focus();
		return false;
	}	

	return true;
}

function HapusUbahTestimonial()
{
		window.document.getElementById("txtCommand").value = "2";
		window.document.getElementById("frmTestimonial").submit();

}

function SimpanUbahTestimonial()
{
	if (ValidasiUbahTestimonial()==true)
	{
		window.document.getElementById("txtCommand").value = "1";
		window.document.getElementById("frmTestimonial").submit();
	}
}

function ValidasiUbahTestimonial()
{
	var keterangan = trim(window.document.getElementById("txtKeterangan").value);
	var myFile = trim(window.document.getElementById("myFile").value);
	
	if (keterangan == "")
	{
		alert("Keterangan harus diisi");
		window.document.getElementById("txtKeterangan").focus();
		return false;
	}	
	

	return true;
}

function ValidasiKonfSetoran()
{
	if (window.document.getElementById("chkBerulang").checked==true)
	{
		

		if (trim(window.document.getElementById("tbTglByrAwal").value) == 0)
		{
		alert("Tanggal mulai Pembayaran Perulang belum diisi");
		window.document.getElementById("tbTglByrAwal").focus();
		return false;
		}
						
		if (trim(window.document.getElementById("tbTglByrAkhir").value) == 0)
		{
		alert("Tanggal berakhir Pembayaran Perulang belum diisi");
		window.document.getElementById("tbTglByrAkhir").focus();
		return false;
		}
		
		if (trim(window.document.getElementById("cboPeriodeUlang").value) == 0)
		{
			alert("Periode Pembayaran belum dipilih");
			window.document.getElementById("cboPeriodeUlang").focus();
			return false;
		}
		else
		{
			if (trim(window.document.getElementById("cboTanggal").value) == 0)
			{
				alert("Tanggal Pembayaran belum dipilih");
				window.document.getElementById("cboTanggal").focus();
				return false;
			}
			if (trim(window.document.getElementById("cboPeriodeUlang").value) == 2)
			{
				//if (window.document.getElementById("cboBulan").innerHTML != '')
				//{
					if (trim(window.document.getElementById("cboBulan").value) == 0)
					{
						alert("Bulan Pembayaran belum dipilih");
						window.document.getElementById("cboBulan").focus();
						return false;
					}	
				//}
				
			}
		}
	}
	if (window.document.getElementById("chkEmail").checked==true)
	{
		var email = trim(window.document.getElementById("txtAlamatEmail").value)
		if (email == "")
		{
			alert("Alamat Email belum diisi.");
			window.document.getElementById("txtAlamatEmail").focus();
			return false;
		}
		else
		{
			if (email.indexOf("@")<1)
			{
				alert("Alamat Email tidak valid");
				window.document.getElementById("txtAlamatEmail").focus();
				return false;
			}
			if (email.indexOf(".")<3)
			{
				alert("Alamat Email tidak valid");
				window.document.getElementById("txtAlamatEmail").focus();
				return false;
			}
		}
	}
	return true;
}

function Showcbobulan()
{
	if (window.document.getElementById("chkBerulang").checked==true)
	{
		var pilihan = trim(window.document.getElementById("cboPeriodeUlang").value);
		var isi
		if (pilihan == 2)
		{
			//window.document.getElementById("cboBulan").style.visibility = "visible";
			isi = '<SELECT class="text130" id="cboBulan" style="WIDTH: 152px" runat="server"><option value="0" selected>---- Pilih ----</option><option value="1">Januari</option><option value="2">Februari</option><option value="3">Maret</option><option value="4">April</option><option value="5">Mei</option><option value="6">Juni</option><option value="7">Juli</option><option value="8">Agustus</option><option value="9">September</option><option value="10">Oktober</option><option value="11">November</option><option value="12">Desember</option></SELECT>'
			//window.document.getElementById("spanpilihbulan").innerHTML = isi;
			window.document.getElementById("spanpilihbulan").style.visibility = "visible";
			
		} 
		else 
		{
			//window.document.getElementById("cboBulan").style.visibility = "hidden";
			//window.document.getElementById("spanpilihbulan").innerHTML = '';
			window.document.getElementById("spanpilihbulan").style.visibility = "hidden";
		}
	}
	else
	{
		window.document.getElementById("spanpilihbulan").style.visibility = "hidden";
	}
}

function KirimEmail()
{
	if (window.document.getElementById("chkEmail").checked==true)
	{
		window.document.getElementById("spanlblemail").style.visibility = "visible";
		window.document.getElementById("spanmemail").style.visibility = "visible";
	}
	else
	{
		window.document.getElementById("spanlblemail").style.visibility = "hidden";
		window.document.getElementById("spanmemail").style.visibility = "hidden";
	}
}

function PilihBank(objCbo, objmar)
{
	var bank = trim(window.document.getElementById(objCbo).value);
	if (bank != "0008 Bank Mandiri")
	{
		window.document.getElementById(objmar).innerHTML = "Bank yang dipilih untuk sementara tidak dapat digunakan untuk melakukan pembayaran ZIS";
		window.document.getElementById(objCbo).value = "-- Pilih --";
	}
	else
	{
		window.document.getElementById(objmar).innerHTML = "";
	}
	
}
function PilihAmil(objCbo, objmar)
{

	var amil = trim(window.document.getElementById(objCbo).value);
		
	if (amil == "001 Dompet Dhuafa Republika")
	{
		window.document.getElementById(objmar).innerHTML = "Referensi Tahun 2011 : Kambing Rp. 1.111.000,- /ekor dan Sapi Rp. 8.888.000,- / ekor";
		window.document.getElementById("cboamil").value = amil;
		//window.document.getElementById("frmSetoran").submit();
		
	}
	if (amil == "002 PKPU")
	{
	window.document.getElementById(objmar).innerHTML = "Referensi Tahun 2011 : Kambing Rp. 1.100.000,- /ekor, Sapi Rp. 8.400.000,- / ekor dan 1/7 Sapi Rp. 1.200.000 /orang";
	window.document.getElementById("cboamil").value = amil;
	}
	if (amil == "003 Baitul Maal Hidayatullah")
	{
	window.document.getElementById(objmar).innerHTML = "Referensi Tahun 2011 : Kambing Rp. 1.050.000,-  dan Sapi : Rp. 8.550.000,-/ekor ";
	window.document.getElementById("cboamil").value = amil;
	}
	if (amil == "005 Al-Azhar Peduli Ummat")
	{
	window.document.getElementById(objmar).innerHTML = "Referensi Tahun 2011 : Kambing (> 30 Kg) Rp. 1.515.000,- /ekor dan Sapi (>300 Kg) Rp 10.515.000,- /ekor";
	//window.document.getElementById("txtCommand").value = "2";
		window.document.getElementById("cboamil").value = amil;
		//window.document.getElementById("frmSetoran").submit();
		}
	if (amil == "006 Swadaya Ummah Riau")
	{
	window.document.getElementById(objmar).innerHTML = "Referensi Tahun 2010 : Kambing Rp. 1.200.000,- /ekor dan Sapi Rp.1.200.000,-/org";
	//window.document.getElementById("txtCommand").value = "2";
	window.document.getElementById("cboamil").value = amil;
	//window.document.getElementById("frmSetoran").submit();
		}
	if (amil == "007 Yayasan Dana Sosial Al-Falah")
	{
	window.document.getElementById(objmar).innerHTML = "Referensi Tahun 2011 : Kambing A (30-34 Kg) Rp. 1.400.000,- /ekor, Kambing B (26-29 Kg) Rp. 1.200.000,- /ekor, Kambing C (25 Kg) Rp. 1.000.000,- /ekor, Sapi : 1 Ekor Rp. 10.500.000";
	//window.document.getElementById("txtCommand").value = "2";
	window.document.getElementById("cboamil").value = amil;
	//window.document.getElementById("frmSetoran").submit();
		}
		
		
	
	
}
function PilihQurban(objCbo)
{

	var amil = trim(window.document.getElementById(objCbo).value);
	if (amil == "01 Kambing 25 kg 7,000,000")
	{
	window.document.getElementById("txtCommand").value = "2";
		window.document.getElementById("txtqurban").value = '7,000,000';
		window.document.getElementById("frmSetoran").submit();
		}
		
	
}
function HapusPembayaran(strId, strNRP)
{


	var x = confirm("Hapus NRP " + strNRP + "?" );
	if (x==true)
	{
	window.document.getElementById("txtCommand").value = "2";
	window.document.getElementById("HdId").value = strId;
		window.document.getElementById("HdNRP").value = strNRP;
		window.document.getElementById("frmDaftarRekam").submit();
		}
}

function Carizisbid()
{
	if (trim(window.document.getElementById("txtZisBID").value) == "")
	{
		alert("ZISB Id harus diisi");
		window.document.getElementById("txtZisBID").focus();
	}
	else
	{
		window.document.getElementById("txtCommand").value = "3";
		window.document.getElementById("frmSetoran").submit();
	}
}

function SimpanUbahPassword()
{
	if (ValidasiUbahPassword()==true)
	{
		window.document.getElementById("txtCommand").value = "1";
		window.document.getElementById("frmUbahPassword").submit();
	}
}

function HapusBank_Amil(strIdBank, strNamaBank)
{
	var x = confirm("Hapus " + strNamaBank + "?" );
	if (x==true)
	{
		window.document.getElementById("txtCommand").value = "2";
		window.document.getElementById("hdIdBank").value = strIdBank;
		window.document.getElementById("frmRefAmil_Bank").submit();
	}
}

function SimpanWilayah()
{
	if (ValidasiSimpanWilayah()==true)
	{
		window.document.getElementById("txtCommand").value = "1";
		window.document.getElementById("frmRefWilayah").submit();
	}
}

function HapusWilayah(strIdWilayah, strNamaWilayah)
{
	var x = confirm("Hapus " + strNamaWilayah + "?" );
	if (x==true)
	{
		window.document.getElementById("txtCommand").value = "2";
		window.document.getElementById("HdIdWil").value = strIdWilayah;
		window.document.getElementById("frmRefWilayah").submit();
	}
}

function SimpanBank()
{
	if (ValidasiSimpanBank()==true)
	{
		window.document.getElementById("txtCommand").value = "1";
		window.document.getElementById("frmRefBank").submit();
	}
}

function HapusBank(strIdBank, strNamaBank)
{
	var x = confirm("Hapus " + strNamaBank + "?" );
	if (x==true)
	{
		window.document.getElementById("txtCommand").value = "2";
		window.document.getElementById("HdIdBank").value = strIdBank;
		window.document.getElementById("frmRefBank").submit();
	}
}

function HapusBadanAmil(strIdBadanAmil, strNamaBadanAmil, strKodeBadanAmil)
{
	var x = confirm("Hapus " + strNamaBadanAmil + "?" );
	if (x==true)
	{
		window.document.getElementById("txtCommand").value = "2";
		window.document.getElementById("hdIdbadanamil").value = strIdBadanAmil;
		window.document.getElementById("HdKodeBadanAmil").value = strKodeBadanAmil;
		window.document.getElementById("frmRefAmil").submit();
	}
}

function SimpanBadanAmil()
{
	if (ValidasiSimpanBadanAmil()==true)
	{
		window.document.getElementById("txtCommand").value = "1";
		window.document.getElementById("frmRefAmil").submit();
	}

}

function HapusAdminAmil(strZisbId)
{
	var x = confirm("Hapus Admin " + strZisbId + "?" );
	if (x==true)
	{
		window.document.getElementById("txtCommand").value = "2";
		window.document.getElementById("Hdzisbid").value = strZisbId;
		window.document.getElementById("frmAdminAmil").submit();
	}
}

function SimpanAdminAmil()
{
	if (ValidasiAdminAmil()==true)
	{
		window.document.getElementById("txtCommand").value = "1";
		window.document.getElementById("frmAdminAmil").submit();
	}
}

function simpanPassword()
{
	if (ValidasiGetPassword()==true)
	{
		window.document.getElementById("txtCommand").value = "1";
		window.document.getElementById("frmLupaPassword").submit();
	}
}

function simpanSetoran()
{
	if (ValidasiSimpanSetoran()==true)
	{
		window.document.getElementById("txtCommand").value = "1";
		window.document.getElementById("frmSetoran").submit();
	}
}

function simpanRegKonfirmasi()
{
	if (ValidasiSimpanRegKonfirmasi()==true)
	{
		
		window.document.getElementById("txtCommand").value = "1";
		window.document.getElementById("frmRegKonfirmasi").submit();
	}
}

function simpanRegPassword()
{
	if (ValidasiSimpanPassword()==true)
	{
		window.document.getElementById("txtCommand").value = "1";
		window.document.getElementById("frmRegPassword").submit();
	}
}

function simpanRegLembaga()
{
	if (ValidasiSimpanLembaga()==true)
	{
		window.document.getElementById("txtCommand").value = "1";
		window.document.getElementById("frmRegLembaga").submit();
	}
}

function simpanRegIndividu()
{
	if (ValidasiSimpanIndividu()==true)
	{
		window.document.getElementById("txtCommand").value = "1";
		window.document.getElementById("frmRegIndividu").submit();
	}
}

function ValidasiUbahPassword()
{
	var pwd1 = trim(window.document.getElementById("txtPwd1").value);
	var pwd2 = trim(window.document.getElementById("TxtPwd2").value);
	
	if (pwd1 == "")
	{
		alert("Password harus diisi");
		window.document.getElementById("txtPwd1").focus();
		return false;
	}	
	
	if (pwd2 == "")
	{
		alert("Konfirmasi Password harus diisi");
		window.document.getElementById("TxtPwd2").focus();
		return false;
	}	
	else
	{
		if (pwd1 != pwd2)
		{
			alert("Konfirmasi Password tidak sama dengan password yang diinput");
			window.document.getElementById("TxtPwd2").focus();
			return false;
		}
	}
	
	return true;
}

function ValidasiSimpanWilayah()
{
	var idwilayah = trim(window.document.getElementById("txtIdWilayah").value);
    var nama = trim(window.document.getElementById("txtNama").value);
    
    if (idwilayah == "")
	{
		alert("ID Wilayah harus diisi");
		window.document.getElementById("txtIdWilayah").focus();
		return false;
	}	
	
	if (nama == "")
	{
		alert("Nama Wilayah harus diisi");
		window.document.getElementById("txtNama").focus();
		return false;
	}	
	
	return true;
     
}

function ValidasiSimpanBank()
{
	var idbank = trim(window.document.getElementById("txtIdBank").value);
	var nama = trim(window.document.getElementById("txtNama").value);
	
	if (idbank == "")
	{
		alert("ID Bank harus diisi");
		window.document.getElementById("txtIdBank").focus();
		return false;
	}	
	
	if (nama == "")
	{
		alert("Nama Bank harus diisi");
		window.document.getElementById("txtNama").focus();
		return false;
	}	
	
	return true;
}

function ValidasiSimpanBadanAmil()
{
	var idamil = trim(window.document.getElementById("txtIdAmil").value);
	var nama = trim(window.document.getElementById("txtNama").value);
	
	if (idamil=="")
	{
		alert("ID Badan Amil harus diisi");
		window.document.getElementById("txtIdAmil").focus();
		return false;
	}
	
	if (nama == "")
	{
		alert("Nama Badan Amil harus diisi");
		window.document.getElementById("txtNama").focus();
		return false;
	}
	         
	return true;
}

function ValidasiAdminAmil()
{
	var zisbid = trim(window.document.getElementById("txtzisbId").value);
	var nama = trim(window.document.getElementById("txtNama").value);
	var pwd1 = trim(window.document.getElementById("txtPwd1").value);
	var pwd2 = trim(window.document.getElementById("TxtPwd2").value);
	
	if (zisbid == "" )
	{
		alert("ZisB ID harus diisi");
		window.document.getElementById("txtZisbID").focus();
		return false;
	}
	
	if (nama == "" )
	{
		alert("Nama harus diisi");
		window.document.getElementById("txtNama").focus();
		return false;
	}
	
	if (pwd1 == "" )
	{
		alert("Password harus diisi");
		window.document.getElementById("txtPwd1").focus();
		return false;
	}
	
	if (pwd2 == "" )
	{
		alert("Konfirmasi password harus diisi");
		window.document.getElementById("txtPwd2").focus();
		return false;
	}
	else
	{
		if (pwd1 != pwd2)
		{
			alert("Konfirmasi password tidak sama dengan password yang diinputkan");
			window.document.getElementById("txtPwd2").focus();
			return false;
		}
	}
	
	return true;
}

function ValidasiGetPassword()
{
	var zisbid = trim(window.document.getElementById("txtZisbID").value);
	var pwdhint = trim(window.document.getElementById("cboHint").value);
	var hintans = trim(window.document.getElementById("txtHintAnswer").value);
	var email = trim(window.document.getElementById("txtEmail1").value);
	
	if (zisbid == "" )
	{
		alert("ZisB ID harus diisi");
		window.document.getElementById("txtZisbID").focus();
		return false;
	}
	
	if (pwdhint == "--Pilih--" )
	{
		alert("Password Hint harus diisi");
		window.document.getElementById("cboHint").focus();
		return false;
	}
	
	if (hintans == "" )
	{
		alert("Jawaban jika lupa password harus diisi");
		window.document.getElementById("txtHintAnswer").focus();
		return false;
	}
	
	if (email == "")
	{
		alert("Alamat Email harus diisi");
		window.document.getElementById("txtEmail1").focus();
		return false;
	}
	else
	{
		if (email.indexOf("@")<1)
		{
			alert("Alamat Email tidak valid");
			window.document.getElementById("txtEmail1").focus();
			return false;
		}
		if (email.indexOf(".")<3)
		{
			alert("Alamat Email tidak valid");
			window.document.getElementById("txtEmail1").focus();
			return false;
		}
	}
	
	return true;
}

function ValidasiSimpanSetoran()
{
	var zisbid = trim(window.document.getElementById("txtZisBID").value);
	var nama = trim(window.document.getElementById("txtNama").value);
	var amil = trim(window.document.getElementById("cboAmil").value);
	var total = trim(window.document.getElementById("txtTotal").value);
	var zfitrah = trim(window.document.getElementById("txtzFitrah").value);
	var ketzfitrah = trim(window.document.getElementById("txtKetzakatFitrah").value);
	var infaq = trim(window.document.getElementById("txtInfaq").value);
	var ketinfaq = trim(window.document.getElementById("txtKetInfaq").value);
	var qurban = trim(window.document.getElementById("txtQurban").value);
	var ketqurban = trim(window.document.getElementById("txtNamaPequrban").value);
	
	if (zisbid == "")
	{
		alert("ZISB Id harus diisi");
		window.document.getElementById("txtZisBID").focus();
		return false;
	}
	
	if (nama == "")
	{
		alert("Nama harus diisi");
		return false;
	}
	
	if (amil == "----- Silahkan pilih Amil -----")
	{
		alert("Badan Amil harus dipilih");
		return false;
	}
	
	if ((total == "0") || (total == ""))
	{
		alert("Total setoran harus lebih besar dari 0");
		window.document.getElementById("txtzMall").focus();
		return false;
	}
	
	if ((zfitrah != "") && (zfitrah != "0"))
	{
		if ((trim(ketzfitrah) == '') || (trim(ketzfitrah) == '(Diisi dengan nama pihak yang dibayarkan zakat fitrahnya)'))
		{
			alert("Keterangan zakat fitrah belum diisi");
			window.document.getElementById("txtKetzakatFitrah").focus();
			return false;
		}
	}	
	
/*	if ((infaq != "") && (infaq != "0"))
	{
		if (trim(ketinfaq) == '')
		{
			alert("Keterangan Infaq belum diisi");
			window.document.getElementById("txtKetInfaq").focus();
			return false;
		}
	}	*/
	
	if ((qurban != "") && (qurban != "0"))
	{
		if ((trim(ketqurban) == '') || (trim(ketqurban) == '(Diisi dengan nama pihak yang dibayarkan qurbannya, dan hewan yang diqurbankan)'))
		{
			alert("Keterangan qurban belum diisi");
			window.document.getElementById("txtNamaPequrban").focus();
			return false;
		}
	}
	
	return true;
}

function ValidasiSimpanRegKonfirmasi()
{
	var bank = trim(window.document.getElementById("CboBank1").value);
	if (bank == "-- Pilih --")
	{
		alert("Nama Bank belum dipilih");
		window.document.getElementById("CboBank1").focus();
		return false;
	}
	
	return true;
}

function ValidasiSimpanPassword()
{
	var pwd = trim(window.document.getElementById("txtPassword").value);
	var konpwd = trim(window.document.getElementById("txtKonfPass").value);
	var hint = trim(window.document.getElementById("cboHint").value);
	var ans = trim(window.document.getElementById("txtHintAnswer").value);

	if (pwd == "")
	{
		alert("Password belum diisi");
		window.document.getElementById("txtPassword").focus();
		return false;
	}
	else
	{
		if (pwd.length < 6)
		{
			alert("Panjang password minimal 6 digit");
			window.document.getElementById("txtPassword").focus();
			return false;
		}
	}
	
	if (konpwd == "")
	{
		alert("Konfirmasi Password belum diisi");
		window.document.getElementById("txtKonfPass").focus();
		return false;
	}
	else
	{
		if (pwd != konpwd)
		{
			alert("Konfirmasi Password tidak sama dengan Password yang diinput")
			window.document.getElementById("txtKonfPass").focus();
			return false;
		}
	}
	
	if (hint=="---- Pilih ----" )
	{
		alert("Petunjuk Jika Lupa Password belum diisi");
		window.document.getElementById("cboHint").focus();
		return false;
	}
		
	if (ans == "")
	{
		alert("Jawaban Jika lupa password belum diisi");
		window.document.getElementById("txtHintAnswer").focus();
		return false;
	}
	
	return true;
}

function ValidasiSimpanLembaga()
{
	var nama = trim(window.document.getElementById("txtNama").value);
	var alamat = trim(window.document.getElementById("txtAlamat").value);
	var kodepos = trim(window.document.getElementById("txtKodePos").value);
	var kelurahan = trim(window.document.getElementById("txtKelurahan").value);
	var kodearea = trim(window.document.getElementById("txtkdtelp1").value);
	var notelp = trim(window.document.getElementById("txtNoTelp").value);
	var bank = trim(window.document.getElementById("cboBank1").value);
	var contak = trim(window.document.getElementById("txtCP").value);
	var email = trim(window.document.getElementById("txtEmail1").value);
	var email2 = trim(window.document.getElementById("txtEmail2").value);
	
	if (nama == "")
	{
		alert("Nama belum diisi");
		window.document.getElementById("txtNama").focus();
		return false;
	}
	
	if (alamat == "")
	{
		alert("Alamat belum diisi");
		window.document.getElementById("txtAlamat").focus();
		return false;
	}
	
	if (kodepos == "")
	{
		alert("Kode Pos belum diisi");
		window.document.getElementById("txtKodePos").focus();
		return false;
	}
	else
	{
		getreadytolook('10' ,'txtKodePos','txtKodePos','txtKodePos','spnKodePos','0', 'txtKodePosHide');
	}
	
	if(kelurahan == "")
	{
		alert("Kelurahan belum diisi");
		return false;
	}
	
	if (kodearea == "")
	{
		alert("Kode area Nomor Telepon belum diisi");
		window.document.getElementById("txtkdtelp1").focus();
		return false;
	}
	
	if (notelp == "")
	{
		alert("Nomor Telepon belum diisi");
		window.document.getElementById("txtNoTelp").focus();
		return false;
	}
	
	if (bank == "-- Pilih --")
	{
		alert("Nama Bank belum dipilih");
		window.document.getElementById("cboBank1").focus();
		return false;
	}
	
	if (contak == "")
	{
		alert("Contact Person belum diisi");
		window.document.getElementById("txtCP").focus();
		return false;
	}
	
	
	/*if (email == "")
	{
		alert("Alamat Email belum diisi");
		window.document.getElementById("txtEmail1").focus();
		return false;
	}
	else */
	if (email != "")
	{
		if (email.indexOf("@")<1)
		{
			alert("Alamat Email tidak valid");
			window.document.getElementById("txtEmail1").focus();
			return false;
		}
		if (email.indexOf(".")<3)
		{
			alert("Alamat Email tidak valid");
			window.document.getElementById("txtEmail1").focus();
			return false;
		}
	}
	
	if (email2 != "")
	{
		if (email2.indexOf("@")<1)
		{
			alert("Alamat Email tidak valid");
			window.document.getElementById("txtEmail2").focus();
			return false;
		}
		if (email2.indexOf(".")<3)
		{
			alert("Alamat Email tidak valid");
			window.document.getElementById("txtEmail2").focus();
			return false;
		}
	}
	
	return true;
}

function ValidasiSimpanIndividu()
{
	var nama = trim(window.document.getElementById("txtNama").value);
	var alamat = trim(window.document.getElementById("txtAlamat").value);
	var kodepos = trim(window.document.getElementById("txtKodePos").value);
	var kelurahan = trim(window.document.getElementById("txtKelurahan").value);
	var jk = trim(window.document.getElementById("cboJk").value);
	var tempatlahir = trim(window.document.getElementById("txtTempatLahir").value);
	var tgllahir = trim(window.document.getElementById("txtTglLahir").value);
	var pekerjaan = trim(window.document.getElementById("txtPekerjaan").value);
	var kodearea = trim(window.document.getElementById("txtkdtelp1").value);
	var notelp = trim(window.document.getElementById("txtNoTelp").value);
	var email = trim(window.document.getElementById("txtEmail1").value);
	var email2 = trim(window.document.getElementById("txtEmail2").value);
	var bank = trim(window.document.getElementById("cboBank1").value);
	
	if (nama == "")
	{
		alert("Nama belum diisi");
		window.document.getElementById("txtNama").focus();
		return false;
	}
	
	if (alamat == "")
	{
		alert("Alamat belum diisi");
		window.document.getElementById("txtAlamat").focus();
		return false;
	}
	
	if (jk == "- Pilih -")
	{
		alert("Jenis Kelamin belum diisi");
		window.document.getElementById("cboJk").focus();
		return false;
	}
	
	if (kodepos == "")
	{
		alert("Kode Pos belum diisi");
		window.document.getElementById("txtKodePos").focus();
		return false;
	}
	else
	{
		getreadytolook('10' ,'txtKodePos','txtKodePos','txtKodePos','spnKodePos','0', 'txtKodePosHide');
	}
	
	if(kelurahan == "")
	{
		alert("Kelurahan belum diisi");
		return false;
	}
	
	if (tempatlahir == "")
	{
		alert("Tempat Lahir belum diisi");
		window.document.getElementById("txtTempatLahir").focus();
		return false;
	}
	
	if (tgllahir == "")
	{
		alert("Tanggal Lahir belum diisi");
		window.document.getElementById("txtTglLahir").focus();
		return false;
	}
	
	if (pekerjaan == "")
	{
		alert("Pekerjaan belum diisi");
		window.document.getElementById("txtPekerjaan").focus();
		return false;
	}
	
	
	if (kodearea == "")
	{
		alert("Kode area Nomor Telepon belum diisi");
		window.document.getElementById("txtkdtelp1").focus();
		return false;
	}
	
	if (notelp == "")
	{
		alert("Nomor Telepon belum diisi");
		window.document.getElementById("txtNoTelp").focus();
		return false;
	}
	
	/*if (email == "")
	{
		alert("Alamat Email belum diisi");
		window.document.getElementById("txtEmail1").focus();
		return false;
	}
	else*/
	if (email != "")
	{
		if (email.indexOf("@")<1)
		{
			alert("Alamat Email tidak valid");
			window.document.getElementById("txtEmail1").focus();
			return false;
		}
		if (email.indexOf(".")<3)
		{
			alert("Alamat Email tidak valid");
			window.document.getElementById("txtEmail1").focus();
			return false;
		}
	}
	
	if (email2 != "")
	{
		if (email2.indexOf("@")<1)
		{
			alert("Alamat Email tidak valid");
			window.document.getElementById("txtEmail2").focus();
			return false;
		}
		if (email2.indexOf(".")<3)
		{
			alert("Alamat Email tidak valid");
			window.document.getElementById("txtEmail2").focus();
			return false;
		}
	}
	
	if (bank == "-- Pilih --")
	{
		alert("Nama Bank belum dipilih");
		window.document.getElementById("cboBank1").focus();
		return false;
	}
	
	if (validasiTanggal('txtTglLahir') != "1")
	{
		return false;
	}
	
	if 	(window.document.getElementById("RDKores2").checked == true)
	{
		var kantor = trim(window.document.getElementById("txtAlamatKantor").value);
		if (kantor == "")
		{
			alert("Alamat Kantor untuk korespondensi belum diisi");
			window.document.getElementById("txtAlamatKantor").focus();
			return false;
		}
	
	} 

	
	return true;
}

function HideKeterangan(txtobj)
{
	var isi = trim(window.document.getElementById(txtobj).value);
	
	if ((isi == "(Diisi dengan nama pihak yang dibayarkan zakat fitrahnya)") ||
		(isi == "(Dapat diisi secara bebas)") ||
		(isi == "(Diisi dengan nama pihak yang dibayarkan qurbannya, dan hewan yang diqurbankan)"))
	{
		window.document.getElementById(txtobj).value = "";
	}
	
}


function SimpanBarang1()
{
		window.document.getElementById("txtCommand").value = "1";
		window.document.getElementById("frmDaftarRekam").submit();
	
}

function SimpanBarang2()
{
		window.document.getElementById("txtCommand").value = "2";
		window.document.getElementById("frmDaftarRekam").submit();
	
}

function SimpanSepakat1()
{
		window.document.getElementById("txtCommand").value = "4";
		window.document.getElementById("frmRekamKonfirmasiAmilAmbil").submit();
	
}

function SimpanSepakat2()
{
		window.document.getElementById("txtCommand").value = "5";
		window.document.getElementById("frmRekamKonfirmasiAmilAmbil").submit();
	
}


function UpdateStatusNTB()
{
		window.document.getElementById("txtCommand").value = "1";
		window.document.getElementById("frmRekamUpdateStatusNAB").submit();
	
}

function Showalamat()
{
	if(window.document.getElementById("StatusAlamatAmbilrumah").checked==true)
	{	
		window.document.getElementById("StatusAlamatAmbillainnya").checked=false;
		window.document.getElementById("StatusAlamatAmbilkantor").checked=false;
		
		window.document.getElementById("txtCommand").value = "1";
		window.document.getElementById("frmRekamKonfirmasiAmilAmbil").submit();

			
	}
	else 
	if(window.document.getElementById("StatusAlamatAmbilkantor").checked==true)
	{	
		window.document.getElementById("StatusAlamatAmbillainnya").checked=false;
		window.document.getElementById("StatusAlamatAmbilrumah").checked=false;	
		
		window.document.getElementById("txtCommand").value = "2";
		window.document.getElementById("frmRekamKonfirmasiAmilAmbil").submit();	
		
					
	
	}
		else
		 if (window.document.getElementById("StatusAlamatAmbillainnya").checked==true)
		 {
		window.document.getElementById("StatusAlamatAmbilkantor").checked=false;		
		window.document.getElementById("StatusAlamatAmbilrumah").checked=false;
		
		window.document.getElementById("txtCommand").value = "3";
		window.document.getElementById("frmRekamKonfirmasiAmilAmbil").submit();
		
			
						
	}	
	else
	{
		window.document.getElementById("Spantempat").style.visibility = "hidden";
					
	}
}

function Showspanpilihambil()
{

	 if(window.document.getElementById("StatusAlamatAmbilrumah").checked==true)
	{	
	window.document.getElementById("StatusAlamatAmbillainnya").checked=false;
			window.document.getElementById("StatusAlamatAmbilkantor").checked=false;	
			window.document.getElementById("Spantempat").style.visibility = "hidden";
			
	}
	else 
	if(window.document.getElementById("StatusAlamatAmbilkantor").checked==true)
	{	
		window.document.getElementById("StatusAlamatAmbillainnya").checked=false;
			window.document.getElementById("StatusAlamatAmbilrumah").checked=false;		
			window.document.getElementById("Spantempat").style.visibility = "hidden";			
	
	}
		else
		 if (window.document.getElementById("StatusAlamatAmbillainnya").checked==true)
		 {
		window.document.getElementById("Spantempat").style.visibility = "visible";
	
		window.document.getElementById("StatusAlamatAmbilkantor").checked=false;
		
		window.document.getElementById("StatusAlamatAmbilrumah").checked=false;
					
	}	
	else
	{
		window.document.getElementById("Spantempat").style.visibility = "hidden";
					
	}
	
}

function KonfBarangSelanjutnya()
{
	
		window.document.getElementById("txtCommand").value = "3";
		window.document.getElementById("frmDaftarRekam").submit();
	
}

function KonfBarangSebelumnya()
{
	
		window.document.getElementById("txtCommand").value = "4";
		window.document.getElementById("frmDaftarRekam").submit();
	
}


function RekamBarangAmbilPaketNext()
{
	
		window.document.getElementById("txtCommand").value = "3";
		window.document.getElementById("frmDaftarRekam").submit();
	
}

function Showcbostatusambilbarang(objcbo)
{
	

	var pilihan = trim(window.document.getElementById(objcbo).value);
		var isi
		if (pilihan == 2)
		{
			window.document.getElementById("spanpilihambil").style.visibility = "visible";
			window.document.getElementById("Spantempat").style.visibility = "hidden";
			
			} 
		else 
		{
			window.document.getElementById("spanpilihambil").style.visibility = "hidden";
			window.document.getElementById("Spantempat").style.visibility = "hidden";
			
		}
	
}

function ShowKeterangan(txtobj)
{
	var isi = trim(window.document.getElementById(txtobj).value);
	
	if (isi == "")
	{
		if (txtobj == "txtKetzakatFitrah")
		{
			window.document.getElementById(txtobj).value = "(Diisi dengan nama pihak yang dibayarkan zakat fitrahnya)";
		}
		
		if (txtobj == "txtKetInfaq")
		{
			window.document.getElementById(txtobj).value = "(Dapat diisi secara bebas)";
		}
		
		if (txtobj == "txtNamaPequrban")
		{
			window.document.getElementById(txtobj).value = "(Diisi dengan nama pihak yang dibayarkan qurbannya, dan hewan yang diqurbankan)";
		}
		
		
	}
}



