
//corner
  addEvent(this, 'load', initCorners);

  function initCorners() {
    var settings = {
      tl: { radius: 10 },
      tr: { radius: 10 },
      bl: { radius: 10 },
      br: { radius: 10 },
      antiAlias: true
    }
    curvyCorners(settings, ".promoContent, .newsContent, .subContent, .testi01, .promoContent_right, .box_middle, .code_aff");
	
    var settings = {
      tl: { radius: 0 },
      tr: { radius: 0 },
      bl: { radius: 10 },
      br: { radius: 10 },
      antiAlias: true
    }
    curvyCorners(settings, ".highlight, .promo_content, .conRight, .promo_content02");
  };
  
//block
$(document).ready(function(){
	$(".comment_testi").click(function(){
		window.location=$(this).find("a").attr("href");return false;
	}).mouseover(function() {
		$(this).css('backgroundColor','#888888');
	}).mouseout(function() {
		$(this).css('backgroundColor','');	
	});
  
//block
	$(".rounded").click(function(){
		window.location=$(this).find("a").attr("href");return false;
	}).mouseover(function() {
		$(this).css('backgroundColor','#cccccc');
	}).mouseout(function() {
		$(this).css('backgroundColor','');	
	});


//tab
	$("ul.tabNav a").click(function() {
		var curChildIndex = $(this).parent().prevAll().length + 1;
		$(this).parent().parent().children('.current').removeClass('current');
		$(this).parent().addClass('current');
		$(this).parent().parent().next('.tabContainer').children('.current').slideUp('normal',function() {
		$(this).removeClass('current');
		$(this).parent().children('div:nth-child('+curChildIndex+')').slideDown('normal',function() {
		$(this).addClass('current');
		});
	});
	return false;								
	});

//block link
	$(".contentdiv").click(function(){
		window.location=$(this).find("a").attr("href");return false;
	});	


//login
	$(".login").click(function(){
		$(".login_right").slideToggle("slow");return false;
	});	


//add_news
	$(".btn_add").click(function(){
		$(".add_form").slideToggle("slow")
		.siblings(".edit_form:visible").slideUp("slow");
	});	

//edit_news
	$(".btn_edit").click(function(){
		$(".edit_form").slideToggle("slow")
		.siblings(".add_form:visible").slideUp("slow");
	});	

//delete_news			   
	$(".tabel_admin .btn_delete").click(function(){
		$(this).parents(".tabel_admin tr").animate({ opacity: 'hide' }, "slow");
	});
	
		
//treview
	$("#navigation").treeview({
	animated: "fast",
	persist: "location",
	collapsed: true,
	unique: true
	});

//newslite
	$(".newsticker-jcarousellite").jCarouselLite({
		vertical: true,
		hoverPause:true,
		visible: 2,
		auto:4000,
		speed:2000
	});

//Paging
	$("ul.news").quickPager({pageSize: 2});
	
//Validasi kontak pesan
	$("#form_pesan").validate({
		rules: {
			nama: "required",
			email: {
				required: true,
				email: true
			},
			tujuan: "required",
			pesan: "required",
			judul: "required",
			code: {
				required: true,
				remote: "ajax_captcha.php"
			}
		},
		messages: {
			nama: "<<<  Mohon isi nama lengkap anda",
			email: "<<<  Masukkan alamat email valid anda",
			tujuan: "<<< Silahkan pilih salah satu tujuan pesan anda",
			judul: "<<<  Mohon isi judul pesan anda",
			pesan: "<<<  Mohon isi pesan anda",
			code: "<<<  Jumlahkan angka yg ada dibawah"
		}
	});
	
});					   
