/* fungsi format angka*/
var s1 = 1, s2 = 1, s3 = 1, s4 = 1, photo = 0;

function PopUpInformasi(action, actmsg, actfocus) {
	var myWidth = 0, myHeight = 0; // Nueva Forma de Capturar el Tamaņo de la Ventana del Navegador	
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}
	
	var html = "<TABLE width=\"" + myWidth + "\" height=\"" + myHeight + "\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td width=\"100%\" height=\"100%\" align=\"center\" valign=\"middle\">" +
		"<TABLE width=\"260\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"formUtama\">" +
		"<TR><TD style=\"padding:5px\"><div class=\"formBgTitle\">" +
				"<span class=\"formClose\" style=\"left:225px;\" onclick=\"PopUpInformasi(false, 'null');\">&nbsp;&nbsp;&nbsp;&nbsp;</span>" +
				"<span class=\"formTitle\">InformasiData</span></div>" + 
		"</TD></TR>" +
		"<TR><TD style=\"padding:5px;\" height=\"100%\" valign=\"top\" align=\"center\">" +
			"<table border=\"0\" cellpadding=\"0\" cellspacing=\"4\">" +
				"<tr><td align=\"center\"><strong>" + actmsg + "</strong></td></tr>" +
				"<tr><td align=\"center\" style=\"padding-top:10px;\">" +
					"<input type=\"button\" class=\"abutton\" id=\"btnOk\" value=\"OK\" onclick=\"PopUpInformasi(false, 'null', '" + actfocus + "');\">" +
				"</td></tr>" +
			"</table>" +
		"</TD></TR>" +			
		"</TABLE>" +
		"</td></tr></table>";
	var dv = document.getElementById("formInfoPopUp");
	dv.innerHTML = html;
	
	if (action) {
		dv.style.visibility = "visible";
		document.getElementById("btnOk").focus();
	} else {
		dv.style.visibility = "hidden";		
		if (actfocus!="null") { document.getElementById(actfocus).focus(); }
	}
}

function PopUpPreview(action, actimg) {
	var myWidth = 0, myHeight = 0; // Nueva Forma de Capturar el Tamaņo de la Ventana del Navegador	
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}
	
	var html = "<TABLE width=\"" + myWidth + "\" height=\"" + myHeight + "\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td width=\"100%\" height=\"100%\" align=\"center\" valign=\"middle\">" +
		"<TABLE cellpadding=\"0\" cellspacing=\"0\" border=\"0\">" +
		"<TR><TD colspan=\"3\"><div class=\"formPopUp-ct\">" +
		"<div class=\"formPopUp-tl\"></div>" +
		"<div class=\"formPopUp-t\"><div class=\"formPopUp-heading\"></div><div class=\"formPopUp-close\" onclick=\"PopUpPreview(false, 'null');\"></div></div>" +
		"<div class=\"formPopUp-tr\"></div>" +
		"</div></TD></TR>" +
		"<TR><TD><div class=\"formPopUp-l\"></div></TD>" +
		"<TD><div class=\"formPopUp-cc\"><img src=\"images/gallery/" + actimg + "\" border=\"0\"></div></TD>" +
		"<TD><div class=\"formPopUp-r\"></div></TD></TR>" +
		"<TR><TD colspan=\"3\"><div class=\"formPopUp-cb\">" +
		"<div class=\"formPopUp-bl\"></div>" +
		"<div class=\"formPopUp-b\"></div>" +
		"<div class=\"formPopUp-br\"></div>" +
		"</div></TD></TR>" +
		"</TABLE>" +
		"</td></tr></table>";
	var dv = document.getElementById("formInfoPopUp");
	dv.innerHTML = html;
	
	if (action) {
		dv.style.visibility = "visible";
		document.getElementById("btnOk").focus();
	} else {
		dv.style.visibility = "hidden";		
		if (actfocus!="null") { document.getElementById(actfocus).focus(); }
	}
}

function contactsubmit() {
	if (document.getElementById("txtnama").value == "") {
		alert("Your Name is empty!");
	} else if (document.getElementById("txtalamat").value == "") {
		alert("Address is empty!");
	} else if (document.getElementById("txtkota").value == "") {
		alert("City is empty!");
	} else if (document.getElementById("txtnegara").value == "") {
		alert("Country is empty!");
	} else if (document.getElementById("txtelepon").value == "") {
		alert("Phone No. is empty!");
	} else if (document.getElementById("txtemail").value == "") {
		alert("Email Address. is empty!");
	} else if (document.getElementById("txtkomentar").value == "") {
		alert("Comments is empty!");
	} else {
		document.getElementById("form-contact").submit();
	}
}

function reservationsubmit() {
	if (document.getElementById("txtname").value == "") {
		alert("Your Name is empty!");
	} else if (document.getElementById("txtemail").value == "") {
		alert("Email Address. is empty!");
	} else {
		document.getElementById("form-reservation").submit();
	}
}
