// JavaScript Document$(document).ready(function(){    var options = {            handleOversize	: "drag",    		modal			: true,    		continuous		: true,		            //displayNav:         false,        };        Shadowbox.init(options);	
	//captchaRefresh
	$('#divcaptcha').captchaRefresh({src: base_url+'/inc/xfile/captcha.php'});
	//contact form
	$('#f_contact').validate({
		rules: {
			name			: {
					required	: true,
					maxlength	: 50
			},
			email			: {
					required	: true,
					email		: true
			},
			subject			: 'required',
			phone			: 'required',
			message			: 'required',
			security_code	: 'required'
		},		
		submitHandler: function() {
			$.post($('#f_contact').attr('action'),{ 
					name			: $('#name').val(),
					email			: $('#email').val(),
					subject			: $('#subject').val(),
					phone			: $('#phone').val(),
					fax				: $('#fax').val(),
					message			: $('#message').val(),
					security_code	: $('#security_code').val(),
					submit_contact	: true
				}, function(data){
					if(data == 1) {
						jAlert("Contact Form Submited","Success");
						$("#popup_ok").click(function(){
							window.location = base_url;
						});								
					} else if(data == 2){
						jAlert("Sorry, the security code that you entered is incorrect.<br/>Please try to submit this form again with the correct code.","Error");
						$("#popup_ok").click(function(){
							$('#reload').click();
						});	
					
					} else {
						jAlert("Submit Failed. Please Try Again.","Error");	
						//jAlert(data,"Error");	
						$("#popup_ok").click(function(){
							$('#reload').click();
						});							
					}
				}
			);
			return false;
		}	
	});
	
	//wilayah
	$('#wilayah').change(function(){
		$('#f_wilayah').submit();	
	})
	$('#vertSlider').cycle({ 
		fx:     'scrollHorz', 
		speed:  '800', 
		timeout: 0, 
		next:   '#next', 
		prev:   '#prev' 
	});	
});
