function change_language(url,lang) {
	var object = document.lang;
	var url_lang = new Array("?lang=id","&lang=id");
	for(i=0;i<2;i++) {
		url = url.replace(url_lang[i],"");
	}
	if(lang == "id") {
		parent.location.href = url+"&lang=id";
	} else {
		parent.location.href = url;
	}
}

function select_page(url,page) {
	parent.location.href = url+"&page="+page.value;
}

function reset_value(form_name,input_name) {
	var object = eval("document."+form_name+";");
	eval("object."+input_name+".value = '';");
}

function form_login(form_name,language) {
	var object = eval("document."+form_name);
	if(language == "id") {
		if(object.username.value == "") {
			alert("Masukkan username anda!");
			object.username.focus();
			return false;
		}
		if(object.password.value == "") {
			alert("Masukkan password anda!");
			object.password.focus();
			return false;
		}
	} else {
		if(object.username.value == "") {
			alert("Insert your username!");
			object.username.focus();
			return false;
		}
		if(object.password.value == "") {
			alert("Insert your password!");
			object.password.focus();
			return false;
		}
	}
}

function form_forget_username(form_name,language) {
	var object = eval("document."+form_name);
	if(language == "id") {
		if(object.email.value == "" || object.email.value == "Alamat e-mail anda...") {
			alert("Masukkan e-mail anda!");
			object.email.focus();
			return false;
		}
	} else {
		if(object.email.value == "" || object.email.value == "Your e-mail address...") {
			alert("Insert your e-mail address!");
			object.email.focus();
			return false;
		}
	}
}

function form_forget_password(form_name,language) {
	var object = eval("document."+form_name);
	if(language == "id") {
		if(object.username.value == "" || object.username.value == "Username anda...") {
			alert("Masukkan username anda!");
			object.username.focus();
			return false;
		}
	} else {
		if(object.username.value == "" || object.username.value == "Your username...") {
			alert("Insert your username!");
			object.username.focus();
			return false;
		}
	}
}

function form_signup_membership(form_name,language,type) {
	var object = eval("document."+form_name);
	if(language == "id") {
		if(object.full_name.value == "") {
			alert("Masukkan nama lengkap anda!");
			object.full_name.focus();
			return false;
		}
		if(object.nick_name.value == "") {
			alert("Masukkan nama pendek atau nama panggilan anda!");
			object.nick_name.focus();
			return false;
		}
		if(object.place_of_birth.value == "") {
			alert("Masukkan tempat lahir anda!");
			object.place_of_birth.focus();
			return false;
		}
		if(object.day.value == "null") {
			alert("Pilih tanggal lahir anda!");
			object.day.focus();
			return false;
		}
		if(object.month.value == "null") {
			alert("Pilih bulan lahir anda!");
			object.month.focus();
			return false;
		}
		if(object.year.value == "null") {
			alert("Pilih tahun lahir anda!");
			object.year.focus();
			return false;
		}
		if(object.address.value == "") {
			alert("Masukkan alamat tempat tinggal anda!");
			object.address.focus();
			return false;
		}
		if(object.city.value == "") {
			alert("Masukkan nama kota tempat tinggal anda!");
			object.city.focus();
			return false;
		}
		if(object.province.value == "") {
			alert("Masukkan nama propinsi tempat tinggal anda!");
			object.province.focus();
			return false;
		}
		if(object.post_code.value == "") {
			alert("Masukkan kode pos tempat tinggal anda!");
			object.post_code.focus();
			return false;
		}
		if(object.email.value == "") {
			alert("Masukkan alamat e-mail anda!");
			object.email.focus();
			return false;
		}
		if(object.username.value == "") {
			alert("Masukkan username yang anda inginkan!");
			object.username.focus();
			return false;
		}
		if(object.password.value == "") {
			alert("Masukkan kata kunci/password anda!");
			object.password.focus();
			return false;
		}
		if(object.password2.value == "") {
			alert("Ulangi kata kunci/password anda seperti diatas!");
			object.password2.focus();
			return false;
		}
		if(object.password.value != object.password2.value) {
			alert("Password yang anda masukkan tidak sama dengan diatas!");
			object.password2.value = "";
			object.password2.focus();
			return false;
		}
		if(type == "paid_membership") {
			if(object.id_card_number.value == "") {
				alert("Masukkan nomor kartu identitas anda!");
				object.id_card_number.focus();
				return false;
			}
		}
	} else {
		if(object.full_name.value == "") {
			alert("Insert your full name!");
			object.full_name.focus();
			return false;
		}
		if(object.nick_name.value == "") {
			alert("Insert your short name or nick name!");
			object.nick_name.focus();
			return false;
		}
		if(object.place_of_birth.value == "") {
			alert("Insert your place of birth!");
			object.place_of_birth.focus();
			return false;
		}
		if(object.day.value == "null") {
			alert("Choose your day of birth!");
			object.day.focus();
			return false;
		}
		if(object.month.value == "null") {
			alert("Choose your month of birth!");
			object.month.focus();
			return false;
		}
		if(object.year.value == "null") {
			alert("Choose your year of birth!");
			object.year.focus();
			return false;
		}
		if(object.address.value == "") {
			alert("Insert your home address!");
			object.address.focus();
			return false;
		}
		if(object.city.value == "") {
			alert("Insert your city!");
			object.city.focus();
			return false;
		}
		if(object.province.value == "") {
			alert("Insert your province!");
			object.province.focus();
			return false;
		}
		if(object.post_code.value == "") {
			alert("Insert your post code!");
			object.post_code.focus();
			return false;
		}
		if(object.email.value == "") {
			alert("Insert your e-mail address!");
			object.email.focus();
			return false;
		}
		if(object.username.value == "") {
			alert("Insert your username!");
			object.username.focus();
			return false;
		}
		if(object.password.value == "") {
			alert("Insert your password!");
			object.password.focus();
			return false;
		}
		if(object.password2.value == "") {
			alert("Re-type your password!");
			object.password2.focus();
			return false;
		}
		if(object.password.value != object.password2.value) {
			alert("Your second password is not match!");
			object.password2.value = "";
			object.password2.focus();
			return false;
		}
		if(type == "paid_membership") {
			if(object.id_card_number.value == "") {
				alert("Insert your ID card number!");
				object.id_card_number.focus();
				return false;
			}
		}
	}
}

function reg_paid_membership_check(form_name,language) {
	var object = eval("document."+form_name);
	if(language == "id") {
		if(object.id_card_number.value == "") {
			alert("Masukkan nomor kartu identitas anda!");
			object.id_card_number.focus();
			return false;
		}
	} else {
		if(object.id_card_number.value == "") {
			alert("Insert your ID card number!");
			object.id_card_number.focus();
			return false;
		}
	}
}

function user_checking(form_name,lang) {
	var object = eval("document."+form_name);
	if(lang) {
		if(object.username.value == "")
		{
			alert("Masukkan username yang anda inginkan!");
			object.username.focus();
			return false;
		}
	} else {
		if(object.username.value == "")
		{
			alert("Insert your username!");
			object.username.focus();
			return false;
		}
	}
	var address = "?menu=user_check&username="+object.username.value+"&nonavbar=1&lang="+lang;
	var VERT_OFFSET = 11
	lebar = 450;
	tinggi = 200;
	win = window.open("","LEXREGIS_USER_CHECK","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width="+lebar+",height="+tinggi);
	win.resizeTo(lebar + 2, tinggi + 24 + 1)
	win.moveTo(Math.ceil((window.screen.width - lebar) / 2), 
	Math.ceil((window.screen.height - (tinggi + 24)) / 2) - VERT_OFFSET)
	win.location.href = address;
}

function check_newsletter_form(form_name,language) {
	var object = eval("document."+form_name);
	if(language == "id") {
		if(object.email.value == "" || object.email.value == "alamat e-mail...") {
			alert("Masukkan alamat e-mail anda!");
			object.email.focus();
			return false;
		}
	} else {
		if(object.email.value == "" || object.email.value == "e-mail address...") {
			alert("Insert your e-mail address!");
			object.email.focus();
			return false;
		}
	}
}

function check_search_form(form_name,language) {
	var object = eval("document."+form_name);
	if(language == "id") {
		if(object.value.value == "" && object.value.value == "") {
			alert("Masukkan kata yang ingin anda cari!");
			object.value.focus();
			return false;
		}
	} else {
		if(object.value.value == "" && object.value.value == "") {
			alert("Insert your words!");
			object.value.focus();
			return false;
		}
	}
}

function form_change_password(form_name,language) {
	var object = eval("document."+form_name);
	if(language == "id") {
		if(object.old_password.value == "") {
			alert("Masukkan password lama anda!");
			object.old_password.focus();
			return false;
		}
		if(object.new_password.value == "") {
			alert("Masukkan password baru anda!");
			object.new_password.focus();
			return false;
		}
		if(object.retype_new_password.value == "") {
			alert("Ulangi password baru anda!");
			object.retype_new_password.focus();
			return false;
		}
		if(object.new_password.value != object.retype_new_password.value) {
			alert("Password baru anda tidak sama!");
			object.retype_new_password.value = "";
			object.retype_new_password.focus();
			return false;
		}
	} else {
		if(object.old_password.value == "") {
			alert("Insert your old password!");
			object.old_password.focus();
			return false;
		}
		if(object.new_password.value == "") {
			alert("Insert your new password!");
			object.new_password.focus();
			return false;
		}
		if(object.retype_new_password.value == "") {
			alert("Retype your new password!");
			object.retype_new_password.focus();
			return false;
		}
		if(object.new_password.value != object.retype_new_password.value) {
			alert("Your new password not match!");
			object.retype_new_password.value = "";
			object.retype_new_password.focus();
			return false;
		}
	}
}

function form_subscribe_newsletter(form_name,language) {
	var object = eval("document."+form_name);
	if(language == "id") {
		if(object.email.value == "" || object.email.value == "Alamat e-mail...") {
			alert("Masukkan alamat e-mail anda!");
			object.email.focus();
			return false;
		}
	} else {
		if(object.email.value == "" || object.email.value == "E-mail address...") {
			alert("Insert your e-mail address!");
			object.email.focus();
			return false;
		}
	}
}

function form_online_contact(form_name,language) {
	var object = eval("document."+form_name);
	if(language == "id") {
		if(object.name.value == "") {
			alert("Masukkan nama anda!");
			object.name.focus();
			return false;
		}
		if(object.email.value == "") {
			alert("Masukkan alamat email anda!");
			object.email.focus();
			return false;
		}
		if(object.subject.value == "") {
			alert("Masukkan nama anda!");
			object.subject.focus();
			return false;
		}
		if(object.message.value == "") {
			alert("Masukkan pesan anda!");
			object.message.focus();
			return false;
		}
	} else {
		if(object.name.value == "") {
			alert("Insert your name!");
			object.name.focus();
			return false;
		}
		if(object.email.value == "") {
			alert("Insert your e-mail address!");
			object.email.focus();
			return false;
		}
		if(object.subject.value == "") {
			alert("Insert subject!");
			object.subject.focus();
			return false;
		}
		if(object.message.value == "") {
			alert("Insert your message(s)!");
			object.message.focus();
			return false;
		}
	}
}

function confirmation(message,logout) 
{
	if(logout && logout != "")
	{
		ht = document.getElementsByTagName("body");
		ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
		var conf = confirm(message); // confirm = jendela pertanyaan (Ok/Cancel)
		if(conf) 
		{
			return true;
		}
		ht[0].style.filter = "";
		return false;
	}
	else
	{
		var conf = confirm(message); // confirm = jendela pertanyaan (Ok/Cancel)
		if(conf) 
		{
			return true;
		}
		return false;
	}
}

function button_over(doShitButton) {
	doShitButton.style.backgroundColor = "#E3CCB3";
	doShitButton.style.borderColor = "#FFFFFF #666666 #666666 #FFFFFF";
}
function button_out(doShitButton) {
	doShitButton.style.backgroundColor = "#E3CCB3";
	doShitButton.style.borderColor = "#E3CCB3";
}
function button_down(doShitButton) {
	doShitButton.style.backgroundColor = "#E3CCB3";
	doShitButton.style.borderColor = "#666666 #FFFFFF #FFFFFF #666666";
}
function button_up(doShitButton) {
	doShitButton.style.backgroundColor = "#E3CCB3";
	doShitButton.style.borderColor = "#E3CCB3";
}

function doShit(command,value,frame_name) {
	if(command == "html") {
		if(document.getElementById(eval("\"html_"+frame_name+"\"")).checked == true) {
			with(document.getElementById(frame_name).contentWindow) {
				with(document.body){
				 style.fontFamily="Courier";
				 style.fontSize="10pt";
				 innerText=innerHTML
				}
			 focus();
			 document.body.createTextRange().collapse(false)
			}
		} else {
			with(document.getElementById(frame_name).contentWindow) {
				with(document.body){
				 style.fontFamily="";
				 style.fontSize="";
				 innerHTML=innerText
				}
			 focus();
			 document.body.createTextRange().collapse(false)
			}
		}
	} else {
		eval("frames."+frame_name+".focus()");
		var tr = eval("frames."+frame_name+".document.selection.createRange()");
		if(command == "Paste") {
			tr.execCommand(command,"false")
		} else {
			tr.execCommand(command,"false",value)
		}
  	tr.select()
	}
  eval("frames."+frame_name+".focus()");
}

function mouse_over(theobject)
{
	object=theobject
	while(object.filters.alpha.opacity>60)
	{
		object.filters.alpha.opacity+=-2
	}
}
function mouse_out(theobject)
{
	object=theobject
	while(object.filters.alpha.opacity<100)
	{
		object.filters.alpha.opacity+=2
	}
}

function no_simbol() {
  if (event.keyCode == 13) {
    return true;
  }
  if ((event.keyCode > 0 && event.keyCode < 48) || (event.keyCode > 57 && event.keyCode < 65) || (event.keyCode > 90 && event.keyCode < 95) || (event.keyCode == 96) || (event.keyCode > 122 && event.keyCode < 225)) {
	 return false;
  }
}

function no_simbol_n_text() {
  if (event.keyCode == 13) {
    return true;
  }
  if ((event.keyCode > 0 && event.keyCode < 48) || (event.keyCode > 57 && event.keyCode < 225) || event.keyCode == 32) {
	return false;
  }
}

function enable_button(form_name,checkbox_name,button_name) {
	var object = eval("document."+form_name);
	if(eval("object."+checkbox_name+".checked == true;")) {
		eval("object."+button_name+".disabled = false;")
	} else {
		eval("object."+button_name+".disabled = true;")
	}
}

function currencyFormat(fld, milSep, decSep, e) {
var sep = 0;
var key = '';
var i = j = 0;
var len = len2 = 0;
var strCheck = '0123456789';
var aux = aux2 = '';
var whichCode = (window.Event) ? e.which : e.keyCode;
if (whichCode == 13) return true;  // Enter
key = String.fromCharCode(whichCode);  // Get key value from key code
if (strCheck.indexOf(key) == -1) return false;  // Not a valid key
len = fld.value.length;
for(i = 0; i < len; i++)
if ((fld.value.charAt(i) != '0') && (fld.value.charAt(i) != decSep)) break;
aux = '';
for(; i < len; i++)
if (strCheck.indexOf(fld.value.charAt(i))!=-1) aux += fld.value.charAt(i);
aux += key;
len = aux.length;
if (len == 0) fld.value = '';
if (len == 1) fld.value = '0'+ decSep + '0' + aux;
if (len == 2) fld.value = '0'+ decSep + aux;
if (len > 2) {
aux2 = '';
for (j = 0, i = len - 3; i >= 0; i--) {
if (j == 3) {
aux2 += milSep;
j = 0;
}
aux2 += aux.charAt(i);
j++;
}
fld.value = '';
len2 = aux2.length;
for (i = len2 - 1; i >= 0; i--)
fld.value += aux2.charAt(i);
fld.value += decSep + aux.substr(len - 2, len);
}
return false;
}

function commaSplit(srcNumber) {
var txtNumber = '' + srcNumber;
if (isNaN(txtNumber) || txtNumber == "") {
alert("Oops!  That does not appear to be a valid number.  Please try again.");
fieldName.select();
fieldName.focus();
}
else {
var rxSplit = new RegExp('([0-9])([0-9][0-9][0-9][,.])');
var arrNumber = txtNumber.split(',');
arrNumber[0] += ',';
do {
arrNumber[0] = arrNumber[0].replace(rxSplit, "$1.$2");
} while (rxSplit.test(arrNumber[0]));
if (arrNumber.length > 1) {
return arrNumber.join('');
}
else {
return arrNumber[0].split(',')[0];
      }
   }
}

function set_membership_price(form_name,value,price_per_month) {
	var object = eval("document."+form_name);
	var def = value * price_per_month;
	if(value == 3) {
		disc = def * 0.05;
		prices = def - disc;
		txt_sub_total.innerHTML = commaSplit(def);
		txt_discount.innerHTML = "5% (Rp. "+commaSplit(disc)+",-)";
		object.sub_total.value = def;
		object.discount.value = "5%";
	} else if(value == 6) {
		disc = def * 0.10;
		prices = def - disc;
		txt_sub_total.innerHTML = commaSplit(def);
		txt_discount.innerHTML = "10% (Rp. "+commaSplit(disc)+",-)";
		object.sub_total.value = def;
		object.discount.value = "10%";
	} else if(value == 12) {
		disc = def * 0.20;
		prices = def - disc;
		txt_sub_total.innerHTML = commaSplit(def);
		txt_discount.innerHTML = "20% (Rp. "+commaSplit(disc)+",-)";
		object.sub_total.value = def;
		object.discount.value = "20%";
	} else if(value == 24) {
		disc = def * 0.30;
		prices = def - disc;
		txt_sub_total.innerHTML = commaSplit(def);
		txt_discount.innerHTML = "30% (Rp. "+commaSplit(disc)+",-)";
		object.sub_total.value = def;
		object.discount.value = "30%";
	} else {
		prices = price_per_month;
		txt_sub_total.innerHTML = commaSplit(price_per_month);
		txt_discount.innerHTML = "0%";
		object.sub_total.value = price_per_month;
		object.discount.value = "0%";
	}
	txt_price.innerHTML = commaSplit(prices);
	object.grand_total.value = prices;
}

MM_preloadImages('../images/button_login_hover.png');
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function ShowHideElement(elementID) {
	var prop
	if (document.getElementById) 
		prop = document.getElementById(elementID).style
	else if (document.all)
		prop = document.all[elementID].style
	else if (document.layers)
		prop = document.layers[elementID]
	
	if (prop.display=='none')
		prop.display = ''
	else
		prop.display = 'none'
}

function goto(url) {
	location.href="http://"+url;
}
//-->