$(function() {
			$.fn.media.mapFormat('mpg','quicktime');
			var music="music/<?php echo $music ?>.mp3";
			$(".slide").cycle({fx:"all", pause:1, startingSlide: 5});
			$("a.medya").media();
			$(".oyunLinki").click(function(){
				$(".music").html(music).jmp3({backcolor: "ff9900", forecolor: "E767A6", width: 120, height: 20, autoplay: "false", showdownload: "false", repeat: "false" });
				var oyunID=$(this).attr("id").substr(5);
				$("#center").load("haberal.php",{oyunID:oyunID}, function(){
				});
			});
			$(".haberLinki").click(function(){
				var haberID=$(this).attr("id").substr(6);
				$("#center").load("haberal.php",{haberID:haberID}, function(){
					$(".tabs").idTabs();
					$("a.video").media({autoplay: false, width:320, height:255});
					$(".tableZebra tr:odd").addClass("odd");
					$(".tableZebra tr:even").addClass("even");
					$("img.buyut").each(function(){
						 var source=$(this).attr("src");
						 $(this).wrap("<a href='"+ source +"' rel='buyut'></a>");
						$(this).parent().colorbox({current:"Resim {current} / {total}"});
					});
					$('.pics').after('<div id="nav" class="nav">').cycle({ fx: 'scrollDown', speed: 'slow', timeout: 6000, pause: 1, sync: 1, pager: '#nav' });
					$("a.medya").media();
				});
			});
			
			$('.kisamesajlar').cycle({
				fx: 'scrollRight', 
				delay: 3000,
				pause: 1,
				next:'.kisamesajlar'
			});
			$(".kategoriLinki").click(function(){
				var kategoriID=$(this).attr("id").substr(9);
				$("#center").load("haberal.php",{kategoriID:kategoriID}, function(){
					$(".tabs").idTabs();
					$("a.video").media({autoplay: false, width:320, height:255});
					$(".tableZebra tr:odd").addClass("odd");
					$(".tableZebra tr:even").addClass("even");
					$("#haberler").accordion({
						active: false,
						autoheight: false,
						header: '.head',
						navigation: true,
						alwaysOpen: false
					});
					$("a.medya").media();
				});
			});
	$("#menuLeft").accordion({
		active: false,
		autoheight: false,
		header: '.head',
		navigation: true,
		alwaysOpen: false
	});
	$(".music").jmp3({ backcolor: "ff9900", forecolor: "E767A6", width: 120, height: 20, autoplay: "true", showdownload: "false", repeat: "false" });
	$('.pics').after('<div id="nav" class="nav">').cycle({ fx: 'scrollDown', speed: 'slow', timeout: 6000, pause: 1, sync: 1, pager: '#nav'});
	$(".tabs").idTabs();
	$("h1").corner("top");
	$("a.video").media({autoplay: false, width:320, height:255});
	$("img.buyut").each(function(){
		 var source=$(this).attr("src");
		 $(this).wrap("<a href='"+ source +"' rel='buyut'></a>");
		 $(this).parent().colorbox({current:"Resim {current} / {total}"});
	})
	$("#ziyaretciDefteri").validate({
		rules: {
			adsoyad: {
				required: true,
				minlength: 5
			},
			eposta: {
				required: true,
				email: true
			},
			mesaj: {
				required: true,
				minlength: 5
			}
		},
		messages: {
			adsoyad: {
				required: 'Lütfen adınızı yazınız.',
				minlength: 'En az beş harf lütfen!'
			},
			eposta: {
				required: 'Lütfen eposta adresinizi yazınız.',
				email: 'Lütfen geçerli bir eposta adresi yazınız.'
			},
			mesaj: {
				required: 'Lütfen mesajınızı yazınız.',
				minlength: 'En az beş harf lütfen!'
			}				
		}
	});
});
$.fn.clearForm = function() {
  return this.each(function() {
 var type = this.type, tag = this.tagName.toLowerCase();
 if (tag == 'form')
   return $(':input',this).clearForm();
 if (type == 'text' || type == 'password' || type == 'hidden' || tag == 'textarea')
   $(this).attr({'defaultValue':'', 'value':'' });
 else if (type == 'checkbox' || type == 'radio')
   this.checked = false;
 else if (tag == 'select')
   this.selectedIndex = -1;
  });
};