// JavaScript Document
$(document).ready(function(){
	 $("#formnonton").validate({
		 rules:{
			 nama:{required:true,maxlength:35},
			 alamat:{required:true,maxlength:255},
			 telepon:{required:true,number:true,maxlength:13},
			 handphone:{number:true,maxlength:13},
			 profesi:{required:true,maxlength:35},
			 email:{required:true,email:true}},
		 messages:{
			nama:"Nama tidak boleh kosong",
			alamat:"Alamat tidak boleh kosong",
			telepon:"Nomor telepon wajib diisi dan harus huruf",
			handphone:"Nomor HP harus huruf",
			profesi:"Profesi tidak boleh kosong",
			email:"Email tidak sesuai"}});
	 
	 $("#formtopik").validate({
		rules:{
			nama:{required:true,maxlength:35},
			alamat:{required:true,maxlength:255},
			telepon:{required:true,number:true,maxlength:13},
			handphone:{number:true,maxlength:13},
			profesi:{required:true,maxlength:35},
			judul:{required:true,maxlength:50},
			email:{required:true,email:true},
			komentar:{maxlength:255}},
	 messages:{
		 nama:"Nama tidak boleh kosong",
		 alamat:"Alamat tidak boleh kosong",
		 telepon:"Nomor telepon wajib diisi dan harus huruf",
		 handphone:"Nomor HP harus huruf",
		 profesi:"Profesi tidak boleh kosong",
		 judul:"Judul tidak boleh kosong",
		 email:"Email tidak sesuai",
		 komentar:"Komentar tidak boleh lebih 225 karakter"}});
	 
	 $("#formkakipalsu").validate({
		rules:{
			nama:{required:true,maxlength:35},
			alamat:{required:true,maxlength:255},
			tempat:{required:true,maxlength:35},
			thn:{required:true,number:true,maxlength:5},
			bln:{required:true,number:true,maxlength:3},
			tgl:{required:true,number:true,maxlength:3},
			telepon:{required:true,number:true,maxlength:13},
			handphone:{number:true,maxlength:13},
			profesi:{required:true,maxlength:35},
			sejak:{required:true,number:true,maxlength:5},
			usia:{required:true,number:true,maxlength:5},
			keterangan:{maxlength:255}},
	 messages:{
		 nama:"Nama tidak boleh kosong",
		 alamat:"Alamat tidak boleh kosong",
		 tempat:"Tempat lahir wajib diisi",
		 thn:"Tahun lahir wajib diisi",
		 bln:"",
		 tgl:"",
		 telepon:"Nomor telepon wajib diisi dan harus huruf",
		 handphone:"Nomor HP harus huruf",
		 sia:"Usia harus huruf dan maksimal 5 digit",
		 profesi:"Profesi tidak boleh kosong",
		 sejak:"Sejak cacat wajib diisi",
		 keterangan:"Tidak boleh lebih 255 karakter"}});
	 
	$("#form_kommentar").validate({
		rules:{
			nama:{required:true,maxlength:35},
			kommentar:{required:true,maxlength:255},
			telepon:{required:true,number:true,maxlength:13},
			subject:{required:true,maxlength:35},
			email:{required:true,email:true}},
		messages:{
			nama:"Nama tidak boleh kosong",
			kommentar:"Kommentar wajib diisi!",
			telepon:"Nomor telepon wajib diisi dan harus huruf",
			subject:"Subject tidak boleh kosong",
			email:"Email tidak sesuai"}});

//Tab menu kickandy
	$('#tabMenu > li').click(function(){
		if (!$(this).hasClass('selected')) {    
		$('#tabMenu > li').removeClass('selected');
		$(this).addClass('selected');
		$('.boxBody div').slideUp('1500');
		$('.boxBody div:eq(' + $('#tabMenu > li').index(this) + ')').slideDown('1500');
	}
		
	}).mouseover(function() {
		$(this).addClass('mouseover');
		$(this).removeClass('mouseout');   
	}).mouseout(function() {
		$(this).addClass('mouseout');
		$(this).removeClass('mouseover');    
		
	});
	
	$('.boxBody #category li').click(function(){
		window.location = $(this).children().attr('href');
	}).mouseover(function() {
		$(this).css('backgroundColor','#888');
		$(this).children().animate({paddingLeft:"20px"}, {queue:false, duration:300});
	}).mouseout(function() {
		$(this).css('backgroundColor','');
		$(this).children().animate({paddingLeft:"0"}, {queue:false, duration:300});
	});  
	
	$('#.boxBody li').click(function(){
		window.location = $(this).children().attr('href');
	}).mouseover(function() {
		$(this).css('backgroundColor','#888');
	}).mouseout(function() {
		$(this).css('backgroundColor','');
	});  	

});
