function cek_currency(doc_name) {
		if (doc_name.id_ref_currency.value != 3 ) {
		doc_name.harga.disabled = false;
		doc_name.harga.style.background = "#ffffff";			
		} else {
			doc_name.harga.value = "";
			doc_name.harga.disabled = true;
			doc_name.harga.style.background = "#cccccc";
		}
	}

function cek_hapus(doc_name) {
				
		if (confirm("Apakah Anda yakin ingin menghapus data ini?")) {
			
			del = doc_name.FormAction.value = 'delete';
			return true;
			submit(del);
		} else return false;
}

function cek_hapus_prop(doc_name) {
				
		if (confirm("Apakah Anda yakin ingin menghapus data ini?")) {
			
			del = doc_name.FormAction.value = 'hapus';
			return true;
			submit(del);
		} else return false;
}

function cek_hapus_email(doc_name) {
				
		if (confirm("Apakah Anda yakin ingin menghapus pesan ini?")) {
			
			del = doc_name.FormAction.value = 'hapus';
			return true;
			submit(del);
		} else return false;
}

function cek_terjual_prop(doc_name) {
				
		if (confirm("Apakah Anda yakin mobil ini sudah terjual?")) {
			
			del = doc_name.FormAction.value = 'terjual';
			return true;
			submit(del);
		} else return false;
}

function cek_update_prop(doc_name) {
				
		if (confirm("   Apakah Anda akan MENG-UPDATE mobil ini? \n\n ( Hanya IKLAN ISTIMEWA yang dapat diupdate )   \n")) {
			
			del = doc_name.FormAction.value = 'insert';
			return true;
			submit(del);
		} else return false;
}

function cek_kirim_pesan(doc_name) {
				
		if (confirm("   Apakah Anda akan mengirim email ini? \n\n\n")) {
			
			del = doc_name.FormAction.value = 'insert';
			return true;
			submit(del);
		} else return false;
}

_editor_url = "editor/";                     
var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
if (navigator.userAgent.indexOf('Mac')        >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Opera')      >= 0) { win_ie_ver = 0; }
if (win_ie_ver >= 5.5) {
  document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"');
  document.write(' language="Javascript1.2"></scr' + 'ipt>');  
} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }

var id_cat=0;
function ganti_cat()
{
	id_cat=the_record.id_dir_cat.value;
}

function buka_win_cat()
{
window.open('product_pick.php?s_cat='+id_cat,'Directory','location=yes,toolbar=no,status=yes,scrollbars=yes,resizeable=yes,width=800,height=600');
}

function setMaxLength(Object, MaxLen)
{
  return (Object.value.length <= MaxLen);
}

function cek_upgrade_iklan()
{
  var check = document.getElementById("is_special");
	if (check.checked == true)
		{alert("Anda telah mengupgrade iklan, sebelum iklan kami tayangkan mohon melakukan pembayaran terlebih dahulu dan mengkonfirmasikan pembayaran yang telah anda lakukan");}
else
{
alert("Untuk mengupgrade iklan, silahkan centang kotak iklan istimewa. Setelah itu baru menekan tombol upgrade untuk membatalkan klik tombol batal");
//window.location="{SITE_HOST}upgrade_iklan.php?section=upgrade_iklan&id_mobil={id_mobil}";}
}
}

function validate(x)
{
var checkedButton;

// Figure out which radio button was pressed

checkedButton = findValue(x.tipe_member);

var varPerorangan = x.perorangan.value;
var varAgenMobil = x.agen_mobil.value;
}

function vanishHidden(doWhat)
{
// Check if the getElementById method is available
if (document.getElementById)
{
document.getElementById("hideAgent").style.display = doWhat;
document.getElementById("hideBranch").style.display = doWhat;
}
else if (document.all)
{
alert("Running an older version of IE.");
document.all.hideAgent.style.display = doWhat;
document.all.hideBranch.style.display = doWhat;
}
else
{ alert("Cannot change visibility of address field"); }
}

function vanishHidden2(doWhat)
{
// Check if the getElementById method is available
if (document.getElementById)
{
	alert(document.getElementById);
	alert(doWhat);
document.getElementById("hideEmail").style.display = doWhat;
}
else if (document.all)
{
alert("Running an older version of IE.");
document.all.hideEmail.style.display = doWhat;
}
else
{ alert("Cannot change visibility of address field"); }
}

// See which radio button is selected and return its value
function findValue(obj)
{
var i, theValue;
theValue = null;

for (i=0;i<obj.length;i++)
{
if (obj[i].checked == true)
{
theValue = obj[i].value;
break;
}
}

return theValue;
}

function highlight(teks)
{
	document.getElementById("login").style.display = 'none';}


function detectBrowser(){
var browser=navigator.appName
var version=parseFloat(navigator.appVersion.split("MSIE")[1])

}
