function commentwindow(href,target)
{window.open(href,target,'width=470, height=480, top=0, toolbar=0, location=0, directories=0, status=0, menuBar=0, scrollBars=0, resizable=0');return false;}

$("document").ready(function() {
	

	//$(document).pngFix();


	var ie6mode = null;

	jQuery.each(jQuery.browser, function(i, val) {
   		if(i=="msie" && jQuery.browser.version<7.0){
			ie6mode = true;
		};
 	});
	 
	
	

	//-----------------topBarFinance------------------//
	function topBarFinance(){
		
		this.topPos = -15;
		this.bottomPos = 26;
		this.center = 5;
		this.duration = 200;
		
		this.items = $('#siteTop .siteTopTools .finance .content .item');
		this.itemLength = this.items.length;
		
		this.oldItem = 100;
		this.currentItem = 0;
		
		this.getItem = function(ID){
			if(this.currentItem > this.oldItem){
				this.animateItem(this.bottomPos,this.topPos,ID);
			} else {
				this.animateItem(this.topPos,this.bottomPos,ID);
			}
			this.oldItem = ID;
		}
		this.animateItem = function(b,e,ID){
			$(this.items.get(ID)).css("top",b + "px");
			$(this.items.get(ID)).animate({ top: this.center+"px" }, this.duration);
			
			if(this.oldItem != null){
				$(this.items.get(this.oldItem)).animate({ top: e+"px" }, this.duration);
			}
		}
		
		
		$('#siteTop .siteTopTools .finance .buttons .up').click(function(){
			tbFinance.up();
			clearInterval(tbFinance.slider);
		});
		$('#siteTop .siteTopTools .finance .buttons .down').click(function(){
			tbFinance.down();
			clearInterval(tbFinance.slider);
		});
		
		this.up = function(){
			if(tbFinance.currentItem == tbFinance.itemLength-1){
				tbFinance.currentItem = 0;
			} else {
				tbFinance.currentItem++;
			}
			tbFinance.getItem(tbFinance.currentItem);
		}
		this.down = function(){
			if(tbFinance.currentItem == 0){
				tbFinance.currentItem = tbFinance.itemLength-1;
			} else {
				tbFinance.currentItem--;
			}
			tbFinance.getItem(tbFinance.currentItem);	
		}
		
		
		this.slider = setInterval(this.up,2500);
	}
	////////////////////
	var tbFinance = new topBarFinance();
	tbFinance.getItem(tbFinance.currentItem);
	//end of topBarFinance----------------------------------------------
	
	
	
	
	
	
	
	
	
	
	
	
	
	//-----------------topBarSearch------------------//
	function topBarSearch(){
		this.defaultValue = "Arama metnini yazın";
		
		this.obj = $('#topBarSearchInput');
		this.obj.val(this.defaultValue);
		
		$(this.obj).focus(function() {
			if(this.value == tbSearch.defaultValue){
				tbSearch.obj.val("");
				tbSearch.obj.removeClass('defaultInput');
			}
		});
		$(this.obj).blur(function() {
			if(this.value == ""){
				tbSearch.obj.val(tbSearch.defaultValue);
				tbSearch.obj.addClass('defaultInput');
			}
			clearSuggestions();
		});
		
		$(this.obj).keyup(suggestions);
		
	}
	////////////////////
	var tbSearch = new topBarSearch();
	//end of topBarSearch----------------------------------------------
	
	
	
	
	
	
	
	
	
	
	
	
	//-----------------allCategoriesMenu---------------------//
	function allCategoriesMenu(){
		this.obj = $('.acDropDown');
		this.menu = $('.allCategories');
		this.opened = false;
		
		$('.allCategories').click(function() {
			acMenu.toggle();
		});
		
		$(this.obj).mouseup(function() {
			return false;
		});
		$(this.menu).mouseup(function() {
			return false;
		});
		$(document).mouseup(function(e) {
			if(acMenu.opened){
				acMenu.toggle();
			}
		});	
	
		
		this.toggle = function(){
			if(acMenu.opened){
				$(acMenu.menu).removeClass('clicked')
				$(acMenu.obj).slideUp('fast');
				acMenu.opened = false;
				
			} else {
				$(acMenu.menu).addClass('clicked')
				$(acMenu.obj).slideDown('fast');
				acMenu.opened = true;
			}
		}
	}
	////////////////////////////
	var acMenu = new allCategoriesMenu();
	//allCategoriesMenu close
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	function searchResults(){
		$('.searchResults .result').mouseover(function(){
			$(this).addClass('hovered');
		});
		$('.searchResults .result').mouseout(function(){
			$(this).removeClass('hovered');
		});
	}
	
	var sr = new searchResults();
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	

	
	
	
	
	
	
	
		
	$('#multimedia .item').mouseover(function(){
		$(this).addClass('hover');
	});
	$('#multimedia .item').mouseout(function(){
		$(this).removeClass('hover');
	});
	
	
	
	
	
	
	
	
	var platform = navigator.platform;
	var touchScreen = false;
	if(platform == 'iPad' || platform == 'iPhone')
	{
		touchScreen = true;
	}
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	//-----------------headline---------------------//
	function headline(){
		this.old = null;
		this.length = $('#headline .navigation .left li').length;
		this.wfu = new waitForUser(this);
		
		$('#headline .navigation .left li a').each(function (index, value) {
				if(touchScreen){
					$(value).click(function () {
						hdln.toggle(index);
						hdln.wfu.init();
					})
					$('#headline .navigation .left li:eq('+index+') a').removeAttr('href');
				} else {
					$(value).mouseover(function () {
						hdln.toggle(index);
						hdln.wfu.init();
					})
				}
		});
		
		
		this.toggle = function(ID){
			if(hdln.old != null){
				$('#headline .headlines .headlineItem:eq('+hdln.old+')').css('display','none');
				$('#headline .navigation .left li:eq('+hdln.old+') a').removeClass('selected');
			}
			
			$('#headline .headlines .headlineItem:eq('+ID+')').css('display','inline');
			$('#headline .navigation .left li:eq('+ID+') a').addClass('selected');
			
			
			var effect = $('#headline .headlines .headlineItem:eq('+ID+')').attr("effect");
			var url = $('#headline .headlines .headlineItem:eq('+ID+') .url').attr("href");
			
			hdln.effect(effect,url);
			
			hdln.old = ID;
		}
		
		
		this.effect = function(effectID,url){
			if(effectID == 'no'){
				$('#headline .flash').html("");
			} else {
				$('#headline .flash').html("<a></a><div id='effect'></div>");
				$('#headline .flash a').attr('target','_blank');
				$('#headline .flash a').attr('href',url);
				swfobject.embedSWF("Assets/Images/headlineEffects/"+effectID+".swf", "effect", "470px", "315px", "9.0.0", "expressInstall.swf",false,{wmode:"transparent"});
			}
		}
		
		
		this.swapNext = function(){
			if(hdln.old == hdln.length-1){
				hdln.toggle(0);
			} else {
				hdln.toggle(hdln.old+1);
			}
		}
		
	}
	////////////////////////////
	var hdln = new headline();
	hdln.toggle(0);
	//headline close
	
	
	
	
	//-----------------miniHeadline---------------------//
	function miniHeadline(){
		this.old = null;
		this.length = $('#miniHeadline .headlineItem').length;
		this.wfu = new waitForUser(this);
		
		this.toggle = function(ID){
			if(mhdln.old != null){
				$('#miniHeadline .headlineItem:eq('+mhdln.old+')').css('display','none');
			}
			
			$('#miniHeadline .headlineItem:eq('+ID+')').css('display','inline');
			
			$('#miniHeadline .navigation .label').text((ID+1)+' / '+mhdln.length);
			
			mhdln.old = ID;
		}
		
		this.swap = function(dir){
			if(dir == "next")
			{
				if(mhdln.old == mhdln.length-1){
					mhdln.toggle(0);
				} else {
					mhdln.toggle(mhdln.old+1);
				}
			}
			if(dir == "back")
			{
				if(mhdln.old == 0){
					mhdln.toggle(mhdln.length-1);
				} else {
					mhdln.toggle(mhdln.old-1);
				}
			}
		}
		
		$('#miniHeadline .navigation .left').click(function(){
			mhdln.swap('back');	
			mhdln.wfu.init();
		});
		$('#miniHeadline .navigation .right').click(function(){
			mhdln.swap('next');
			mhdln.wfu.init();
		});
		
	}
	////////////////////////////
	var mhdln = new miniHeadline();
	mhdln.toggle(0);
	//site timer close
	
	
	
	
	
	
	
	
	
	
	
	//-----------------weather---------------------//
	function weather(){
		this.old = null;
		this.length = $('.siteTopTools .weather .item').length;
		
		this.toggle = function(ID){
			if(wthr.old != null){
				$('.siteTopTools .weather .item:eq('+wthr.old+')').fadeOut();
			}
			
			$('.siteTopTools .weather .item:eq('+ID+')').fadeIn();
			
			wthr.old = ID;
		}
		
		this.swapNext = function(){
			if(wthr.old == wthr.length-1){
				wthr.toggle(0);
			} else {
				wthr.toggle(wthr.old+1);
			}
		}
	}
	////////////////////////////
	var wthr = new weather();
	wthr.toggle(0);
	//weather close
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	//-----------------newsRotator---------------------//
	function newsRotator(){
		this.old = null;
		this.length = $('#newsRotator .content ul li').length
		this.wfu = new waitForUser(this);
		
		this.toggle = function(ID){
			if(nrttr.old != null){
				$('#newsRotator .content ul li:eq('+nrttr.old+')').removeClass('selected');
			}
			$('#newsRotator .content ul li:eq('+ID+')').addClass('selected');
			
			nrttr.old = ID;
		}
		
		this.swap = function(dir){
			if(dir == 'next'){
				if(nrttr.old == nrttr.length-1){
					nrttr.checkPos(0);
					nrttr.toggle(0);
				} else {
					nrttr.checkPos(nrttr.old+1);
					nrttr.toggle(nrttr.old+1);
				}
			} 
			if(dir == 'back'){
				if(nrttr.old == 0){
					nrttr.checkPos(nrttr.length-1);
					nrttr.toggle(nrttr.length-1);
				} else {
					nrttr.checkPos(nrttr.old-1);
					nrttr.toggle(nrttr.old-1);
				}
			}
		}
		
		this.checkPos = function(ID){
			this.imgw = 138;
			this.pos = (ID*-this.imgw)+this.imgw;
			if(this.pos>0){
				this.pos = 0;
			}
			if(this.pos<(nrttr.length-3)*-this.imgw){
				this.pos = (nrttr.length-3)*-this.imgw;
			}
			$('#newsRotator ul').animate({ left: nrttr.pos+'px' }, 250);
		}
		
		
		
		
		$('#newsRotator .left').click(function(){
			nrttr.swap('back');
			nrttr.wfu.init();
		});
		$('#newsRotator .right').click(function(){
			nrttr.swap('next');
			nrttr.wfu.init();
		});
		$('#newsRotator ul li').hover(function(){
			nrttr.toggle($('#newsRotator ul li').index(this));
			nrttr.wfu.init();
		});
	}
	////////////////////////////
	var nrttr = new newsRotator();
	nrttr.toggle(0);
	//newsRotator close
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	//-----------------categoryHeadline---------------------//
	function categoryHeadline(){
		this.old = null;
		this.length = $('#categoryHeadline .items a').length;
		this.wfu = new waitForUser(this);
		
		$('#categoryHeadline .navigation ul li a').each(function (index, value) {
			if(touchScreen){
				$(value).click(function () {
					cheadline.toggle(index);
					cheadline.wfu.init();
				})
				$('#categoryHeadline .navigation ul li:eq('+index+') a').removeAttr('href');
			} else {
				$(value).hover(function () {
					cheadline.toggle(index);
					cheadline.wfu.init();
				})
			}
		});
		
		
		this.toggle = function(ID){
			if(cheadline.old != null){
				$('#categoryHeadline .navigation ul li:eq('+cheadline.old+')').removeClass('selected');
				$('#categoryHeadline .items a:eq('+cheadline.old+')').css('display','none');
				
			}
			$('#categoryHeadline .navigation ul li:eq('+ID+')').addClass('selected');
			$('#categoryHeadline .items a:eq('+ID+')').css('display','inline');
			cheadline.old = ID;
		}
		
		this.swapNext = function(){
			if(cheadline.old == cheadline.length-1)
			{
				cheadline.toggle(0);
			} else{
				cheadline.toggle(cheadline.old+1);
			}
		}
	}
	////////////////////////////
	var cheadline = new categoryHeadline();
	cheadline.toggle(0);
	//categoryHeadline close
	
	
	
	
	
	
	
	
	
	
	
	
	
	//-----------------mostVisited---------------------//
	function mostVisited(){
		this.old = null;
		
		this.toggle = function(ID){
			if(mstvstd.old != null){
				$('#mostVisited .navigation ul li:eq('+mstvstd.old+')').removeClass('selected');
				$('#mostVisited .content:eq('+mstvstd.old+')').css('display','none');
				
			}
			$('#mostVisited .navigation ul li:eq('+ID+')').addClass('selected');
			$('#mostVisited .content:eq('+ID+')').css('display','inline');
			mstvstd.old = ID;
		}
		
		$('#mostVisited .navigation ul li').each(function (index, value) {
			$(value).click(function () {
				mstvstd.toggle(index);
			})
		});
		
	}
	
	////////////////////////////
	var mstvstd = new mostVisited();
	mstvstd.toggle(0);
	//MostVisited close
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	//-----------------newsTabs---------------------//
	function newsTabs(){
		
		this.old = null;
		this.length = null;
		this.oldNav = 0;
		this.wfu = new waitForUser(this);
		
		$('#newsTabs .content .index').css('display','none');
		
		$('#newsTabs .navigation ul li').click(function(){
			nwstbs.toggleNav($(this).index());
		});
		
		$('#newsTabs .content .item').mouseover(function(){
				nwstbs.toggle($(this).index());
				nwstbs.wfu.init();
		});
		
		this.init = function(){
			nwstbs.old = null;
			nwstbs.length = $('#newsTabs .content .index:eq('+this.oldNav+') .item').length;
			$('#newsTabs .content .item').removeClass('selected');
			nwstbs.toggle(0);
		}
		
		this.toggle = function(ID){
			if(nwstbs.old != null){
				$('#newsTabs .content .index:eq('+this.oldNav+') .item:eq('+nwstbs.old+')').removeClass('selected');
			}
			$('#newsTabs .content .index:eq('+this.oldNav+') .item:eq('+ID+')').addClass('selected');
			nwstbs.old = ID;
		}
		
		this.toggleNav = function(ID){
			if(nwstbs.oldNav != null){
				$('#newsTabs .navigation ul li:eq('+nwstbs.oldNav+')').removeClass('selected');
				$('#newsTabs .content .index:eq('+nwstbs.oldNav+')').css('display','none');
			}
			$('#newsTabs .navigation ul li:eq('+ID+')').addClass('selected');
			$('#newsTabs .content .index:eq('+ID+')').css('display','inline');
			
			nwstbs.oldNav = ID;
			nwstbs.init();
		}
		
		this.swapNext = function(){
			if(nwstbs.old == nwstbs.length-1){
				nwstbs.toggle(0);
			} else {
				nwstbs.toggle(nwstbs.old+1);
			}
		}
		
	}
	////////////////////////////
	var nwstbs = new newsTabs();
	nwstbs.init();//bu fonksiyon ajax yüklendikten sonra çağırılacak.
	nwstbs.toggleNav(0);
	//newsTabs close
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	//-----------------waitForUser---------------------//
	function waitForUser(obj){
		this.played = true;
		this.resume = null;
		
		this.init = function(){
			this.played = false;
			clearInterval(this.resume);
			this.resume = setInterval(this.playAgain,9000);
		}
		
		this.playAgain = function(){
			obj.wfu.played = true;
			clearInterval(obj.wfu.resume);
		}
		
	}
	////////////////////////////
	//waitForUser close
	
	
	
	
	
	
	
	
	
	
	
	
	//-----------------site  timer---------------------//
	function siteTimer(){
		this.swap = function(){
			if(hdln.wfu.played){
				hdln.swapNext();
			}
			if(mhdln.wfu.played){
				mhdln.swap('next');
			}
			if(nrttr.wfu.played){
				nrttr.swap('next');
			}
			if(cheadline.wfu.played){
				cheadline.swapNext();
			}
			if(nwstbs.wfu.played){
				nwstbs.swapNext();
			}
			wthr.swapNext();
		}
		this.slider = setInterval(this.swap,4000);
	}
	////////////////////////////
	var timer = new siteTimer();
	//site timer close
	
	
	
	
	
	
	
	
	
	
	
	//$('.tools li a').tipsy({fade: true, gravity: 's'});
	
	
	
	
	

	
	//-----------------addComment---------------------//
	function addComment(){
		var defaultText = "Bu habere yorum yazın...";
		this.inputObj = $('#addComment #commentInput');
		this.postObj = $('#addComment .postMessage');
		
		$(this.inputObj).html(defaultText);
		
		$(this.inputObj).focusin(function(){
			addcmmnt.postObj.slideDown('fast');
			addcmmnt.inputObj.html('');
			clearInterval(autoRefresh);
		});
		
		$('.postMessage .cancel a').click(function(){
			addcmmnt.postObj.slideUp('fast');
			addcmmnt.inputObj.html(defaultText);
		});
	}
	////////////////////////////
	var addcmmnt = new addComment();
	//addComment close
	
	
	
	
	
	
	
	
	
	
	
	
	
	//---------------------------newsContentTools--------------------------
	function newsContentTools(){
		this.defaultSize = 100;
		this.size = this.defaultSize;
		$('.fontSizeUp').click(function(){
			nct.size = nct.size+20;
			if(nct.size > 160)
			{
				nct.size = 160;
			}
			$('.text p,.text h3,.text h4,.text h5,.text h6,').css('font-size',nct.size+'%')
		});
		$('.fontSizeDown').click(function(){
			nct.size = nct.size-20;
			if(nct.size < 60)
			{
				nct.size = 60;
			}
			$('.text p,.text h3,.text h4,.text h5,.text h6,').css('font-size',nct.size+'%')
		});
		$('.fontSizeDefault').click(function(){
			nct.size = 100;
			$('.text p,.text h3,.text h4,.text h5,.text h6,').css('font-size',nct.size+'%')
		});
		$('.print').click(function(){
			window.print();
		});
		
	}
	////////////
	var nct = new newsContentTools();
	//newsContentTools
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	

	
	
	
	
	
	
	
	/*
	//---------------------------bant--------------------------
	function newsLine(){
		this.xpos = 0;
		this.dir = 'left';
		this.speed = 1;
		this.obj = $('.newsLine .news');
		this.setPos = function(){
			nl.xpos = nl.xpos-nl.speed;
			$('.temp').html(nl.xpos);
			$('.newsLine .news').css('left',nl.xpos);
		}
		this.timer = setInterval(this.setPos,15)
	}
	var nl = new newsLine();
	//bant close
	*/
	
	
	
	
	
	
	//---------------------------pageskin pos--------------------------
	function pageSkinPos(){
		this.obj = $('#pageSkin');
		if(ie6mode){
			this.obj.css('position','absolute');
			$(window).scroll(function(){
				var st = $(window).scrollTop();
				$(psp.obj).css('top',st+'px');
			});
		}
		
		$(window).resize(function(){
			psp.resizeHandler();
		});
		
		this.resizeHandler = function()
		{
			var sw = $(window).width();
			var sh = $(window).height();
			var objPos = psp.obj.position();
			var psw = sw-objPos.left;
			psp.obj.css('width',psw+'px');
			psp.obj.css('height',sh+'px');
		}
		
	}
	////////////
	var psp = new pageSkinPos();
	psp.resizeHandler();
	//pageskin pos
	
	
	
	
	

	rf.run();
	$('#topBarSearchInput').attr('autocomplete', 'off');
	
	
	
	
	
	commentsItemInit();
	
});//document ready function cloese-------------------------






function anchorRF(){
	this.run = function(){
		$('a[href="#"]').click(function(){
			return false;
		});
	}
}
var rf = new anchorRF();


function uyelik_pencere()
{
	$.get('/uyelik.php', function (icerik) {
		    Shadowbox.open({
	        content:    icerik,
	        player:     "html",
	        height:     450,
	        width:      690
	    });
	})
};

var suggestionIndex = -1;

function suggestions(e)
{
	if(e.keyCode == 38 || e.keyCode == 40) {
		var max = $('.suggestions a').size() - 1;
		
		if(e.keyCode == 38)
			suggestionIndex--;
		else
			suggestionIndex++; 
		
		if(suggestionIndex < 0)
			suggestionIndex = max;
	 	else if(suggestionIndex > max)
	 		suggestionIndex = 0;
 		
		$('.suggestions a').removeClass('hover');
 		$('.suggestions a:eq('+suggestionIndex+')').addClass('hover');
 		$('#topBarSearchInput').val($('.suggestions a:eq('+suggestionIndex+')').html());
 		return;
	}
	suggestionIndex = -1;
	$('.suggestions a').unbind();
	var term = $('#topBarSearchInput').val();
	var html = '<div class="suggestions">'
	$.ajax({ 
	      url: 'http://suggestqueries.google.com/complete/search?hl=tr&q=' + term, 
	      dataType: 'jsonp', 
	      success: function(data) { 
	            for(x in data[1]) {
	            	term = (data[1][x][0])
	            	html = html + '<a href="javascript:;" onclick="suggest(\''+ term +'\')">' + term +'</a>'
	            }
	            html = html + '</div>'
	            $('.suggestionsResults').html(data[1].length != 0 ? html : '');
	            $('.suggestions a').hover(function (){
	            	$('.suggestions a').removeClass('hover');
	            	$(this).addClass('hover');
	            }, function () {
	            	$(this).removeClass('hover');
	            });
	      }
	});
}

function clearSuggestions()
{
	var CSI = setInterval(function () { $('.suggestionsResults').html(''); clearInterval(CSI) }, 200)
}

function suggest(suggest)
{
	$('#topBarSearchInput').val(suggest);
	$('.suggestionsResults').html('');
	$('.search form').submit();
}




































function yorumlari_goster(haberID)
{
	$.post('/esh/sayfalar//yorumlar.php', {id: haberID}, function (sonuc) {
		$('#yorumlar').html(sonuc);
		
		commentsItemInit();
		});
}

function yorum_gonder (hid) {
	if(!confirm('Önemli hatırlatma!\nSayın okurumuz, \nEnsonhaber.Com özgürlüklere, kişilerin kendilerini ifade etmelerine büyük önem vermektedir. \nAmacımız her zaman ve her şartta konuşabilen bir Türkiye\'dir.\n Yorumlarda dikkatli davranmanız, \nyasalara uygun bir üslup kullanmanız, gerekmektedir.\nKişilik haklarına saldırı sayılabilecek yorumlarınızı bir kez daha dikkatlice gözden geçirmenizi tavsiye ederiz.\nEnsonhaber yorum sahipleriyle alakalı, resmi kurumlar tarafından istenmesi halinde ip adreslerini\n vermekle yükümlüdür.\n\nÖnemle hatırlatırız!..\n\nSaygılarımızla...'))
	{
		return false;
	}
	var yorum = $('.'+hid).val();
	var isim = $('.i'+hid).val();
	
	if(yorum != '' && isim != ''){
		$('#'+hid+' .addComment').html('<div class="gonderildi">Yorumumuz gönderildi. Onaylandıktan sonra yayınlanacaktır.</div>');
		$.post('/esh/sayfalar/yorum_gonder.php', {hid: hid, isim: isim, yorum: yorum}, function (cevap) {

		});
	}
};

function cevap_gonder (cvp) {
		if(!confirm('Önemli hatırlatma!\nSayın okurumuz, \nEnsonhaber.Com özgürlüklere, kişilerin kendilerini ifade etmelerine büyük önem vermektedir. \nAmacımız her zaman ve her şartta konuşabilen bir Türkiye\'dir.\n Yorumlarda dikkatli davranmanız, \nyasalara uygun bir üslup kullanmanız, gerekmektedir.\nKişilik haklarına saldırı sayılabilecek yorumlarınızı bir kez daha dikkatlice gözden geçirmenizi tavsiye ederiz.\nEnsonhaber yorum sahipleriyle alakalı, resmi kurumlar tarafından istenmesi halinde ip adreslerini\n vermekle yükümlüdür.\n\nÖnemle hatırlatırız!..\n\nSaygılarımızla...'))
	{
		return false;
	}
	var hid = $(cvp).parent().parent().parent().attr('id');
	var cevap = $('#replyComment #commentInput').val();
	var isim = $('#replyComment .name input').val();
	
	if(cevap != '' && isim != ''){
		$('#replyComment').slideUp();
		alert('Cevabınız gönderildi. Onaylandıktan sonra yayınlanacaktır.');
		$.post('/esh/sayfalar/yorum_gonder.php', {hid: hid, isim:isim, yorum: cevap, cevap: 1}, function (cevap) {
			if(cevap == 'tamam') {
				$('#replyComment .name input').val('');
				$('#replyComment #commentInput').val('');
			}
		});
	}
}

function begen(id, begen, cevap)
{
	$('#' + id + ' .rateDown, #' + id + ' .rateUp').hide();
	if(cevap)
		$.post('/esh/sayfalar/yorumlar.php', {id: id, cevap: 1, begen: begen});
	else
		$.post('/esh/sayfalar/yorumlar.php', {id: id, begen: begen});
}


function commentsItemInit(){
	$('.ratingTool a').tipsy({fade: true, gravity: 's'});
	$('.ratingTool .status').tipsy({fade: true, gravity: 's'});
	$('.tools a').tipsy({fade: true, gravity: 's'});
	
	$('.comment').mouseover(function(){
		$(this).addClass('hover');
	});
	$('.comment').mouseout(function(){
		$(this).removeClass('hover');
	});
	
	$('.tools .reply').click(function(){
		$(this).parent().parent().append($('#replyComment'));
		$('#replyComment').slideDown('fast');
		$('#replyComment .postMessage .cancel a').click(function(){
			$('#replyComment').slideUp('fast');
		});
		clearInterval(autoRefresh);
		rf.run();
				
	});
}

function popup(url, title)
{
	window.open( url, title, "status = 1, toolbar = 0, height = 450, width = 500, resizable = no, scrollbars = 1" )
}
