// Şifremi unuttum javascript fonsiyonları
$(document).ready(function(){
						   //menu icin
						   jQuery("#pagelocation").jBreadCrumb();
	$("#btnSavePassword").click(function(){
	if($("#newPasswordForm").validate().form()==true){
			$.post('/forgottenpassword_action.cfm',{txtforgottenEmail:$("#txtforgottenEmail").val(),txtCaptchaForPassword:$("#txtCaptchaForPassword").val(),txtCaptchaIDForPassword:$("#txtCaptchaIDForPassword").val(),btnSavePassword:'Kaydet'},function(xml){
					if(xml.replace(/^\s+|\s+$/g,"")=='-1'){
										$.post('/forgottenpassword_action.cfm',{getCaptchaForPassword:'true'},function(xml){
												$("#divCaptchaForPassword").html(xml).fadeTo(900,1);														 
										});
										$("#btnSavePassword").next("span").fadeTo(200,0.1,function()
										{
											$("#txtforgottenEmail").next("span").html('E-mail kayıtlı değil.').fadeTo(900,1);
											$("#btnSavePassword").next("span").html('Kayıt gercekleştirilemedi').fadeTo(900,1);
										});
					}
					else if(xml.replace(/^\s+|\s+$/g,"")=='-2'){
										$.post('/forgottenpassword_action.cfm',{getCaptchaForPassword:'true'},function(xml){
												$("#divCaptchaForPassword").html(xml).fadeTo(900,1);														 
										});
										$("#txtCaptchaForPassword").next("span").html('Soruyu dogru cevaplayınız').fadeTo(900,1);
										$("#btnSavePassword").next("span").fadeTo(200,0.1,function(){
												$("#btnSavePassword").next("span").html('Kayıt gercekleştirilemedi').fadeTo(900,1);
										});
					}
					else//kayıt yapılıyor
					{
										$("#btnSavePassword").next("span").fadeTo(200,0.1,function()  //start fading the messagebox
										{
											$("#btnSavePassword").next("span").html('Kaydediliyor...').fadeTo(900,1,function()
											{
												$(".formcontentpassword").html("<h3>Şifrenizi değiştirmek için mailinize bakınız.</h3>");
												//document.location='/userInfo.cfm';
											});
										});
					}
			});
		}
	else{
				$("#btnSavePassword").next("span").html('Kayıt gercekleştirilemedi').fadeTo(900,1);
		}
	});
	 
	$("#txtforgottenEmail").blur(function(){
		var regex=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/;
		 if($("#txtforgottenEmail").val().replace(/^\s+|\s+$/g,"")!='' && regex.exec($("#txtforgottenEmail").val()) != null ){
				$.post('/forgottenpassword_action.cfm',{txtforgottenEmail:$("#txtforgottenEmail").val(),emailControlForPassword:'emailControlForPassword'},function(xml){
						if(xml.replace(/^\s+|\s+$/g,"")!='false') //email yok
						{
							$("#txtforgottenEmail").next("span").fadeTo(200,0.1,function() 
							{
								$("#txtforgottenEmail").next("span").html('').fadeTo(900,1,function()
								{
								 //redirect to secure page
								});
							});
					  	}
					  	else{
							$("#txtforgottenEmail").next("span").fadeTo(200,0.1,function()
							{
								$("#txtforgottenEmail").next("span").html('E-mail Kayıtlı değil').fadeTo(900,1);
							});
						}
				});
		}else{
			$("#txtforgottenEmail").next("span").html('Geçerli e-mail adresi giriniz').fadeTo(900,1);
			}
	});
		
	
	$("#newpasswordForm").validate({
		rules: {		
			txtCaptchaForPassword: {
				required: true
			},
			txtforgottenEmail: {
				required: true,
				email: true
			}
		},
		messages: {
			txtCaptchaForPassword: {
				required: "Soruyu cevaplayınız"
			},
			txtforgottenEmail: "Geçerli e-mail adresi giriniz"
		},
		errorPlacement: function(error, element) {
			error.appendTo( element.next("span") );
       }
	});
	
});
// Şifremi unuttum javascript fonsiyonları bitiş
//Üye girişi bölümü javascript fonksiyonları
function setTxtClass(){
		if($("#txtEmail").val()==null || $("#txtEmail").val()==''|| $("#txtEmail").val()=='E-posta'){
			$("#txtEmail").removeClass("useremail").addClass("useremailhint");
		}else{
			$("#txtEmail").removeClass("useremailhint").addClass("useremail");
		}
		if($("#txtPassword").val()==null || $("#txtPassword").val()==''|| $("#txtPassword").val()=='S'){
			$("#txtPassword").removeClass("userpass").addClass("userpasshint");
		}else{
			$("#txtPassword").removeClass("userpasshint").addClass("userpass");
		}
		//Kullanıcı bilgileri ekranında şifre degiştirme bolumu
		if($("#txtUpdateOldPassword").val()==null || $("#txtUpdateOldPassword").val()==''){
			$("#txtUpdateOldPassword").addClass("oldpasshint");
		}else{
			$("#txtUpdateOldPassword").removeClass("oldpasshint");
		}
		if($("#txtUpdatePassword").val()==null || $("#txtUpdatePassword").val()==''){
			$("#txtUpdatePassword").addClass("newpasshint");
		}else{
			$("#txtUpdatePassword").removeClass("newpasshint");
		}
}
$(document).ready(function(){
	setTxtClass();
	//kullanıcı bilgileri şifre bolumu
	$("#txtUpdateOldPassword").blur(function(){								 
		if($(this).val()==null || $(this).val()==''){
		$(this).addClass("oldpasshint");
		}
	});
	$("#txtUpdateOldPassword").focus(function(){
		if($(this).val()==''){
		$(this).removeClass("oldpasshint");
		$(this).val('');
		}
	});
	$("#txtUpdatePassword").blur(function(){								 
		if($(this).val()==null || $(this).val()==''){
		$(this).addClass("newpasshint");
		}
	});
	$("#txtUpdatePassword").focus(function(){
		if($(this).val()==''){
		$(this).removeClass("newpasshint");
		$(this).val('');
		}
	});
	
	
	$("#txtEmail").blur(function(){								 
		if($(this).val()==null || $(this).val()==''|| $(this).val()=='E-posta'){
		$(this).removeClass("useremail").addClass("useremailhint");
		}
	});
	$("#txtEmail").focus(function(){
		if($(this).val()==''){
		$(this).removeClass("useremailhint").addClass("useremail");
		$(this).val('');
		}
	});
	$("#txtPassword").focus(function(){
		if($(this).val()==''){
		$(this).removeClass("userpasshint").addClass("userpass");
		$(this).val('');
		}
	});
	$("#btnLogin").click(function(){	
	if($("#loginform").validate().form()==true){
		$("#msgbox").removeClass().addClass('loginmessage').text('Kontrol ediliyor...').fadeIn(1000);
		$.post('/login_action.cfm',{txtEmail:$("#txtEmail").val(),txtPassword:$("#txtPassword").val(),chbRememberMe:$("#chbRememberMe").attr('checked'),btnLogin:'Login'},function(xml){
			if(xml.replace(/^\s+|\s+$/g,"")=='true') //if correct login detail
			{
				$("#msgbox").fadeTo(200,0.1,function()  //start fading the messagebox
				{
				 	//add message and change the class of the box and start fading
					$(this).html('Giriş yapılıyor...').addClass('loginmessage').fadeTo(900,1,function()
					{
//		redirect to secure page
//		<!---<cfif isDefined('Session.userID')>
//		$("#divlogin").html('<table><td><tr>Hoşgeldin <cfoutput>#Session.userID#</cfoutput><input type="button" id="logout" name="logout" value="Log out"></tr></td></table>');
//		</cfif>--->
						location.reload();
					});
				 });
			}
			else
			{
				$("#msgbox").fadeTo(200,0.1,function() //start fading the messagebox
				{
					 //add message and change the class of the box and start fading
					 $(this).html('Giriş yapılamadı...').addClass('loginmessage').fadeTo(900,1);
				});
			}
		});
		}
	});
	
	$("#txtEmailPopup").blur(function(){								 
		if($(this).val()==null || $(this).val()==''|| $(this).val()=='E-posta'){
		$(this).removeClass("useremail").addClass("useremailhint");
		}
	});
	$("#txtEmailPopup").focus(function(){
		if($(this).val()==''){
		$(this).removeClass("useremailhint").addClass("useremail");
		$(this).val('');
		}
	});
	$("#txtPasswordPopup").focus(function(){
		if($(this).val()==''){
		$(this).removeClass("userpasshint").addClass("userpass");
		$(this).val('');
		}
	});
	$("#btnLoginPopup").click(function(){	
	if($("#loginformpopup").validate().form()==true){
		$("#msgboxPopup").removeClass().addClass('loginmessage').text('Kontrol ediliyor...').fadeIn(1000);
		$.post('/login_action.cfm',{txtEmail:$("#txtEmailPopup").val(),txtPassword:$("#txtPasswordPopup").val(),chbRememberMe:$("#chbRememberMePopup").attr('checked'),btnLogin:'Login'},function(xml){
			if(xml.replace(/^\s+|\s+$/g,"")=='true') //if correct login detail
			{
				$("#msgboxPopup").fadeTo(200,0.1,function()  //start fading the messagebox
				{
				 	//add message and change the class of the box and start fading
					$(this).html('Giriş yapılıyor...').addClass('loginmessage').fadeTo(900,1,function()
					{
//		redirect to secure page
//		<!---<cfif isDefined('Session.userID')>
//		$("#divlogin").html('<table><td><tr>Hoşgeldin <cfoutput>#Session.userID#</cfoutput><input type="button" id="logout" name="logout" value="Log out"></tr></td></table>');
//		</cfif>--->
						location.reload();
					});
				 });
			}
			else
			{
				$("#msgboxPopup").fadeTo(200,0.1,function() //start fading the messagebox
				{
					 //add message and change the class of the box and start fading
					 $(this).html('Giriş yapılamadı...').removeClass().addClass('inputerror').fadeTo(900,1);
				});
			}
		});
		}
	});
	 
	$("#logout").click(function(){
	 	$.post('/logout.cfm',function(xml){
				location.reload();
		});
	}); 
	
	
	$("#loginform").validate({
		rules: {
			txtEmail: {
				required: true,
				email:true
			},
			txtPassword: {
				required: true
			}
		},
		messages: {
			txtEmail:"Geçerli E-posta giriniz.",
			txtPassword: {
				required: "Şifre giriniz."
			}
		},
		errorLabelContainer: $("#msgbox")
	});
	$("#loginformpopup").validate({
		rules: {
			txtEmailPopup: {
				required: true,
				email:true
			},
			txtPasswordPopup: {
				required: true
			}
		},
		messages: {
			txtEmailPopup:"Geçerli E-posta giriniz.",
			txtPasswordPopup: {
				required: "Şifre giriniz."
			}
		},
		errorPlacement: function(error, element) {
			error.appendTo( element.next("span") );
       }
	});
 });

function logout(){
	$.post('/logout.cfm',function(xml){
				location.reload();
		});
}
//Üye girişi bölümü javascript fonksiyonları bitiş
//Şifre yenileme bolumu javascript fonksiyonları
// JavaScript Document
$(document).ready(function(){	
	$("#btnNewPassword").click(function(){
	if($("#frmChangePassword").validate().form()==true){
			$.post('/sifreyenileme_action.cfm',{txtNewPassword:$("#txtNewPassword").val(),hdUserID:$("#hdUserID").val(),btnNewPassword:'Kaydet'},function(xml){
				if(xml.replace(/^\s+|\s+$/g,"")==''){
						$("#btnNewPassword").next("span").html('Şifre değiştirildi.').fadeTo(900,0);
						document.location='/index.cfm';
				}else if(xml.replace(/^\s+|\s+$/g,"")=='-1'){
						$("#btnNewPassword").next("span").html('Yeni şifreniz son şifrenizden farklı olmalı.').fadeTo(900,1);
				}else{
						$("#btnNewPassword").next("span").html('Şifre değiştirilemedi.').fadeTo(900,1);
					}
			});
		}
	else{
				$("#btnNewPassword").next("span").html('Şifre değiştirilemedi.').fadeTo(900,1);
		}
	});
	$("#frmChangePassword").validate({
		rules: {		
			txtNewPassword: {
				required: true
			},
			txtNewRePassword: {
				required: true,
				equalTo: "#txtNewPassword"
			}
		},
		messages: {
			txtNewPassword: {
				required: "Yeni şifreyi giriniz"
			},
			txtNewRePassword:{required:"Şifreyi tekrar giriniz",
			equalTo:"Şifre tekrarı hatalı"
			} 
		},
		errorPlacement: function(error, element) {
			error.appendTo( element.next("span") );
       }
	});
	
});

/***************************/
//@Author: Adrian "yEnS" Mato Gondelle
//@website: www.yensdesign.com
//@email: yensamg@gmail.com
//@license: Feel free to use it, but keep this credits please!					
/***************************/

//SETTING UP OUR POPUP
//0 means disabled; 1 means enabled;
var popupPassStatus = 0;

//loading popup with jQuery magic!
function loadPassPopup(){
	//loads popup only if it is disabled
	if(popupPassStatus==0){
		$("#backgroundPassPopup").css({
			"opacity": "0.7"
		});
		$("#backgroundPassPopup").fadeIn("slow");
		$("#popupNewPass").fadeIn("slow");
		popupPassStatus = 1;
	}
}

//disabling popup with jQuery magic!
function disablePassPopup(){
	//disables popup only if it is enabled
	if(popupPassStatus==1){
		$("#backgroundPassPopup").fadeOut("slow");
		$("#popupNewPass").fadeOut("slow");
		popupPassStatus = 0;
	}
}

//centering popup
function centerPassPopup(){
	//request data for centering
	var windowWidth =$(window).width();
	var windowHeight =$(window).height();
	var popupHeight = $("#popupNewPass").height();
	var popupWidth = $("#popupNewPass").width();
	//centering
	$("#popupNewPass").css({
		"top": windowHeight/2-popupHeight/2,
		"left": windowWidth/2-popupWidth/2
	});
	//only need force for IE6
	
	$("#backgroundPassPopup").css({
		"height": windowHeight
	});
	
}


//CONTROLLING EVENTS IN jQuery
function popupPassword(){
	//centering with css
		centerPassPopup();
		//load popup
		loadPassPopup();
	}
$(document).ready(function(){
	
	//LOADING POPUP
	//Click the button event!
	$("#btnForgetPassword").click(function(){
		popupPassword();
	});
	$("#btnForgetPasswordPopup").click(function(){
		disablePopup();
		popupPassword();
	});			
	//CLOSING POPUP
	//Click the x event!
	$("#popupNewPassClose").click(function(){
		disablePassPopup();
	});
	//Click out event!
	$("#backgroundPassPopup").click(function(){
		disablePassPopup();
	});
	//Press Escape event!
	$(document).keypress(function(e){
		if(e.keyCode==27 && popupPassStatus==1){
			disablePassPopup();
		}
	});

});
//Şifremi unuttum bolumu javascript fonksiyonları bitiş
//seans sayfası javascript

// JavaScript Document
$(document).ready(function() {
	   //bolgelerin sinemalarını accordion yapar
		function makeAccordion(){
		   $('.showtimesbyregion .theatres').accordion({
				collapsible: true,
				autoHeight: false,
				active: false,
				navigation: true,
				header:'.theatrename'
			});
		}		
		function theatrenameClick(){
			$(".theatrename").click(function(){
											 window.location.href=$(this).attr("href");
											 });		
			}
	 //ie6 da accordion hatası icin
	 function cssForIE6(){
		
		 // This is required for IE6.
			if (jQuery.browser.msie && jQuery.browser.version.substr(0,1)<7){
				//jQuery('.showtimesbyregion .theatres div').height(54);
				 $('.showtimesbyregion .theatres').accordion('option', 'clearStyle',false );
		 $('.showtimesbyregion .theatres').accordion('option', 'fillSpace', false);
			}
		 }
	 
	//seans ekranında url e gore sayfaya gerekli bilgileri getirir
	function getUrl(){
		var anchorStr=location.hash;
		var lstAnchor=decodeURI(anchorStr).split('_');
		if(lstAnchor[0]=='#r'){//sadece bolge listesinden bolge secilerek gelinmiş ise
			$.post('/seans_action.cfm',{onlyregionName:lstAnchor[1]},function(xml){
				//belirtilen bolgenin bilgileri bolgelerin altında gosterilir																			  
 				$('.showtimesbyregion .theatres').html(xml);
				//yeni oluşan html deki sinema başlıklarına accordion ozelligi eklenir 
				makeAccordion();
				theatrenameClick();
				cssForIE6();
        	});
		}else if(lstAnchor[0]=='#c'){//Once bolge secilmiş sonra sinema secilmiş ise
			$.post('/seans_action.cfm',{cinemaName:lstAnchor[1]},function(xml){
 				$('.showtimesbyregion .theatres').html(xml);
				//yeni oluşan html deki sinema başlıklarına accordion ozelligi eklenir 
				makeAccordion();
				theatrenameClick();
				cssForIE6();
        	});
		}else if(lstAnchor[0]=='#f'){//film secilmiş ise
			if(lstAnchor.length==2){//sadece film secilmiş ise
				$.post('/seans_action.cfm',{onlyfilmID:lstAnchor[1]},function(xml){
					var divSelectedMovieItem=$(this).next(".clear").next(".selectedmovieitem");
					$("#div_"+lstAnchor[1]+" .selectedmovieitem").replaceWith(xml);
					$('html, body').animate({
					scrollTop: $("#div_"+lstAnchor[1]).offset().top
					}, 2000);	
						
					//film secildikten sonra bolge secilmesi click olayı
					$('.selectedmovieitem .regionName').click(function(){
						var filmAndRegion=$(this).attr('href').split('_');
						var divRegions=$(this).parents("div:first");
						$.post('/seans_action.cfm',{filmID:filmAndRegion[1],regionName:filmAndRegion[2]},function(xml){																	  
							$(divRegions).children('.selectedmovietheatres').replaceWith(xml);
						});
					});
        		});
			}else if(lstAnchor.length==3){//film secilmiş daha sonrada bölge secilmiş ise
				$.post('/seans_action.cfm',{ancFilmID:lstAnchor[1],ancRegionName:lstAnchor[2]},function(xml){
					//$('.showtimesformovie').html(xml);
					$("#div_"+lstAnchor[1]+" .selectedmovieitem").replaceWith(xml);
					//filmin bolgelerini tıklayınca 
					$('.selectedmovieitem .regionName').click(function(){
						var filmAndRegion=$(this).attr('href').split('_');
						var divRegions=$(this).parents("div:first");
						$.post('/seans_action.cfm',{filmID:filmAndRegion[1],regionName:filmAndRegion[2]},function(xml){																	  
							$(divRegions).children('.selectedmovietheatres').replaceWith(xml);
						});
					});
        		});
			}
		}		
	}
	//Ekrana anchor la gelinirse
	getUrl();
	//Bolge degiştiginde sinemalar degişir
	$('.showtimesbyregion .regionName').click(function(){
		$.post('/seans_action.cfm',{onlyregionName:$(this).attr('href').replace('#r_','')},function(xml){
			//theatres icine gelen item lara accordion ozelligi verebilmek icin theatres ı tekrar oluşturdum																						
 			$('.showtimesbyregion .theatres').replaceWith("<div class='theatres'>"+xml+"</div>");
			//yeni oluşan html deki sinema başlıklarına accordion ozelligi eklenir 
				makeAccordion();
				theatrenameClick();
				cssForIE6();
        });
	 });
	
	//filmlere tıklayınca bolgelerin gosterilmesi
	$('.filmname').click(function(){
	   var divSelectedMovieItem=$(this).next(".clear").next(".selectedmovieitem");
		$.post('/seans_action.cfm',{onlyfilmID:$(this).parents('div:first').attr('id').replace('div_','')},function(xml){
			$(".selectedmovieitem").html("");
			$(divSelectedMovieItem).replaceWith(xml);
			$(".selectedmovieitem").hide().fadeIn(1000);
			//filmin bolgelerini tıklayınca 
			$('.selectedmovieitem .regionName').click(function(){
				var filmAndRegion=$(this).attr('href').split('_');
				var divRegions=$(this).parents("div:first");
				$.post('/seans_action.cfm',{filmID:filmAndRegion[1],regionName:filmAndRegion[2]},function(xml){																	  
					$(divRegions).children('.selectedmovietheatres').replaceWith(xml);
				});
			});
        });
	});
	//filmin bolgelerini tıklayınca 
	$('.selectedmovieitem .regionName').click(function(){
		var filmAndRegion=$(this).attr('href').split('_');
		var divRegions=$(this).parents("div:first");
		$.post('/seans_action.cfm',{filmID:filmAndRegion[1],regionName:filmAndRegion[2]},function(xml){																	  
			$(divRegions).children('.selectedmovietheatres').replaceWith(xml);
		});
	});
	cssForIE6();

});
//Seans sayfası javascript bitis
//Arama javascript
//Arama butonu click
function lookupAjax(){
	if($("#txtSearch").val().replace(/^\s+|\s+$/g,"")!='' && $("#txtSearch").val()!=null){
		var keyword=$("#txtSearch").val();
		document.location='/search.cfm?keyword='+$.trim(keyword);
	}
	return false;
}
//autocomplete ten secim yapıldıgında result function ile cagırılır
function findValueCallback(event, data, formatted) {
	if(formatted=='profil'){
		document.location='/topluluk/profil.cfm?uid='+data.value;
	}else{
		document.location='/search.cfm?keyword='+data.text;
	}
}
$(document).ready(function() {
						   //txtSearch textboxının autocomplete olayı
	$("#txtSearch").autocomplete(
		"/search_action.cfm",
		{
			dataType:"json",
			parse: function(data) {
				  var rows = new Array();
				  for(var i=0; i<data.length; i++){
					  rows[i] = { data:data[i], value:data[i].type, result:data[i].text };
				  }
				  return rows;
			  },
		    formatItem: function(row, i, n) {
			return row.text;
		    },
//		    formatResult: function(row) {
//			var key = JSON.parse(row.toString());
//			alert(row);
//			return key.text;
//		    },
			delay:10,
			minChars:2,
			matchSubset:false,
			matchContains:1,
			cacheLength:10,
			selectFirst: false,
			autoFill:false,
			focus:false
	  }).result(findValueCallback).next().click(function() {//autocomplete ten deger secilince cagrılır
		  $(this).prev().search();
		  });
//	$("#txtSearch").keypress(function(e){//txtSearch enter keypress olayı (textbox taki degeri arar)
//								  if(e.which==13){
//									  //alert("enter");
//									  if($("#txtSearch").val().replace(/^\s+|\s+$/g,"")!='' && $("#txtSearch").val()!=null){
//										  var keyword=$("#txtSearch").val();
//											document.location='/search.cfm?keyword='+$.trim(keyword);
//								       }
//								  }
//			});
});
//Arama javascript bitis
//Üyelik javascript
// JavaScript Document
$(document).ready(function(){
	$("#btnSave").click(function(){
	if($("#signupForm").validate().form()==true){
			$.post('/signup_action.cfm',{txtNameSurname:$("#txtNameSurname").val(),txtUsername:$("#txtUsername").val(),txtPassword2:$("#txtPassword2").val(),txtEmail2:$("#txtEmail2").val(),txtCaptcha:$("#txtCaptcha").val(),txtCaptchaID:$("#txtCaptchaID").val(),chbIsuserealname:$("#chbIsuserealname").attr('checked'),btnSave:'Kaydet'},function(xml){																																																																															
					if(xml.replace(/^\s+|\s+$/g,"")=='-1'){
										$.post('/signup_action.cfm',{getCaptcha:'true'},function(xml){
												$("#divCaptcha").html(xml).fadeTo(900,1);														 
										});
										$("#btnSave").next("span").fadeTo(200,0.1,function()
										{
											$("#btnSave").next("span").html('Kayıt gercekleştirilemedi').fadeTo(900,1);
										});
					}
					else if(xml.replace(/^\s+|\s+$/g,"")=='-2'){
										$.post('/signup_action.cfm',{getCaptcha:'true'},function(xml){
												$("#divCaptcha").html(xml).fadeTo(900,1);														 
										});
										$("#txtCaptcha").next("span").html('Soruyu dogru cevaplayınız').fadeTo(900,1);
										$("#btnSave").next("span").fadeTo(200,0.1,function(){
												$("#btnSave").next("span").html('Kayıt gercekleştirilemedi').fadeTo(900,1);
										});
					}
					else//kayıt yapılıyor
					{
										$("#btnSave").next("span").fadeTo(200,0.1,function()  //start fading the messagebox
										{
											$("#btnSave").next("span").html('Kaydediliyor...').fadeTo(900,1,function()
											{
												//document.location='/userInfo.cfm';
												$(".formcontentregistration").html("<h3>Email adresinize gönderilen aktivasyon linkine tıklayarak üyelik işlemini tamamlayabilirsiniz.</h3>");
											});
										});
					}
			});
		}
	else{
				$("#btnSave").next("span").html('Kayıt gercekleştirilemedi').fadeTo(900,1);
		}
	});
	 
	$("#txtEmail2").blur(function(){
		var regex=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/;

		 if($("#txtEmail2").val().replace(/^\s+|\s+$/g,"")!='' && regex.exec($("#txtEmail2").val()) != null ){
				$.post('/signup_action.cfm',{txtEmail2:$("#txtEmail2").val(),emailControl:'emailControl'},function(xml){
						if(xml.replace(/^\s+|\s+$/g,"")=='false') //email yok
						{
							$("#txtEmail2").next("span").fadeTo(200,0.1,function() 
							{
								$("#txtEmail2").next("span").html('').fadeTo(900,1,function()
								{
								 //redirect to secure page
								});
							});
					  	}
					  	else{
							$("#txtEmail2").next("span").fadeTo(200,0.1,function()
							{
								$("#txtEmail2").next("span").html('E-mail kullanılıyor.').fadeTo(900,1);
							});
						}
				});
		}
	});
		
	$("#txtUsername").blur(function(){
		if($("#txtUsername").val().replace(/^\s+|\s+$/g,"")!=''){
				$.post('/signup_action.cfm',{txtUsername:$("#txtUsername").val(),usernameControl:'usernameControl'},function(xml){
						if(xml.replace(/^\s+|\s+$/g,"")=='false') //user yok
						{
							$("#txtUsername").next("span").fadeTo(200,0.1,function()
							{
								$("#txtUsername").next("span").html('').fadeTo(900,1,function()
								{
								 //redirect to secure page
								});
							});
					  	}
					  	else
					  	{
							$("#txtUsername").next("span").fadeTo(200,0.1,function()
							{
							$("#txtUsername").next("span").html('Rumuz kabul edilmedi.').fadeTo(900,1);	
							});
					 	}
				});
		 }
	});
	
	$("#signupForm").validate({
		rules: {
			txtNameSurname: "required",
			txtUsername: {
				required: true
			},
			txtPassword2: {
				required: true
			},
			txtCaptcha: {
				required: true
			},
			txtEmail2: {
				required: true,
				email: true
			}
		},
		messages: {
			txtNameSurname: "Ad soyad giriniz.",
			txtUsername: {
				required: "Kullanıcı Adı giriniz"
			},
			txtPassword2: {
				required: "Şifre giriniz"
			},
			txtCaptcha: {
				required: "Soruyu cevaplayınız"
			},
			txtEmail2: "Geçerli e-mail adresi giriniz"
		},
		errorPlacement: function(error, element) {
			error.appendTo( element.next("span") );
       }
	});
	
});


/***************************/
//@Author: Adrian "yEnS" Mato Gondelle
//@website: www.yensdesign.com
//@email: yensamg@gmail.com
//@license: Feel free to use it, but keep this credits please!					
/***************************/

//SETTING UP OUR POPUP
//0 means disabled; 1 means enabled;
var popupStatus = 0;

//loading popup with jQuery magic!
function loadPopup(){
	//loads popup only if it is disabled
	if(popupStatus==0){
		$("#backgroundPopup").css({
			"opacity": "0.7"
		});
		$("#backgroundPopup").fadeIn("slow");
		$("#popupSignup").fadeIn("slow");
		popupStatus = 1;
	}
}

//disabling popup with jQuery magic!
function disablePopup(){
	//disables popup only if it is enabled
	if(popupStatus==1){
		$("#backgroundPopup").fadeOut("slow");
		$("#popupSignup").fadeOut("slow");
		popupStatus = 0;
	}
}

//centering popup
function centerPopup(){
	//request data for centering
	var windowWidth = $(window).width();
	var windowHeight =$(window).height(); 
	var popupHeight = $("#popupSignup").height();
	var popupWidth = $("#popupSignup").width();
	//centering
	$("#popupSignup").css({
		"top": windowHeight/2-popupHeight/2,
		"left": windowWidth/2-popupWidth/2
	});
	//only need force for IE6
	
	$("#backgroundPopup").css({
		"height": windowHeight
	});
	
}


//CONTROLLING EVENTS IN jQuery
function popupRegister(){
	//centering with css
		centerPopup();
		//load popup
		loadPopup();
	}
$(document).ready(function(){
	
	//LOADING POPUP
	//Click the button event!
	$("#btnSignup").click(function(){
		popupRegister();
	});
				
	//CLOSING POPUP
	//Click the x event!
	$("#popupSignupClose").click(function(){
		disablePopup();
	});
	//Click out event!
	$("#backgroundPopup").click(function(){
		disablePopup();
	});
	//Press Escape event!
	$(document).keypress(function(e){
		if(e.keyCode==27 && popupStatus==1){
			disablePopup();
		}
	});

});
//Üyelik javascript bitiş
//Kontrol paneli javascript
// JavaScript Document


function changeEditMode(element){
	var changeableElement=element.id;
	if($("#"+changeableElement).text()=="Değiştir"){
		$("#"+changeableElement).html("Gizle");
		
		$('.edit'+changeableElement).show();
		}
	else if($("#"+changeableElement).text()=="Gizle"){
		$("#"+changeableElement).html("Değiştir");
				
		$('.edit'+changeableElement).hide();
		}
	}
	function textCounter( field, maxlimit ) {
                if ( field.value.length > maxlimit )
                {
                    field.value = field.value.substring( 0, maxlimit );
                    alert( 'Karakter sınırını aştınız.' );
                    return false;
                }
            }

	var r={
                'special':/[\W]/g,
                'quotes':/['\''&'\"']/g,
                'dec':/[^\d&\,]/g,
                'num':/[^\d]/g,
                'allNum':/[^-?\d+$]/
            }

            function valid(o,w)
            {
                o.value = o.value.replace(r[w],'');
                if (o.value.indexOf(',') != -1)
                {
                    o.value = o.value.replace(',,',',');
                }
                var deger=o.value.substr(o.value.indexOf(',')+1);
                deger=deger.replace(',','');
                o.value=o.value.substr(0,o.value.indexOf(',')+1)+deger;
            }

	function findValueCity(lis) {
		if( li == null ) return alert("No match!");
	
		// if coming from an AJAX call, let's use the CityId as the value
		if( !!li.extra ) var sValue = li.extra[0];
	
		// otherwise, let's just display the value in the text box
		else var sValue = li.selectValue;
	
		alert("The value you selected was: " + sValue);
	}
	
	function selectItemCity(li) {
		findValue(li);
	}
	
	function formatItemCity(row) {
		return row[0] ;
	}
	
	function lookupAjaxCity(){
		var oSuggest = $("#kullanicibilgileri_action")[0].autocompleter;
	
		oSuggest.findValue();
	
		return false;
	}
	


	$(document).ready(function(){
							   $('#txtUpdateNameSurname').change(function(){valid(this,'exceptSpecial');}).keyup(function(){valid(this,'exceptSpecial');}).keypress(function(){valid(this,'exceptSpecial');});
							    $('#txtNameSurname').change(function(){valid(this,'exceptSpecial');}).keyup(function(){valid(this,'exceptSpecial');}).keypress(function(){valid(this,'exceptSpecial');});
								 $('#txtUsername').change(function(){valid(this,'exceptSpecial');}).keyup(function(){valid(this,'exceptSpecial');}).keypress(function(){valid(this,'exceptSpecial');});
							   $("#txtUpdateCity").autocomplete(
									"/kullanicibilgileri_action.cfm",
									{
										delay:10,
										minChars:2,
										matchSubset:1,
										matchContains:1,
										cacheLength:10,
										onItemSelect:selectItemCity,
										onFindValue:findValueCity,
										formatItem:formatItemCity,
										autoFill:false
									}
								);
							   
							    $("#txtUpdateBirthdate").mask("99/99/9999");
   								$("#txtUpdatePhone").mask("(999) 999-9999");

							   $('#btnUpdateNameSurname').click(function(){
																		 $('#txtUpdateNameSurname').siblings("span");
	 							   if($("#frmUserName").validate().form()==true){
												  $.post('/kullanicibilgileri_action.cfm',{txtUpdateNameSurname:$('#txtUpdateNameSurname').val()},function(xml){
																										$('.showusernamesurname').html($('#txtUpdateNameSurname').val());
																										$('#txtUpdateNameSurname').val("");
																										$('#btnUpdateNameSurname').next("span").html('Güncellendi').fadeTo(0,900).fadeTo(900,0);	
																									  });
								  }
								});
							   $('#btnUpdateEmail').click(function(){
									if($("#frmUserEmail").validate().form()==true){
												  $.post('/kullanicibilgileri_action.cfm',{txtUpdateEmail:$('#txtUpdateEmail').val()},function(xml){
																						   if(xml.replace(/^\s+|\s+$/g,"")==''){
																									  $('.showuseremail').html($('#txtUpdateEmail').val());
																										$('#txtUpdateEmail').val("");
																										$('#btnUpdateEmail').next("span").html('Güncellendi').fadeTo(0,900).fadeTo(900,0);
																						   }else if(xml.replace(/^\s+|\s+$/g,"")=='-1'){
																							   $('#txtUpdateEmail').val("");
																								$('#btnUpdateEmail').next("span").html('E-mail kullanılıyor').fadeTo(0,900);
																						   }
													});
									}
								});
							   $('#btnUpdateNickname').click(function(){
									if($("#frmUserNickname").validate().form()==true){
												  $.post('/kullanicibilgileri_action.cfm',{txtUpdateNickname:$('#txtUpdateNickname').val()},function(xml){
																					 if(xml.replace(/^\s+|\s+$/g,"")==''){
																								$('.showusernickname').html($('#txtUpdateNickname').val());
																								$('#txtUpdateNickname').val("");
																								$('#btnUpdateNickname').next("span").html('Güncellendi').fadeTo(0,900).fadeTo(900,0);
																					 }else if(xml.replace(/^\s+|\s+$/g,"")=='-1'){
																							   $('#txtUpdateNickname').val("");
																							   $('#btnUpdateNickname').next("span").html('Rumuz kullanılıyor').fadeTo(0,900);
																				     }
												  });
									}
								});
							   $('#btnUpdatePassword').click(function(){
									if($("#frmUserPassword").validate().form()==true){
												  $.post('/kullanicibilgileri_action.cfm',{txtUpdatePassword:$('#txtUpdatePassword').val(),txtUpdateOldPassword:$('#txtUpdateOldPassword').val()},function(xml){
																			if(xml.replace(/^\s+|\s+$/g,"")==''){
																					$('#txtUpdatePassword').val("");
																					$('#txtUpdateOldPassword').val("");
																					$('#btnUpdatePassword').next("span").html('Güncellendi').fadeTo(0,900).fadeTo(900,0);
																			}else if(xml.replace(/^\s+|\s+$/g,"")=='-1'){
																					$('#txtUpdatePassword').val("");
																					$('#txtUpdateOldPassword').val("");
																					$('#btnUpdatePassword').next("span").html('Yeni şifreniz son şifrenizden farklı olmalı').fadeTo(900,1);
																			}else if(xml.replace(/^\s+|\s+$/g,"")=='-2'){
																					$('#txtUpdatePassword').val("");
																					$('#txtUpdateOldPassword').val("");
																					$('#btnUpdatePassword').next("span").html('Eski şifreniz hatalı').fadeTo(900,1);
																			}else{
																					$('#txtUpdatePassword').val("");
																					$('#txtUpdateOldPassword').val("");
																					$('#btnUpdatePassword').next("span").html('Şifre değiştirilemedi').fadeTo(900,1);
																				}
												 });
									}
								});
							   $('input[name="chbUpdateIsuserealname"]').change(function(){
									/*if($("#frmUserName").validate().form()==true){*/
												  $.post('/kullanicibilgileri_action.cfm',{chbUpdate:'chbUpdate',chbUpdateIsuserealname:$('#chbUpdateIsuserealname').attr('checked')},function(){
																									  
																									  $('input[name="chbUpdateIsuserealname"]').next("span").html('Güncellendi').fadeTo(0,900).fadeTo(900,0);
												   });
									/*}*/
								});
							   $('#btnSaveInfo').click(function(){
									if($("#frmUserInfo").validate().form()==true){
												  $.post('/kullanicibilgileri_action.cfm',{cmbUpdateGender:$('#cmbUpdateGender').val(),txtUpdateBirthdate:$('#txtUpdateBirthdate').val(),txtUpdatePhone:$('#txtUpdatePhone').val(),txtUpdateCity:$('#txtUpdateCity').val(),cmbUpdateCountry:$('#cmbUpdateCountry').val(),txtUpdateWebsite:$('#txtUpdateWebsite').val(),txtUpdateAbout:$('#txtUpdateAbout').val()},function(){
																									$('#btnSaveInfo').next("span").html('Güncellendi').fadeTo(0,900).fadeTo(900,0);  
																									  });
									}
								});
							   
								$("#frmUserName").validate({
									rules: {
										txtUpdateNameSurname: {
											required: true
										}
									},
									messages: {
										txtUpdateNameSurname: "Ad soyad giriniz."
									},
									errorPlacement: function(error, element) {
										element.siblings("span").fadeTo(0,900);
										element.siblings("span").text("");
										error.appendTo( element.siblings("span") );
								   }
								});
									$("#frmUserEmail").validate({
										rules: {
											txtUpdateEmail: {
											required: true,
											email: true
											}
										},	
										messages: {
											txtUpdateEmail: "Geçerli e-mail adresi giriniz"
										},
										errorPlacement: function(error, element) {
											element.siblings("span").fadeTo(0,900);
											element.siblings("span").text("");
											error.appendTo( element.siblings("span") );
										}
									});
									
								$("#frmUserNickname").validate({
										rules: {
											txtUpdateNickname: {
											required: true
											}
										},	
										messages: {
											txtUpdateNickname: "Rumuz giriniz"
										},
										errorPlacement: function(error, element) {
											element.siblings("span").fadeTo(0,900);
											element.siblings("span").text("");
											error.appendTo( element.siblings("span") );
										}
									});
								$("#frmUserPassword").validate({
										rules: {
											txtUpdateOldpassword:{ required:true},
											txtUpdatePassword: {
											required: true
											}
										},	
										messages: {
											txtUpdateOldpassword: {required:"Eski şifrenizi giriniz"},
											txtUpdatePassword: {required:"Yeni şifre giriniz"}
										},
										errorPlacement: function(error, element) {
											element.next("span").fadeTo(0,900);
											error.appendTo( element.next("span") );
										}
									});		
								$("#frmUserInfo").validate({
										rules: {
											txtUpdateWebsite: {
											url: true
											}
										},	
										messages: {
											txtUpdateWebsite: {url:"Hatalı adres"}
										},
										errorPlacement: function(error, element) {
											element.siblings("span").fadeTo(0,900);
											element.siblings("span").text("");
											error.appendTo( element.siblings("span") );
										}
									});
								
								$("#txtUpdateEmail").blur(function(){
									var regex=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/;
							
									 if($("#txtUpdateEmail").val().replace(/^\s+|\s+$/g,"")!='' && regex.exec($("#txtUpdateEmail").val()) != null ){
											$.post('/signup_action.cfm',{txtEmail2:$("#txtUpdateEmail").val(),emailControl:'emailControl'},function(xml){
																																					
													if(xml.replace(/^\s+|\s+$/g,"")=='false') //email yok
													{
														
														$("#txtUpdateEmail").next("span").fadeTo(200,0.1,function() 
														{
															$("#txtUpdateEmail").next("span").html('').fadeTo(900,1,function()
															{
															 //redirect to secure page
															});
														});
													}
													else{
															$("#btnUpdateEmail").next("span").fadeTo(200,0.1,function()
															{
																$("#btnUpdateEmail").next("span").html('E-mail kullanılıyor').fadeTo(900,1);
															});
													}
											});
									}
								});
								
								$("#txtUpdateNickname").blur(function(){
									if($("#txtUpdateNickname").val().replace(/^\s+|\s+$/g,"")!=''){
											$.post('/signup_action.cfm',{txtUsername:$("#txtUpdateNickname").val(),usernameControl:'usernameControl'},function(xml){
													if(xml.replace(/^\s+|\s+$/g,"")=='false') //user yok
													{
														$("#txtUpdateNickname").next("span").fadeTo(200,0.1,function()
														{
															$("#txtUpdateNickname").next("span").html('').fadeTo(900,1,function()
															{
															 //redirect to secure page
															});
														});
													}
													else
													{
														$("#btnUpdateNickname").next("span").fadeTo(200,0.1,function()
														{
														$("#btnUpdateNickname").next("span").html('Rumuz kabul edilmedi').fadeTo(900,1);	
														});
													}
											});
									 }
								});
});
//Kontrol paneli javascript
//Common javascript
// JavaScript Document

//yorum oylama
//Filmi favorilere ekleme
function addfilmfavorite(){
	var anchorStr=decodeURI(location.search);
							$.post('/comment_action.cfm'+anchorStr,{btnAddFilmFavorite:'btnAddFilmFavorite'},function(html){
								var btnDeleteFilmFav=$('<input type="image">').attr('id','btnDeleteFilmFavorite').attr('title','Filmi Favorilerimden kaldır').attr('alt','Filmi Favorilerimden kaldır').attr('src','/resim/ui/film_isfavorite.gif');
								$('#favoritefilmdiv').html('').append(btnDeleteFilmFav).hide().fadeIn(3000);																					
								$('#btnDeleteFilmFavorite').addClass('pretty');
								$('#btnDeleteFilmFavorite').click(function(){deletefilmfavorite();});
							 });
	}
	function deletefilmfavorite(){
		 var anchorStr=decodeURI(location.search);
							$.post('/comment_action.cfm'+anchorStr,{btnDeleteFilmFavorite:'btnDeleteFilmFavorite'},function(html){
								var btnAddFilmFav=$('<input type="image">').attr('id','btnAddFilmFavorite').attr('title','Filmi Favorilerime Ekle').attr('alt','Filmi Favorilerime Ekle').attr('src','/resim/ui/film_addfavorite.gif');
								$('#favoritefilmdiv').html('').append(btnAddFilmFav).hide().fadeIn(3000);
								$('#btnAddFilmFavorite').addClass('pretty');
								$('#btnAddFilmFavorite').click(function(){addfilmfavorite();});
							});
		}
//Yazıyı favorilere ekleme
function addarticlefavorite(){
	var anchorStr=decodeURI(location.search);
							$.post('/comment_action.cfm',{aid:$('#hdArtID').val(),btnAddArticleFavorite:'btnAddArticleFavorite'},function(html){
								var btnDeleteArticleFav=$('<input type="image">').attr('id','btnDeleteArticleFavorite').attr('title','Yazıyı Favorilerimden kaldır').attr('alt','Yazıyı Favorilerimden kaldır').attr('src','/resim/ui/article_isfavorite.gif');
								$('#favoritearticlediv').html('').append(btnDeleteArticleFav).hide().fadeIn(3000);
								$('#btnDeleteArticleFavorite').addClass('pretty');																										
								$('#btnDeleteArticleFavorite').click(function(){deletearticlefavorite();});
							});
	}
	function deletearticlefavorite(){
		 var anchorStr=decodeURI(location.search);
							$.post('/comment_action.cfm',{aid:$('#hdArtID').val(),btnDeleteArticleFavorite:'btnDeleteArticleFavorite'},function(html){
								var btnAddArticleFav=$('<input type="image">').attr('id','btnAddArticleFavorite').attr('title','Yazıyı Favorilerime Ekle').attr('alt','Yazıyı Favorilerime Ekle').attr('src','/resim/ui/article_addfavorite.gif');
								$('#favoritearticlediv').html('').append(btnAddArticleFav).hide().fadeIn(3000);
								$('#btnAddArticleFavorite').addClass('pretty');																																				
								$('#btnAddArticleFavorite').click(function(){addarticlefavorite();});
							});
		}
//yorum guncelleme suresi bittiginde calışır
function timeExpired(){
					   var commentID=$(this).attr('id').split("_")[1];
					   if($('#cancelEdit_'+commentID).attr('id')!=undefined){
						   //textarea yı kaldırmak icin cancel butonu tetiklenir
						   $('#cancelEdit_'+commentID).trigger('click');
						   //cancel le eklenen düzenle linki kaldırılır
						   $('#editComment_'+commentID).remove();
						   $('#ctimer_'+commentID).html('Süreniz doldu!');
						}else{
						   $('#editComment_'+commentID).remove();
						   $('#ctimer_'+commentID).html('Süreniz doldu!');

						}
 }
$(document).ready(function(){
					
				   //comment editleme icin sayac
				   $('span.countdown').each(function(){
						var spanID = $(this).attr('id'); 
						$('#'+spanID).countdown({until:spanID.split("_")[2], format: 'MS',compact: true,onExpiry:timeExpired});
					});
				   
					//comment editlemede edit(Düzenle) butonları click olayları set ediliyor
					$('a.editComment').each(function(){
						var commentEditAnchorID= $(this).attr('id');
						$('#'+commentEditAnchorID).bind('click',function(event){
													 var commentID = $(this).attr('id').split('_')[1]; 
													 var oldComment=$('#commenttext_'+commentID).html();
													 oldComment=$.trim(oldComment.replace(/\n/g,'#chr(10)#'));
													 //alert(oldComment);
													 editComment(commentID,oldComment);
													 });
						  });
					function formatText(str){
						var newStr;
						newStr=str.replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/#chr\(10\)#/g,'<br>');
						return newStr;
						}
						function formatTextForTextarea(str){
						var newStr;
						newStr=str.replace(/#chr\(10\)#/g,'\n').replace(/<br>/g,'\n').replace(/&gt;/g,'>').replace(/&lt;/g,'<');
						return newStr;
						}
					//yorum edit butonu click olayı
					function editComment(commentID,oldComment){
						//update cancel butonları
						var btnCommentCancel=$('<input type="button">').attr('id','cancelEdit_'+commentID).addClass('c_updatecancel').attr('value','Vazgeç');
						var btnCommentSave=$('<input type="button">').attr('id','saveEdit_'+commentID).addClass('c_updatesubmit').attr('value','Güncelle');
						var btnCommentDelete=$('<input type="button">').attr('id','deleteComment_'+commentID).addClass('c_updatedelete').attr('value','Sil');
						var btnRow=$("<div>").attr('id','divRow_'+commentID).addClass("updatebtnrow").html(btnCommentSave).append(btnCommentCancel).append(btnCommentDelete);
						//textarea
						var editableTextarea=$('<textarea>').attr("id",'txtCommentEdit_'+commentID).val(formatTextForTextarea(oldComment));
						editableDiv=$("<div>").attr('id','divCommentEdit_'+commentID).addClass("commentedit").html(editableTextarea).append(btnRow);
						$(editableDiv).replaceAll($('#commenttext_'+commentID));
						$(btnCommentCancel).bind('click',function(event){cancelEditComment(commentID,oldComment);});
						$(btnCommentSave).bind('click',function(event){saveEditComment(commentID);});
						$(btnCommentDelete).bind('click',function(event){deleteEditComment(commentID);});
						$('#editComment_'+commentID).remove();
					}
					//yorum vazgec buton click olayı
					function cancelEditComment(commentID,oldComment){
						var commentDiv=$("<div>").attr('id','commenttext_'+commentID).addClass("commenttext").html(formatText(oldComment));
						$(commentDiv).replaceAll($('#divCommentEdit_'+commentID));
						var commentEditAnchor=$('<a>').attr('id','editComment_'+commentID).addClass('editComment').html('Düzenle');
						$('#ctimer_'+commentID).prepend(commentEditAnchor);
						$('#editComment_'+commentID).bind('click',function(event){editComment(commentID,oldComment);});
					}
					//yorum delete butonu click olayı
					function deleteEditComment(commentID){
							var result=confirm('Silmek isteğinize emin misiniz?');							
							if(result==true){
							$.post('/comment_action.cfm',{commentID:commentID,btnDelete:'delete'},function(xml){
									if(xml.replace(/^\s+|\s+$/g,"")!='-1'){//-1 donmesi durumunda guncelleme yapılamamıştır
									$('#divCommentEdit_'+commentID).parent().remove();
									}
									});
							}
					}
					//yorum update butonu click olayı
					function saveEditComment(commentID){
						var newComment=$('textarea#txtCommentEdit_'+commentID).val();
						newComment=$.trim(newComment.replace(/\n/g,'#chr(10)#'));
						if(newComment==''){
									alert('Mesaj yazınız');
									return false;
						}else
						{
							//alert(newComment);
							$.post('/comment_action.cfm',{commentID:commentID,newComment:newComment},function(xml){
									if(xml.replace(/^\s+|\s+$/g,"")!='-1'){//-1 donmesi durumunda guncelleme yapılamamıştır
									
									var divCommentText=$('<div>').attr('id','commenttext_'+commentID).addClass('commenttext').html(formatText(newComment));
										$(divCommentText).replaceAll('#divCommentEdit_'+commentID);
										var commentEditAnchor=$('<a>').attr('id','editComment_'+commentID).addClass('editComment').html('Düzenle');
										$('#ctimer_'+commentID).prepend(commentEditAnchor);
										$('#editComment_'+commentID).unbind('click');
										$('#editComment_'+commentID).bind('click',function(event){editComment(commentID,newComment); });
										$('#divRow_'+commentID).remove();
										} 
									});
						}
					}
	//yorum ekleme
$('#c_submit').click(function(){
 if($('#txtComment').val()==''){
	alert('Mesaj yazınız');
	}else{
		   if($('#hdFID').val()!='' && $('#hdFID').val()!=undefined){
				$.post('/comment_action.cfm',{filmID:$('#hdFID').val(),txtComment:$('#txtComment').val().replace(/\n/g,'#chr(10)#')},
					function(html){
						
					$('#divComments').append(html);
					//yeni gelen edit butonu event i
					var commentID=$('#divComments div:last-child .editComment').attr('id').split('_')[1];
					$('#divComments div:last-child .editComment').unbind('click');
					var newComment=$('#txtComment').val();
					$('#divComments div:last-child .editComment').bind('click',function(event){editComment(commentID,newComment.replace(/\n/g,'#chr(10)#'));});
					 //gelen html de sayac spanı event i
					 //burdaki geri sayım suresi application cfc dekiyle eşit olmalı
					$('#divComments div:last-child .countdown ').countdown({until:5*60, format: 'MS',compact: true,onExpiry:timeExpired});
					$('#divComments div:last-child').filter('.commentrowitem').hide().fadeIn("slow");
					$('#txtComment').val("");
					$.post('/comment_action.cfm',{filmID:$('#hdFID').val(),getFilmCommentCount:'getFilmCommentCount'},
						function(html){
							$('#divCommentCnt a').html(html);
							});
				});
			}else if($('#hdArtID').val()!='' && $('#hdArtID').val()!=undefined){
				$.post('/comment_action.cfm',{articleID:$('#hdArtID').val(),txtComment:$('#txtComment').val().replace(/\n/g,'#chr(10)#')},
					function(html){
					$('#divComments').append(html);
					//yeni gelen edit butonu event i
					var commentID=$('#divComments div:last-child .editComment').attr('id').split('_')[1];
					$('#divComments div:last-child .editComment').unbind('click');					
					var newComment=$('#txtComment').val();
					$('#divComments div:last-child .editComment').bind('click',function(event){editComment(commentID,newComment);});
					 //gelen html de sayac spanı event i
 					 //burdaki geri sayım suresi application cfc dekiyle eşit olmalı
					$('#divComments div:last-child .countdown ').countdown({until:5*60, format: 'MS',compact: true,onExpiry:timeExpired});
					$('#divComments div:last-child').filter('.commentrowitem').hide().fadeIn("slow");
					$('#txtComment').val("");
					$.post('/comment_action.cfm',{articleID:$('#hdArtID').val(),getArticleCommentCount:'getArticleCommentCount'},
						function(html){
							$('#divCommentCnt a').html(html);
							});
				});
			}
	}
 });
	  //yorum oylama click olayı
	  $('.commentratebutton').click(function(){
			var btnInfoArr=this.id.split('_');
			$.post('/comment_action.cfm',{btnCommentRate:this.id},	
			function(html){
			$('#commentRatingSpan_'+btnInfoArr[1]).html(html.replace(/^\s+|\s+$/g,""));
			$('#commentRatingSpan_'+btnInfoArr[1]).hide().fadeIn("slow");
			});
		});
				
	//Favorilerime film ekleme
	$('#btnAddFilmFavorite').click(function(){
									var anchorStr=decodeURI(location.search);
									$.post('/comment_action.cfm'+anchorStr,{btnAddFilmFavorite:'btnAddFilmFavorite'},function(html){
										var btnDeleteFilmFav=$('<input type="image">').attr('id','btnDeleteFilmFavorite').attr('title','Filmi Favorilerimden kaldır').attr('alt','Filmi Favorilerimden kaldır').attr('src','/resim/ui/film_isfavorite.gif');
										$('#favoritefilmdiv').html('').append(btnDeleteFilmFav).hide().fadeIn(3000);
										$('#btnDeleteFilmFavorite').addClass('pretty');	
										$('#btnDeleteFilmFavorite').click(function(){deletefilmfavorite();});
																			 });
									});
	//Favorilerimden film silme
	$('#btnDeleteFilmFavorite').click(function(){
								   var anchorStr=decodeURI(location.search);
									$.post('/comment_action.cfm'+anchorStr,{btnDeleteFilmFavorite:'btnDeleteFilmFavorite'},function(html){
										var btnAddFilmFav=$('<input type="image">').attr('id','btnAddFilmFavorite').attr('title','Filmi Favorilerime Ekle').attr('alt','Filmi Favorilerime Ekle').attr('src','/resim/ui/film_addfavorite.gif');
										$('#favoritefilmdiv').html('').append(btnAddFilmFav).hide().fadeIn(3000);
										$('#btnAddFilmFavorite').addClass('pretty');
										$('#btnAddFilmFavorite').click(function(){addfilmfavorite();});
									});
									});
//Favorilerime yazı ekleme
	$('#btnAddArticleFavorite').click(function(){
									var anchorStr=decodeURI(location.search);
									$.post('/comment_action.cfm',{aid:$('#hdArtID').val(),btnAddArticleFavorite:'btnAddArticleFavorite'},function(html){
										var btnDeleteArticleFav=$('<input type="image">').attr('id','btnDeleteArticleFavorite').attr('title','Yazıyı Favorilerimden kaldır').attr('alt','Yazıyı Favorilerimden kaldır').attr('src','/resim/ui/article_isfavorite.gif');
										$('#favoritearticlediv').html('').append(btnDeleteArticleFav).hide().fadeIn(3000);
										$('#btnDeleteArticleFavorite').addClass('pretty');																										
										$('#btnDeleteArticleFavorite').click(function(){deletearticlefavorite();});
																			 });
									});
	//Favorilerimden yazı silme
	$('#btnDeleteArticleFavorite').click(function(){
								   var anchorStr=decodeURI(location.search);
									$.post('/comment_action.cfm',{aid:$('#hdArtID').val(),btnDeleteArticleFavorite:'btnDeleteArticleFavorite'},function(html){																											
										var btnAddArticleFav=$('<input type="image">').attr('id','btnAddArticleFavorite').attr('title','Yazıyı Favorilerime Ekle').attr('alt','Yazıyı Favorilerime Ekle').attr('src','/resim/ui/article_addfavorite.gif');
										$('#favoritearticlediv').html('').append(btnAddArticleFav).hide().fadeIn(3000);
										$('#btnAddArticleFavorite').addClass('pretty');							
										$('#btnAddArticleFavorite').click(function(){addarticlefavorite();});
										});
									});
	});	

//Tooltip 
$(function() {
	$('.pretty').tooltip({
		track: true,
		delay: 0,
		showURL: false,
		showBody: " - ",
		extraClass: "pretty",
		fixPNG: true,
		left: -120
	});
});
//star bilgileri tum filmler bolumu
function showHideFilms(){
	if(($('.completefilmography ul').css('display').toLowerCase()).indexOf('none')!=-1){
		$('.completefilmography ul').show();							   
	}else{
		$('.completefilmography ul').hide();								   
	}
}
//slide show
function slideSwitch() {
    var $active = $('#slideshow .active');
    if ( $active.length == 0 ) $active = $('#slideshow .slideitem:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next() 
        : $('#slideshow .slideitem:first');

    // uncomment the 3 lines below to pull the images in random order
    
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );
	//$active.fadeOut("fast");
	$active.removeClass('active');
	//$next.show("fast");
	$next.addClass('active');
}
$(function() {
    setInterval( "slideSwitch()", 5000 );
});
//Common javascript bitis
//profil javascript
$(document).ready(function(){
						   var pageCnt=1;
   						   $('.lnkshowmore').click(function(){
										  pageCnt=pageCnt+1;
										  var queryString='/topluluk/profil_action.cfm?'+document.location.href.substring(document.location.href.lastIndexOf('?')+1);
											$.getJSON(queryString,{page:pageCnt},function(JSON){																									
															   $(".showmore .lnkshowmore").hide();
															   $(".showmore .lnkshowmore").html('<img src="/resim/ui/loader.gif" align="absmiddle">&nbsp;<span class="loading">Loading ...</span>');
															   $('.showmore .lnkshowmore').fadeIn(500).fadeOut(400,function(){													
																		  $.each(JSON.results, function(item, value){
																					  if(value.ismore=='true' ){
																					  $(".showmore .lnkshowmore").html('&darr; Daha Fazla').show();
																						  }
																					  $('.all ul').append(value.result);
																  
																		 });
																	  });				 
																  }); 
											return false;
											 });
						   });
//profil javascript bitiş
//Anket javascript
$(document).ready(function(){
						   $('.votesubmituid input[type=button]').each(function(){
																 $(this).click(formProcess);
																 });
						   
						   
						   if ($("#poll-results").length > 0 ) {
    								animateResults();
  							}
  
						   });

function formProcess(event){
	var btnID = $(this).attr('id');
	var surveyID=$(this).attr('id').split('_')[1];
	var surveyOptionID=$('#form_'+surveyID+' input:radio:checked').val();
	if(surveyOptionID!='' && surveyOptionID!=undefined){
		 event.preventDefault();
			votedID = surveyOptionID;
		  /*$("#poll_"+surveyID).fadeOut("slow",function(){
			$(this).empty();
			$.getJSON("/survey_action.cfm",{surveyID:surveyID,surveyOptionID:surveyOptionID},loadResults);		
		  });*/
		  $(this).empty();
			$.getJSON("/survey_action.cfm",{surveyID:surveyID,surveyOptionID:surveyOptionID},loadResults);
	}else{
		alert('Seçeneklerden birini seçiniz...');
		}
   
}

function animateResults(){
  $("#poll-results div").each(function(){
      var percentage = $(this).prev().text();
      $(this).css({width: "0%"}).animate({
				width: percentage}, 'slow');
  });
}
var OPT_ID = 0;
var OPT_TITLE = 1;
var OPT_VOTES = 2;
function loadResults(data) {

  var total_votes = 0;
  var percent;
  
  for (result in data.result) {
    total_votes = total_votes+parseInt(data.result[result][OPT_VOTES]);
  }
  var results_html = "<div id='poll-results'><dl class='graph'>";
  for (result in data.result) {
    percent = Math.round((parseInt(data.result[result][OPT_VOTES])/parseInt(total_votes))*100);
    if (data.result[result][OPT_ID] !== votedID) {
      results_html = results_html+"<dt class='bar-title'>"+data.result[result][OPT_TITLE]+"</dt><dd class='bar-container'><span class='percentdata'>"+percent+"%</span><div id='bar"+data.result[result][OPT_ID]+"'style='width:0%;'>&nbsp;</div></dd><div class='clear'></div>";
    } else {
      results_html = results_html+"<dt class='bar-title'>"+data.result[result][OPT_TITLE]+"</dt><dd class='bar-container'><span class='percentdata'>"+percent+"%</span><div id='bar"+data.result[result][OPT_ID]+"'style='width:0%;background-color:#0066cc;'>&nbsp;</div></dd><div class='clear'></div>";
    }
  }
  
  	results_html = results_html+"</dl><div class='clear'></div>\n";/*<p>Toplam Oy: "+total_votes+"</p></div>*/
	$("#poll_"+data.surveyID).replaceWith(results_html);
	animateResults();
}
//Anket javascript bitis

//haber arşiv datetimepicker
$(document).ready(function() { 
		$('#btnNewsArchive').click(function(){
								redirectSearchForNewsArchive($('#txtNewsDateRange').val());
		});
	});
	function redirectSearchForNewsArchive(dr){
		var dateRange=dr.replace(/\s+/g,"");
		var dates=dateRange.split("-");
		var startDate=dates[0].split("/");
		if(dr==""){
			alert("Tarih seçiniz...");
			}else{
				var newStart=startDate[2]+(startDate[0].length==1?"0"+startDate[0]:startDate[0])+(startDate[1].length==1?"0"+startDate[1]:startDate[1]);
				if(dates[1]==undefined){
				  var newEnd=newStart;
				}else{
				  var endDate=dates[1].split("/");
				  var newEnd=endDate[2]+(endDate[0].length==1?"0"+endDate[0]:endDate[0])+(endDate[1].length==1?"0"+endDate[1]:endDate[1]);
				}
				 document.location="http://"+location.hostname+"/search.cfm?dr="+newStart+"-"+newEnd;
		}
		
	}
////haber arşiv datetimepicker bitiş

//yarışma javascript
$(document).ready(function(){			
						   $("#btnCompetitionAnswer").click(voteCompetition);
		function voteCompetition(event){
			var competitionSurveyID = "1";
			var competitionAnswer1=$("#cmbOption1").val();
			var competitionAnswer2=$("#cmbOption2").val();
			var competitionAnswer3=$("#txtFilm").val();
			if(competitionAnswer1!='' && competitionAnswer1!=undefined ){
				if(competitionAnswer1!=competitionAnswer2){
					$.getJSON("/survey_action.cfm",{competitionSurveyID:competitionSurveyID,competitionAnswer1:competitionAnswer1,competitionAnswer2:competitionAnswer2,competitionAnswer3:competitionAnswer3}, loadCompetitionResult);
					}				
			}else{
				$("#cmbOption1").siblings("span").fadeTo(0,900);
										//$("#cmbOption2").siblings("span").text("");
										$("#cmbOption1").siblings("span").html("Film seçiniz...");
			}
		}


		function loadCompetitionResult(data) {
			var a=data.result.toString();
			$(".competition").html(a);

		}	
		checkSecondOption();
});

		function checkSecondOption(){
			var competitionAnswer2=$("#cmbOption2").val();
			var competitionAnswer1=$("#cmbOption1").val();
			if(competitionAnswer2=='-1'){//diger secenegi secilmiş ise
				$("#txtFilm").attr("disabled",false);
			}else{
				if(competitionAnswer2==competitionAnswer1 && competitionAnswer2!=''){
					
					$("#cmbOption2").siblings("span").fadeTo(0,900);
										//$("#cmbOption2").siblings("span").text("");
										$("#cmbOption2").siblings("span").html("Farklı film seçiniz...");
					
					}else{
						$("#cmbOption2").siblings("span").text("");
						}
				$("#txtFilm").attr("value","");
				$("#txtFilm").attr("disabled",true);
				
			}
			
		}
//yarışma javascript bitiş
//fragman sayfası slider
$(document).ready(function() {		
	
	//Execute the slideShow
	if($("#gallery").attr("id")!=undefined){
			slideShow();
		}
	

});

function slideShow() {

	//Set the opacity of all images to 0
	$('#gallery a').css({opacity: 0.0});
	
	//Get the first image and display it (set it to full opacity)
	$('#gallery a:first').css({opacity: 1.0});
	
	//Set the caption background to semi-transparent
	$('#gallery .caption').css({opacity: 0.7});

	//Resize the width of the caption according to the image width
	$('#gallery .caption').css({width: $('#gallery a').find('img').css('width')});
	
	//Get the caption of the first image from REL attribute and display it
	$('#gallery .content').html($('#gallery a:first').find('img').attr('rel'))
	.animate({opacity: 0.7}, 400);
	
	//Call the gallery function to run the slideshow, 6000 = change to next image after 6 seconds
	setInterval('gallery()',6000);
	
}

function gallery() {
	
	//if no IMGs have the show class, grab the first image
	var current = ($('#gallery a.show')?  $('#gallery a.show') : $('#gallery a:first'));

	//Get next image, if it reached the end of the slideshow, rotate it back to the first image
	var next = ((current.next().length) ? ((current.next().hasClass('caption'))? $('#gallery a:first') :current.next()) : $('#gallery a:first'));	
	
	//Get next image caption
	var caption = next.find('img').attr('rel');	
	
	//Set the fade in effect for the next image, show class has higher z-index
	next.css({opacity: 0.0})
	.addClass('show')
	.animate({opacity: 1.0}, 1000);

	//Hide the current image
	current.animate({opacity: 0.0}, 1000)
	.removeClass('show');
	
	//Set the opacity to 0 and height to 1px
	$('#gallery .caption').animate({opacity: 0.0}, { queue:false, duration:0 }).animate({height: '1px'}, { queue:true, duration:300 });	
	
	//Animate the caption, opacity to 0.7 and heigth to 100px, a slide up effect
	$('#gallery .caption').animate({opacity: 0.7},100 ).animate({height: '54px'},500 );
	
	//Display the content
	$('#gallery .content').html(caption);
	
	
}
//fragman sayfası slider bitiş

//kullanıcı resim upload
$(document).ready(function(){
				  $("#btnUserPictureUpload").click(function(){
															
															ajaxFileUpload();
															});
				  $("#rotateImage").click(function(){
															$.post("/kullanicibilgileri_action.cfm",{rotate:'true',filename:$("#imgProfile").attr('src').substring($("#imgProfile").attr("src").lastIndexOf('/')+1)},function(xml){
												var newSrc=$("#imgProfile").attr('src');
												 $("#imgProfile").attr("src",newSrc+"?timestamp="+Math.random()*100);
												});
												return false;
												});
					});

function ajaxFileUpload()
	{
		$("#loading")
		.ajaxStart(function(){
			$(this).show();
		})
		.ajaxComplete(function(){
			$(this).hide();
		});

		$.ajaxFileUpload
		(
			{
				url:'upload_action.cfm',
				secureuri:false,
				fileElementId:'fileToUpload',
				dataType: 'json',
				success: function (data, status)
				{ 
					if(typeof(data.error) != 'undefined')
					{
						if(data.error != '')
						{
							alert(data.error);
						}else
						{
							//var src = $("#imgWaiting").attr("src").match(/[^\.]+/) + data.file;
							if($("#imgProfile").attr("src")!="undefined"){
							//var newSrc = $("#imgProfile").attr("src").substring(0,$("#imgProfile").attr("src").lastIndexOf('/')+1)+data.file;
            				//$("#imgProfile").attr("src", newSrc);
							$("#imgProfile").attr("src", data.filePath);
							}
							//alert(data.msg);
                            alert("Resminiz başarıyla yüklendi...");
						}
					}
				},
				error: function (data, status, e)
				{
					alert(e);
				}
			}
		)
		
		return false;

	}
//kullanıcı resim upload bitis
//Karakter filtresi
var r={
                'special':/[\W]/g,
                'quotes':/['\''&'\"']/g,
                'dec':/[^\d&\,]/g,
                'num':/[^\d]/g,
				'exceptSpecial':/[(<>\/&]/g
            }

            function valid(o,w)
            {
                o.value = o.value.replace(r[w],'');
                if (o.value.indexOf(',') != -1)
                {
                    o.value = o.value.replace(',,',',');
                }
                var deger=o.value.substr(o.value.indexOf(',')+1);
                deger=deger.replace(',','');
                o.value=o.value.substr(0,o.value.indexOf(',')+1)+deger;
            }
//Karakter filtresi
//Yazıları twitter facebook friendfeed de paylaş
 function share_click(siteName) {
	  var title = encodeURIComponent(document.title);
	  var url = encodeURIComponent(document.location.href);
	  var options = "toolbar=0,status=0,width=626,height=436,menubar=no,location=no,resizable=no,scrollbars=1";
	  var lastUrl='';
	  if(siteName=="facebook"){
	  lastUrl="http://www.facebook.com/sharer.php?u=" + url + "&t=" + title;
	  }else if(siteName=="twitter"){
	  lastUrl="http://twitter.com/home?status=" +title+' '+ url ;
	  }else if(siteName=="friendfeed"){
	  lastUrl="http://friendfeed.com/share/bookmarklet/frame#url=" + url + "&title=" + title;
	  }
	  window.open(lastUrl,'sharer',options);
	  return false;
 }
//Yazıları twitter facebook friendfeed de paylaş bitiş
//film sayfasında dizi bolumleri acılıp kapanma
$(document).ready(function(){
						   $(".showHideEpisodes").click(function(){
									$(this).next(".seasonepisodes").toggle();
							});
});
//film sayfasında dizi bolumleri acılıp kapanma