// JavaScript Document
$(document).ready(function() {
	function randomr(minVal,maxVal,floatVal){
	  var randVal = minVal+(Math.random()*(maxVal-minVal));
	  return typeof floatVal=='undefined'?Math.round(randVal):randVal.toFixed(floatVal);
	}
    $('.tags  span').each(function(){  cs =['c1','c2','c3','c5','c7']; 
		$(this).removeClass();
		$(this).addClass(cs[Math.floor(Math.random()*cs.length)]);
		$(this).css("font-size",(randomr(12,35))+"px");
		$(this).css("font-size",(randomr(12,35))+"px");
	});
	if ($.browser.msie && $.browser.version.substr(0,1)>7){}else{
		$('.c .l .bar,.box .bh,.box .bh2').css("line-height","1px");
		Cufon.replace('.bar.bar1',{ fontFamily: "00333",'textShadow': '2px 2px 0 #9fb0b8' /*,color: '-linear-gradient(#FFFFFF, #a1a1a1)'*/} );
		Cufon.replace('.bar.bar2',{ fontFamily: "00333",'textShadow': '2px 2px 0 #9fb0b8' /*,color: '-linear-gradient(#FFFFFF, #a1a1a1)'*/} );
		Cufon.replace('.bar.bar3',{ fontFamily: "00333",'textShadow': '2px 2px 0 #edac00' /*,color: '-linear-gradient(#FFFFFF, #a1a1a1)'*/} );
		Cufon.replace('.bar.bar4 .cufon',{ fontFamily: "00333",'textShadow': '2px 2px 0 #9fb0b8' /*,color: '-linear-gradient(#FFFFFF, #a1a1a1)'*/} );
		Cufon.replace('.box .bh',{ fontFamily: "00333",'textShadow': '2px 2px 0 #edac00' /*,color: '-linear-gradient(#FFFFFF, #a1a1a1)'*/} );
		Cufon.replace('.box .bh2',{ fontFamily: "00333",'textShadow': '2px 2px 0 #9fb0b8' /*,color: '-linear-gradient(#FFFFFF, #a1a1a1)'*/} );
		Cufon.replace('.tags span',{ fontFamily: "00333",'textShadow': '1px 1px 0 #eee' /*,color: '-linear-gradient(#FFFFFF, #a1a1a1)'*/} );
		Cufon.replace('a.submit',{ fontFamily: "00333",'textShadow': '2px 2px 0 #9fb0b8' /*,color: '-linear-gradient(#FFFFFF, #a1a1a1)'*/} );
		Cufon.replace('a.submit',{ fontFamily: "00333",'textShadow': '2px 2px 0 #9fb0b8' /*,color: '-linear-gradient(#FFFFFF, #a1a1a1)'*/} );
		Cufon.replace('.bar6',{ fontFamily: "00333",'textShadow': '2px 2px 0 #9fb0b8' /*,color: '-linear-gradient(#FFFFFF, #a1a1a1)'*/} );
		Cufon.replace('.bh5',{ fontFamily: "00333",'textShadow': '2px 2px 0 #edac00' /*,color: '-linear-gradient(#FFFFFF, #a1a1a1)'*/} );
		Cufon.replace('.barb2 .p',{ fontFamily: "00333",'textShadow': '2px 2px 0 #9fb0b8' /*,color: '-linear-gradient(#FFFFFF, #a1a1a1)'*/} );
		Cufon.now();
	}
	if($.browser.msie){$('cufoncanvas').css('top','-2px')}
    $('.mhide').each(function(i,e){ $(this).attr('title',$(this).val());
      $(this).bind('focus',function(){ if($(this).val()==$(this).attr('title'))$(this).val('');});
	  $(this).bind('blur',function(){ if($(this).val()=='')$(this).val($(this).attr('title'));});	 
    });
	$('.absmiddle').attr('align','absmiddle');
	if($.browser.msie)$('.absmiddle').css('vertical-align','middle');
	else $('.absmiddle').css('vertical-align','sub');
	
	var top="-20px",bot="-20px"; 
	$('.video .img').hover(function(){ 
		//top = $(this).find('.time').css('top');
		//bot = $(this).find('.desc').css('bottom');
		$(this).find('.time').animate({'top':0});
		$(this).find('.desc').animate({'bottom':0});},function(){
		$(this).find('.time').animate({'top':top});
		$(this).find('.desc').animate({'bottom':bot});
	});
	/*
	act=false;
	$('a.d').click(function(){
							
//      $('.slideh > div:last-child').fadeOut()
//	  $('.slidehidden > div:last-child').prependTo('.slideh ').hide().slideDown(function(){
//	  $('.slideh > div:last-child').prependTo('.slidehidden');
//	  });
	  
	  //$('.slidehidden > div:last-child').prependTo('.slideh').hide().slideDown();
	  //$('.slideh > div:last-child').fadeOut();
	  if(act==false){ act=true;
		  $('.slidehidden > div:last-child').prependTo('.slideh').hide().slideDown();
		  $('.slideh > div:last-child').animate({'opacity':'toggle','height':'toggle','margin':'toggle','padding-top':'toggle','padding-bottom':'toggle'}
		  ,function(){
			$(this).appendTo('.slidehidden').animate({'opacity':'toggle','height':'toggle','margin':'toggle','padding-top':'toggle','padding-bottom':'toggle'});
			act=false;
		  });
	  }
	  return false;
	});
	
	$('a.u').click(function(){
	  if(act==false){ act=true;
		  $('.slidehidden > div:first-child').appendTo('.slideh');
		  $('.slideh > div:first-child').animate({'opacity':'toggle','height':'toggle','margin':'toggle','padding-top':'toggle','padding-bottom':'toggle'}
		  ,function(){
			$(this).prependTo('.slidehidden').animate({'opacity':'toggle','height':'toggle','margin':'toggle','padding-top':'toggle','padding-bottom':'toggle'});
			act=false;
		  });
	  }
	  return false;
	});
	*/
	
	$('.selbox').selectbox({className:'jquery-selbox'}).bind('change',function(){});
	
	
	$('a.youtube').click(function(){
		if ($("#fileid").val() == "yukleniyor")  {
			alert("Video yükleme devam ediyor. Önce iptal ediniz.");
		}
		else {
		if(!$('.videoyuklesec').is(':hidden')) $('.videoyuklesec').hide();
		$(this).toggleClass('act');
		if($('.bary').is(':hidden')) {
		  $('.bary').fadeIn().find('input').removeAttr('disabled')//.focus();
		  $("#vYoutube").addClass("zorunlu");
		  $('#gozat').css('opacity','0.5'); }
		else {
		  $('.bary').fadeOut();
		  $('#textfield').attr('disabled', 'disabled');
		$('#gozat').css('opacity','1');
		  }
		  
		  $("#fileid").val("youtube");
		} 
	});
	
			$('a.gozat').click(function(){
		if(!$('.bary').is(':hidden')) $('.bary').hide();
		if($('.videoyuklesec').is(':hidden')){
		  $('.videoyuklesec').fadeIn().find('input[name=videofile]').fadeIn().removeAttr('disabled');//.focus();
		  //$('.file1').hide();
		  }
		else {
		  $('.videoyuklesec').fadeOut();
			$('.file1').attr('disabled', 'disabled');}
			$("#fileid").val("upl");
	});

	
	$('.pass,.pass2').keyup(function(){
	  $('.ps').attr('src','images/ps'+passwordStrength($('.pass').val())+'.png');
	  if($('.pass2').val()!="") {
		if($('.pass').val()==$('.pass2').val()){
		  $('.p2').attr('src','images/ok.png');
		}else{
		  $('.p2').attr('src','images/er.png');
		}$('.p2').show('slow');
	  }
	});
	
	
	$('.unchk').click(function(){
		$.get("kontrol.php",{usrnm:$("input[name=username]").val()}, function(data) {
			if(data.trim()=="true"){
			  $('.uc').attr('src','images/ok.png');
			}else{
			  $('.uc').attr('src','images/er.png');
			}$('.uc').show('slow'); 
		});
	  return false;
	});  
	
		$('a[name=msj-sil]').click(function(){
		if(confirm("mesaj silinsin mi ?")){
		$.get("prt.php",{act:'msjsil',msjid:$(this).attr('href')}, function(data) {
		});
		$(this).parents('.com2:eq(0)').fadeOut();
		}
	  return false;
	});
	
	$('.fav').click(function(){
		$.get("prt.php",{act:'fav',vID:$("input[name=gid]").val()}, function(data) {
		alert(data);
		});

	  return false;
	});
	
		$('a[name=ark-ekle]').click(function(){
		$.get("prt.php",{act:'arkekle',arkid:$(this).attr('href')}, function(data) {
		alert(data);
		});
	  return false;
	});
		$('.err').click(function(){
		$.get("prt.php",{act:'err',vID:$("input[name=gid]").val()}, function(data) {
		alert(data);
		});

	  return false;
	});

	$('.barm a').click(function(){
		if($(this).prev().length>0)
		$(this).toggleClass('act');
		$(this).prev().toggle();
	});
    
	
  	$(".tabb").tabs(".tabs",{
		onBeforeClick: function(event,tabIndex){},
		effect: 'fade', 
        fadeOutSpeed: "slow" ,rotate: true 
	});
  	$(".tabb2").tabs(".tabc",{
		onBeforeClick: function(event,tabIndex){},
		effect: 'slide', 
        fadeOutSpeed: "slow" ,rotate: true 
	});
	
	function wait(delay) {
		var startTime = new Date();
		var endTime = null;
		do {
			endTime = new Date();
		} while ((endTime - startTime) < delay);
	}
	
	scrol = $(".scroll").scrollable({
		api:true,
		size:4,
		vertical:true,
		hoverClass: 'act'
	});
	$('.snext').click(function(){
		$(".scroll .items > div").eq(scrol.getIndex()).
		animate({'opacity':0},
				function(){setTimeout("scrol.next()",50);});
	});
	$('.sprev').click(function(){
		scrol.prev();
		setTimeout(function(){
		$(".scroll .items > div").eq(scrol.getIndex()).
		animate({'opacity':1})},400);
	});
	
	scrol2 = $(".scroll2").scrollable({
		api:true,
		size:4,
		vertical:true,
		hoverClass: 'act'
	});
	$('.snext2').click(function(){
		$(".scroll2 .items > div").eq(scrol2.getIndex()).
		animate({'opacity':0},
				function(){setTimeout("scrol2.next()",50);});
	});
	$('.sprev2').click(function(){
		scrol2.prev();
		setTimeout(function(){
		$(".scroll2 .items > div").eq(scrol2.getIndex()).
		animate({'opacity':1})},400);
	});
	
	$(".cine").click(function() { 
        $('.cined').expose({
			onBeforeLoad: function() { 
				$(".cine").css('background-image','url(images/cineo.png)'); 
			},
			onBeforeClose: function() { 
				$(".cine").css('background-image','url(images/cinec.png)'); 
			}
		}).load(); 
    }); 



});
/* 
	CRIR - Checkbox & Radio Input Replacement 
	Author: Chris Erwin (me[at]chriserwin.com) 
	www.chriserwin.com/scripts/crir/ 
 
	Updated July 27, 2006. 
	Jesse Gavin added the AddEvent function to initialize 
	the script. He also converted the script to JSON format. 
	 
	Updated July 30, 2006. 
	Added the ability to tab to elements and use the spacebar 
	to check the input element. This bit of functionality was 
	based on a tip from Adam Burmister. 
*/ 
 
crir={userAgent:'',isSafari:false,init:function(){this.userAgent=navigator.userAgent.toLowerCase();this.isSafari=((this.userAgent.indexOf('safari')!=-1)&&(this.userAgent.indexOf('mac')!=-1))?true:false;if(!this.isSafari){arrLabels=document.getElementsByTagName('label');searchLabels:for(var i=0;i<arrLabels.length;i++){if(arrLabels[i].getAttributeNode('for')&&arrLabels[i].getAttributeNode('for').value!=''){labelElementFor=arrLabels[i].getAttributeNode('for').value;inputElement=document.getElementById(labelElementFor)}else{continue searchLabels}inputElementClass=inputElement.className;if($(inputElement).is('.crirHiddenJS')){$(inputElement).addClass('crirHidden');inputElementType=inputElement.getAttributeNode('type').value;if(inputElementType=="checkbox"){inputElement.onclick=crir.toggleCheckboxLabel}else{inputElement.onclick=crir.toggleRadioLabel}if(inputElement.checked){if(inputElementType=='checkbox'){arrLabels[i].className='checkbox checked'}else{arrLabels[i].className='radio checked'}}else{if(inputElementType=='checkbox'){arrLabels[i].className='checkbox unchecked'}else{arrLabels[i].className='radio unchecked'}}}else if(inputElement.nodeName!='SELECT'&&inputElement.getAttributeNode('type').value=='radio'){arrLabels[i].onclick=crir.toggleRadioLabel;inputElement.onclick=crir.toggleRadioLabel}}}},findLabel:function(inputElementID){arrLabels=document.getElementsByTagName('label');searchLoop:for(var i=0;i<arrLabels.length;i++){if(arrLabels[i].getAttributeNode('for')&&arrLabels[i].getAttributeNode('for').value==inputElementID){return arrLabels[i];break searchLoop}}},toggleCheckboxLabel:function(){labelElement=crir.findLabel(this.getAttributeNode('id').value);if(labelElement.className=='checkbox checked'){labelElement.className="checkbox unchecked"}else{labelElement.className="checkbox checked"}},toggleRadioLabel:function(){clickedLabelElement=crir.findLabel(this.getAttributeNode('id').value);clickedInputElement=this;clickedInputElementName=clickedInputElement.getAttributeNode('name').value;arrInputs=document.getElementsByTagName('input');for(var i=0;i<arrInputs.length;i++){inputElementType=arrInputs[i].getAttributeNode('type').value;if(inputElementType=='radio'){inputElementName=arrInputs[i].getAttributeNode('name').value;inputElementClass=arrInputs[i].className;if(inputElementName==clickedInputElementName&&$(arrInputs[i]).is('.crirHidden')){inputElementID=arrInputs[i].getAttributeNode('id').value;labelElement=crir.findLabel(inputElementID);labelElement.className='radio unchecked'}}}if($(clickedInputElement).is('.crirHidden')){clickedLabelElement.className='radio checked'}},addEvent:function(element,eventType,doFunction,useCapture){if(element.addEventListener){element.addEventListener(eventType,doFunction,useCapture);return true}else if(element.attachEvent){var r=element.attachEvent('on'+eventType,doFunction);return r}else{element['on'+eventType]=doFunction}}};crir.addEvent(window,'load',crir.init,false);


// Password strength meter
// This jQuery plugin is written by firas kassem [2007.04.05]
// Firas Kassem  phiras.wordpress.com || phiras at gmail {dot} com
// for more information : http://phiras.wordpress.com/2007/04/08/password-strength-meter-a-jquery-plugin/

var shortPass='0';var badPass='1';var goodPass='2';var strongPass='3';function passwordStrength(password,username){score=0; 
if(password.length<4){return shortPass}score+=password.length*4;score+=(checkRepetition(1,password).length-password.length)*1;
score+=(checkRepetition(2,password).length-password.length)*1;score+=(checkRepetition(3,password).length-password.length)*1;
score+=(checkRepetition(4,password).length-password.length)*1;if(password.match(/(.*[0-9].*[0-9].*[0-9])/))score+=5;
if(password.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/))score+=5;if(password.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/))score+=10;
if(password.match(/([a-zA-Z])/)&&password.match(/([0-9])/))score+=15;if(password.match(/([!,@,#,$,%,^,&,*,?,_,~])/)&&password.match(/([0-9])/))score+=15;
if(password.match(/([!,@,#,$,%,^,&,*,?,_,~])/)&&password.match(/([a-zA-Z])/))score+=15;if(password.match(/^\w+$/)||password.match(/^\d+$/))score-=10;
if(score<0)score=0;if(score>100)score=100;if(score<34)return badPass;if(score<68)return goodPass;return strongPass}
function checkRepetition(pLen,str){res="";for(i=0;i<str.length;i++){repeated=true; 
for(j=0;j<pLen&&(j+i+pLen)<str.length;j++)repeated=repeated&&(str.charAt(j+i)==str.charAt(j+i+pLen));
if(j<pLen)repeated=false;if(repeated){i+=pLen-1; repeated=false}else{res+=str.charAt(i)}}return res;}

/*
 ### jQuery Star Rating Plugin v3.13 - 2009-03-26 ###
 * Home: http://www.fyneworks.com/jquery/star-rating/
 * Code: http://code.google.com/p/jquery-star-rating-plugin/
 *
	* Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 ###
*/
function ara ()
{
	
	var d = $("#aran").val();

	location.href="ara/"+d+"/orderby-relevance/page-1";

	return false;
	
}

eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';5(29.1j)(7($){5($.1L.1J)1I{1t.1H("1K",J,H)}1M(e){};$.n.3=7(i){5(4.Q==0)k 4;5(A I[0]==\'1h\'){5(4.Q>1){8 j=I;k 4.W(7(){$.n.3.y($(4),j)})};$.n.3[I[0]].y(4,$.1T(I).1U(1)||[]);k 4};8 i=$.12({},$.n.3.1s,i||{});$.n.3.K++;4.2a(\'.9-3-1f\').o(\'9-3-1f\').W(7(){8 a,l=$(4);8 b=(4.23||\'21-3\').1v(/\\[|\\]/g,\'Z\').1v(/^\\Z+|\\Z+$/g,\'\');8 c=$(4.1X||1t.1W);8 d=c.6(\'3\');5(!d||d.18!=$.n.3.K)d={z:0,18:$.n.3.K};8 e=d[b];5(e)a=e.6(\'3\');5(e&&a)a.z++;x{a=$.12({},i||{},($.1b?l.1b():($.1S?l.6():s))||{},{z:0,F:[],v:[]});a.w=d.z++;e=$(\'<1R V="9-3-1Q"/>\');l.1P(e);e.o(\'3-15-T-17\');5(l.S(\'R\'))a.m=H;e.1c(a.E=$(\'<P V="3-E"><a 14="\'+a.E+\'">\'+a.1d+\'</a></P>\').1g(7(){$(4).3(\'O\');$(4).o(\'9-3-N\')}).1i(7(){$(4).3(\'u\');$(4).G(\'9-3-N\')}).1l(7(){$(4).3(\'r\')}).6(\'3\',a))};8 f=$(\'<P V="9-3 q-\'+a.w+\'"><a 14="\'+(4.14||4.1p)+\'">\'+4.1p+\'</a></P>\');e.1c(f);5(4.11)f.S(\'11\',4.11);5(4.1r)f.o(4.1r);5(a.1F)a.t=2;5(A a.t==\'1u\'&&a.t>0){8 g=($.n.10?f.10():0)||a.1w;8 h=(a.z%a.t),Y=1y.1z(g/a.t);f.10(Y).1A(\'a\').1B({\'1C-1D\':\'-\'+(h*Y)+\'1E\'})};5(a.m)f.o(\'9-3-1o\');x f.o(\'9-3-1G\').1g(7(){$(4).3(\'1n\');$(4).3(\'D\')}).1i(7(){$(4).3(\'u\');$(4).3(\'C\')}).1l(7(){$(4).3(\'r\')});5(4.L)a.p=f;l.1q();l.1N(7(){$(4).3(\'r\')});f.6(\'3.l\',l.6(\'3.9\',f));a.F[a.F.Q]=f[0];a.v[a.v.Q]=l[0];a.q=d[b]=e;a.1O=c;l.6(\'3\',a);e.6(\'3\',a);f.6(\'3\',a);c.6(\'3\',d)});$(\'.3-15-T-17\').3(\'u\').G(\'3-15-T-17\');k 4};$.12($.n.3,{K:0,D:7(){8 a=4.6(\'3\');5(!a)k 4;5(!a.D)k 4;8 b=$(4).6(\'3.l\')||$(4.U==\'13\'?4:s);5(a.D)a.D.y(b[0],[b.M(),$(\'a\',b.6(\'3.9\'))[0]])},C:7(){8 a=4.6(\'3\');5(!a)k 4;5(!a.C)k 4;8 b=$(4).6(\'3.l\')||$(4.U==\'13\'?4:s);5(a.C)a.C.y(b[0],[b.M(),$(\'a\',b.6(\'3.9\'))[0]])},1n:7(){8 a=4.6(\'3\');5(!a)k 4;5(a.m)k;4.3(\'O\');4.1a().19().X(\'.q-\'+a.w).o(\'9-3-N\')},O:7(){8 a=4.6(\'3\');5(!a)k 4;5(a.m)k;a.q.1V().X(\'.q-\'+a.w).G(\'9-3-1k\').G(\'9-3-N\')},u:7(){8 a=4.6(\'3\');5(!a)k 4;4.3(\'O\');5(a.p){a.p.6(\'3.l\').S(\'L\',\'L\');a.p.1a().19().X(\'.q-\'+a.w).o(\'9-3-1k\')}x $(a.v).1m(\'L\');a.E[a.m||a.1Y?\'1q\':\'1Z\']();4.20()[a.m?\'o\':\'G\'](\'9-3-1o\')},r:7(a,b){8 c=4.6(\'3\');5(!c)k 4;5(c.m)k;c.p=s;5(A a!=\'B\'){5(A a==\'1u\')k $(c.F[a]).3(\'r\',B,b);5(A a==\'1h\')$.W(c.F,7(){5($(4).6(\'3.l\').M()==a)$(4).3(\'r\',B,b)})}x c.p=4[0].U==\'13\'?4.6(\'3.9\'):(4.22(\'.q-\'+c.w)?4:s);4.6(\'3\',c);4.3(\'u\');8 d=$(c.p?c.p.6(\'3.l\'):s);5((b||b==B)&&c.1e)c.1e.y(d[0],[d.M(),$(\'a\',c.p)[0]])},m:7(a,b){8 c=4.6(\'3\');5(!c)k 4;c.m=a||a==B?H:J;5(b)$(c.v).S("R","R");x $(c.v).1m("R");4.6(\'3\',c);4.3(\'u\')},1x:7(){4.3(\'m\',H,H)},24:7(){4.3(\'m\',J,J)}});$.n.3.1s={E:\'25 26\',1d:\'\',t:0,1w:16};$(7(){$(\'l[27=28].9\').3()})})(1j);',62,135,'|||rating|this|if|data|function|var|star|||||||||||return|input|readOnly|fn|addClass|current|rater|select|null|split|draw|inputs|serial|else|apply|count|typeof|undefined|blur|focus|cancel|stars|removeClass|true|arguments|false|calls|checked|val|hover|drain|div|length|disabled|attr|be|tagName|class|each|filter|spw|_|width|id|extend|INPUT|title|to||drawn|call|andSelf|prevAll|metadata|append|cancelValue|callback|applied|mouseover|string|mouseout|jQuery|on|click|removeAttr|fill|readonly|value|hide|className|options|document|number|replace|starWidth|disable|Math|floor|find|css|margin|left|px|half|live|execCommand|try|msie|BackgroundImageCache|browser|catch|change|context|before|control|span|meta|makeArray|slice|children|body|form|required|show|siblings|unnamed|is|name|enable|Cancel|Rating|type|radio|window|not'.split('|'),0,{}))

