// JavaScript Document
$(document).ready(function(){
//#arka plan resmi için kod
// if(($.browser.msie&&$.browser.version>='7.0')||$.browser.msie==false){
//	 $("#backGroundPicImg").css("visibility","visible");
//	 $("#backGroundPic").css("display","block");
//	 $("body").css("background","");
//<div id="backGroundPic"><img id="backGroundPicImg" src="images/sea-view.jpg" alt="deniz" style="width:100%;height:100%;" /></div>
// }
 //alinkler için düzenleme
 $("a.postlink").each(function(){$(this).attr("target","_blank");});
/* $("div.content").each(function(){
						$("img[alt=Resim]",$(this)).each(function(){
							$(this).load(function(){
							if($(this).width()>500) $(this).attr("width","500").css({"max-width":"500px","cursor":"pointer"});
							$("body").append($(this).width()+" "+$(this).attr("src")+" <br>");
							});
						});		
						
					});
	$("img[alt=Resim]").click(function(){
	 if($(this).width()>500)	
		if($(this).css("width")=="500px")
			$(this).css("width","");
		else
		$(this).css("width","500px");
	});*/
 					
// $("body").append($("div.content > img[alt=Resim]").length());					
					
 //kayıt olma mesaj ekranı için	
// $("body").append($("#notify-container").length);
 if(parseInt($("#notify-container").length)>0){ 
	 $("#notify-container").slideDown("slow");
	 var top=0;
	 if($.browser.msie&&jQuery.browser.version<'8.0'){
		   $(window).scroll(function(){
			 top=parseInt($(window).scrollTop());
			 if(top>0){
				$("#notify-container").css({"margin-bottom":"0px","position":"absolute","top":top+"px"});
			 }else{
				$("#notify-container").css({"margin-bottom":"12px","position":"","top":"0px"});
			 }
			});
			//ie de saçma sapan end tuşu problemi için 60 px lik düzenleme
			var keyUpTop=0;
			$(document).keyup(function(event) {
				var key=event.keyCode;
				//end
				if(key==35)	{			
					if(keyUpTop==0){
						keyUpTop=parseInt($("#notify-container").offset().top);
					}
				 $("#notify-container").css("top",(keyUpTop)+"px");
				}
			});
	  }else{
		   $(window).scroll(function(){
			 top=parseInt($(window).scrollTop());
			  if(top>0&&$("#notify-container").css("position")!="fixed"){
				$("#notify-container").css({"margin-bottom":"0px","position":"fixed"});
			  }else if(top==0 && $("#notify-container").css("position")!="inherit"){
				$("#notify-container").css({"margin-bottom":"12px","position":""});
			  }
		   });
	  }
	 $(".notify-close").click(function(){
			$("#notify-container").slideUp("slow");
	 });
 }
 if($("#navbarUstMenu").length>0){
    //  var panelTop=233; //barın bulunduğu yer body den alta uzaklığı uzarsa değiştirmek gerekir
  	// kullanıcı ekranındaki mesaj bölümü
	//prosilver ara yüzüne göre yapılmıştır
	var ekBolum='<div id="ekLinkler"><ul class="linklist"><LI><A href="./search.php?search_id=unanswered">Cevaplanmamış mesajlar</A> • <A href="./search.php?search_id=unreadposts">Okunmamış mesajları görüntüle</A> • <A href="./search.php?search_id=newposts">Yeni mesajlar</A> • <A href="./search.php?search_id=active_topics">Aktif başlıkları görüntüle</A></LI><LI class=rightside><A accessKey=m href="./index.php?hash=250079ae&amp;mark=forums">Forumları okunmuş say</A></LI></ul></div>';
	var panelTop=0;
	var top=0;
	var kontrolEt=0;
	if($.browser.msie&&jQuery.browser.version<8){
	panelTop=parseInt($("#navbarUstMenu").offset().top);
	   $(window).scroll(function(){
			 top=parseInt($(this).scrollTop());
			 if(top>=panelTop){
				
				$("#navbarUstMenu").css({"position":"absolute",
										 "top":top+"px",
										 "z-index":"100",
										 "width":"95%"
				})
				if(kontrolEt==0) $("#navbarUstMenu").append(ekBolum);
				kontrolEt=1;
			 }
			 if(top<=panelTop){
				kontrolEt=0;
				$("#navbarUstMenu").css({"position":"","top":panelTop+"px","width":""});
				$("#ekLinkler").remove();
			 }
		});
		//ie de saçma sapan end tuşu problemi için 60 px lik düzenleme
		var keyUpTop=0;
		$(document).keyup(function(event) {
			var key=event.keyCode;
			//end tuşu
			if(key==35){ 
				if(keyUpTop==0){
					keyUpTop=parseInt($("#navbarUstMenu").offset().top)-75;
				}
				$("#navbarUstMenu").css("top",keyUpTop+"px");
				if(kontrolEt==0)$("#navbarUstMenu").append(ekBolum);
				kontrolEt=1;
			}
			//home tuşu
			if(key==36){
				kontrolEt=0;
				$("#navbarUstMenu").css({"position":"","top":panelTop+"px","width":""});
				$("#ekLinkler").remove();
			}
			
		});		
	}else{
	panelTop=parseInt($("#navbarUstMenu").offset().top);
	
	   $(window).scroll(function(){
		  top=parseInt($(this).scrollTop());
		  if(top>=panelTop&&$("#navbarUstMenu").css("position")!="fixed"){
			$("#navbarUstMenu").css({"position":"fixed",
									 "top":"0px",
									 "z-index":"100",
									 "width":"95%"
			});
			if(kontrolEt==0)$("#navbarUstMenu").append(ekBolum);
			kontrolEt=1;
		  }else if(top<=panelTop && $("#navbarUstMenu").css("position")!="inherit"){
			  kontrolEt=0;
			$("#navbarUstMenu").css({"position":"",
									 "top":panelTop+"px",
									 "z-index":"",
									 "width":""
								   });
			$("#ekLinkler").remove();
		  }
	   });
	}
 }
});
$("a.top").live("click",function(e){e.preventDefault();$("html,body").animate({scrollTop: 0},'slow');});