var http_request=false;
function makePOSTRequest(url,parameters){
http_request=false;
if(window.XMLHttpRequest){
http_request=new XMLHttpRequest();


if(http_request.overrideMimeType){
	http_request.overrideMimeType("text/html")
	}
	}else{
		if(
		window.ActiveXObject){
			try{
				http_request=new ActiveXObject("Msxml2.XMLHTTP"
				)}catch(e){
					try{
						http_request=new ActiveXObject("Microsoft.XMLHTTP")
						}catch(e){
						}}}}
						if(!http_request){alert("Cannot create XMLHTTP instance");

return false}http_request.onreadystatechange=alertContents;http_request.open("POST",url,true);

http_request.setRequestHeader("Content-type","application/x-www-form-urlencoded");

http_request.setRequestHeader("Content-length",parameters.length);

http_request.setRequestHeader("Connection","close");

http_request.send(parameters)}jQuery(document).ready(function(){lightsoff()});

$(document).ready(function(){tooltip();

//$("#chained").scrollable({circular:true,mousewheel:true}).navigator().autoscroll({interval:5000});

$("#tabs_sameartist").hide();

$("#tabs_other").hide();

$("#tabs_related").slideDown(500);

$("#tabs_benzer_video").click(function(){var vid=$(this).find("a").attr("class");

var divs=$("#tabs_related").children().length;$(".shadetabs").find("li").removeClass("selected");

$(this).addClass("selected");

$("#tabs_sameartist").hide();

$("#tabs_other").hide();

if(vid.length>0&&divs==0){ajax_request("detail","do=show_more_related&vid="+vid,"#tabs_related","html",false)}if($.browser.msie){$("#tabs_related").slideDown(500)}else{$("#tabs_related").slideDown(500)}return false});

$("#tabs_benzer_sarkici").click(function(){var vid=$(this).find("a").attr("class");

var divs=$("#tabs_sameartist").children().length;$(".shadetabs").find("li").removeClass("selected");

$(this).addClass("selected");

$("#tabs_related").hide();

$("#tabs_other").hide();

if(vid.length>0&&divs==0){ajax_request("detail","do=show_more_artist&vid="+vid,"#tabs_sameartist","html",false)}if($.browser.msie){$("#tabs_sameartist").slideDown(500)}else{$("#tabs_sameartist").slideDown(500)}return false});

$("#tabs_benzer_kategori").click(function(){var vid=$(this).find("a").attr("class");

var divs=$("#tabs_other").children().length;$(".shadetabs").find("li").removeClass("selected");

$(this).addClass("selected");

if(vid.length>0&&divs==0){ajax_request("detail","do=show_more_best&vid="+vid,"#tabs_other","html",false)}$("#tabs_related").hide();

$("#tabs_sameartist").hide();

if($.browser.msie){$("#tabs_other").slideDown(500)}else{$("#tabs_other").slideDown(500)}return false});

$("#href_artist_name").click(function(){var vid=$(this).attr("class");

var divs=$("#tabs_sameartist").children().length;$(".shadetabs").find("li").removeClass("selected");

$("#tabs_benzer_sarkici").addClass("selected");

$("#tabs_related").hide();

$("#tabs_other").hide();

if(vid.length>0&&divs==0){ajax_request("detail","do=show_more_artist&vid="+vid,"#tabs_sameartist","html",false)}if($.browser.msie){$("#tabs_sameartist").slideDown(500)}else{$("#tabs_sameartist").slideDown(500)}return false});

$(".like").click(function(){var id=$(this).attr("id");

var name=$(this).attr("name");

var dataString="id="+id+"&name="+name;$("#oylama").fadeOut(100);

$.ajax({type:"POST",url:""+iyimix_base_path+"/rating.php",data:dataString,cache:false,success:function(html){$("#votebox").animate({width:"20%"},500);

$("#content").html(html)}})});

$("#favorilere_ekle").click(function(){$("#video_paylas").fadeOut(500);

$("#video_login").fadeIn(500)});

$("#addtofavorites").click(function(){if(iyimix_user_id!="0"){var dataString="video_id="+iyimix_uniq_id+"&user_id="+iyimix_user_id;$.ajax({type:"POST",url:""+iyimix_base_path+"/ajax_favorite.php",data:dataString,cache:false,success:function(html){$("#favorilere_eklendi").attr("src",""+iyimix_temp_path+"/images/heart.png");

$("#favorilere_eklendi2").html("Eklendi");

$("#addtofavorites").attr("href","/favorilerim.html?a=show")}})}else{$("#video_login").slideDown(100)}});

$("#removetofavorites").click(function(){ajax_request("favorites","do=onpage_delete_favorite&vid="+iyimix_uniq_id,"","",false);

$("#favorilere_eklendi").attr("src",""+iyimix_temp_path+"/images/heart.png");

$("#removetofavorites2").html("Çıkarıldı");

$("#removetofavorites").attr("href","/favorilerim.html?a=show")});

$("#embed_kod").toggle(function(){$("#video_paylas").slideDown(100)},function(){$("#video_paylas").slideUp(100)});

$("#video_yorum_yaz").toggle(function(){$("#video_login").slideDown(100)},function(){$("#video_login").slideUp(100)});

$("#video_problem_bildir").toggle(function(){if(iyimix_user_id!="0"){$("#video_problem").slideDown(100)}else{$("#video_login").slideDown(100)}},function(){if(iyimix_user_id!="0"){$("#video_problem").slideUp(100)}else{$("#video_login").slideUp(100)}});

$("#video_login_close").click(function(){$("#video_login").fadeOut(500)});

$("#video_paylas_close").click(function(){$("#video_paylas").fadeOut(500)});

$("#video_problem_close").click(function(){$("#video_problem").fadeOut(500)});

$("#facebook_paylas").click(function(){share_facebook(document.location)});

$("#video_rapor_submit").click(function(){var user_id=iyimix_user_id;var uniq_id=iyimix_uniq_id;var reason=$("#video_rapor_reason").val();

if(reason=="Lütfen Seçin"){$("#video_rapor_sonuc").attr("class","bildirim hata").html("Lütfen önce problemin sebebini seçin").fadeIn(300);

zamanlayici("#video_rapor_sonuc",3000);

return false}if(user_id!=0){var dataString="uniq_id="+uniq_id+"&user_id="+user_id+"&reason="+reason;$.ajax({type:"POST",url:""+iyimix_base_path+"/report.php",data:dataString,cache:false,success:function(html){if(html=="oturum"){$("#video_rapor_sonuc").attr("class","bildirim hata").html("Oturumunuz sona ermiş. Lütfen yeniden giriş yapın").fadeIn(300)}if(html=="eklenmis"){$("#video_rapor_sonuc").attr("class","bildirim uyari").html("Bu video zaten daha önce rapor edilmiş. İlginiz için teşekkürler").fadeIn(300)}if(html=="eklendi"){$("#video_rapor_sonuc").attr("class","bildirim kabul").html("Problem bildirimi tarafımıza iletildi. İlginiz için teşekkür ederiz.").fadeIn(300)}zamanlayici("#video_rapor_sonuc",10000);

return false}})}return false});

$("#yorum_onizleme").hide();

$("#c_submit").click(function(){$("#mycommentspan").html('<img src="'+iyimix_temp_path+'/images/ajax-loader.gif" alt="Yükleniyor" id="loading" />').show();

var userId=$("#c_user_id").val();

var videoId=$("#c_vid").val();

var commentTxt=$("#c_comment_txt").val();

var uName=$("#c_username").val();

var captchaCode=$("#captcha").val();

if(userId>0){$.post(iyimix_base_path+"/comment.php",{vid:videoId,user_id:userId,comment_txt:commentTxt},function(data){if(data.cond==true){$("#yorum_form").slideUp("normal",function(){$("#mycommentspan").html(data.msg).show();

if(data.preview==true){$("#yorum_yaz").hide();

$("#be_the_first").hide();

$("#yorum_onizleme").html(data.html).fadeIn(700)}})}else{if(data.cond==false){$("#c_submit").show();

$("#yorum_bildirim").html(data.msg).fadeIn(500);

$("#mycommentspan").hide();

var e=$("#yorum_bildirim");

e.queue(function(){setTimeout(function(){e.dequeue()},5000)});

e.fadeOut(100)}}},"json")}return false});

$("#sifremi_unuttum_btn").toggle(function(){$("#video_login_ajax").html('<img src="'+iyimix_temp_path+'/images/ajax-loader.gif" alt="Yükleniyor" id="loading" />').show();

$("#sifremi_unuttum").fadeIn(500);

$("#video_login_ajax").fadeOut(1000)},function(){$("#video_login_ajax").html('<img src="'+iyimix_temp_path+'/images/ajax-loader.gif" alt="Yükleniyor" id="loading" />').show();

$("#sifremi_unuttum").fadeOut(100);

$("#video_login_ajax").fadeOut(1000)});

$("#show_yeni_klipler").toggle(function(){$("#video_yeni_loading").html('<img src="'+iyimix_temp_path+'/images/ajax-loader.gif" alt="Yükleniyor" id="loading" />').show();

$.ajax({type:"GET",url:""+iyimix_base_path+"/ajax.php",data:"p=show_yeni_klipler",cache:false,success:function(data){$("#yeni_klipler").html(data).slideDown(500)}});

$("#video_yeni_loading").fadeOut(1000)},function(){$("#video_yeni_loading").html('<img src="'+iyimix_temp_path+'/images/ajax-loader.gif" alt="Yükleniyor" id="loading" />').show();

$("#yeni_klipler").fadeOut(500);

$("#video_yeni_loading").fadeOut(1000)});

$("#show_top_klipler").toggle(function(){$("#video_top_loading").html('<img src="'+iyimix_temp_path+'/images/ajax-loader.gif" alt="Yükleniyor" id="loading" />').show();

$.ajax({type:"GET",url:""+iyimix_base_path+"/ajax.php",data:"p=show_top_klipler",cache:false,success:function(data){$("#top_klipler").html(data).slideDown(500)}});

$("#video_top_loading").fadeOut(1000)},function(){$("#video_top_loading").html('<img src="'+iyimix_temp_path+'/images/ajax-loader.gif" alt="Yükleniyor" id="loading" />').show();

$("#top_klipler").fadeOut(500);

$("#video_top_loading").fadeOut(1000)})});

function SelectAll(id){document.getElementById(id).focus();

document.getElementById(id).select()}function share_facebook(u){t=document.title;window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");

return false}function zamanlayici(a,z){var e=$(a);

var t=z;e.queue(function(){setTimeout(function(){e.dequeue()},t)});

e.fadeOut(100)}function get(obj){var poststr;if(document.getElementById("user_id").value==0){poststr="comment_txt="+encodeURI(document.getElementById("comment_txt").value)+"&vid="+encodeURI(document.getElementById("vid").value)+"&user_id="+encodeURI(document.getElementById("user_id").value)+"&username="+encodeURI(document.getElementById("username").value)+"&captcha="+encodeURI(document.getElementById("captcha").value)}else{poststr="comment_txt="+encodeURI(document.getElementById("comment_txt").value)+"&user_id="+encodeURI(document.getElementById("user_id").value)+"&vid="+encodeURI(document.getElementById("vid").value)}makePOSTRequest(""+iyimix_base_path+"/comment.php",poststr)}function validateSearch(b_on_submit){if(document.forms.search.keywords.value==""||document.forms.search.keywords.value=="search"){alert("You did not enter a search term. Please try again.");

if(b_on_submit=="true"){return false}}else{document.forms.search.submit()}}function lookup(inputString){if(inputString.length==0){$("#suggestions").hide()}else{if(inputString.length>2){$.post(iyimix_base_path+"/ajax_search.php",{queryString:""+inputString+""},function(data){if(data.length>0){$("#suggestions").show();

$("#autoSuggestionsList").html(data)}})}}}function catlist(){$("#ul_categories li").hoverIntent(function(){var ul_subs=$(this).find("ul");

if(ul_subs.hasClass("hidden_li")){ul_subs.removeClass();

ul_subs.slideDown(80);

ul_subs.addClass("visible_li")}},function(){var ul_subs=$(this).find("ul");

if(ul_subs.hasClass("visible_li")){ul_subs.addClass("hidden_li");

ul_subs.slideUp(150);

ul_subs.removeClass("visible_li")}})}function fill(thisValue){$("#inputString").val(thisValue);

setTimeout("$('#suggestions').hide();",200)}function getfav(obj){var poststr="video_id="+iyimix_uniq_id+"&user_id="+iyimix_user_id;makePOSTRequest(""+iyimix_base_path+"/ajax_favorite.php",poststr)}function getPageSize(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=window.innerWidth+window.scrollMaxX;yScroll=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight}}var windowWidth,windowHeight;if(self.innerHeight){if(document.documentElement.clientWidth){windowWidth=document.documentElement.clientWidth}else{windowWidth=self.innerWidth}windowHeight=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight}else{if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight}}}if(yScroll<windowHeight){pageHeight=windowHeight}else{pageHeight=yScroll}if(xScroll<windowWidth){pageWidth=xScroll}else{pageWidth=windowWidth}arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight);

return arrayPageSize}function lightsoff(){$("#lightsoff").click(function(){$("#Playerholder, #Player, embed, object").css({visibility:"visible"});

$("body").append('<div id="lightsoff-background"></div>');

var page_size=getPageSize();

$("#lightsoff-background").css({backgroundColor:"#000",opacity:0.95,width:page_size[2],height:page_size[1]}).show();

$("#lightsoff-background").click(function(){$("#lightsoff-background").fadeOut(function(){$("#lightsoff-background").remove()});

return false});

return false})}function ajax_request(page,extra_params,output_sel,type,show){var ret=false;if(type.length==0){type="html"}if(output_sel.length>0){if(output_sel=="#yorumlar_ol"){$("#yorum-loader").html('<img src="'+iyimix_temp_path+'/images/ajax-loading.gif" alt="Yükleniyor" id="loading" />').fadeIn("fast")}else{if(output_sel=="#embed_Playerholder"){$("#video_yukleniyor").html('<img src="'+iyimix_temp_path+'/images/ajax-loading.gif" alt="Yükleniyor" id="loading" />').fadeIn("fast")}else{$(output_sel).html('<img src="'+iyimix_temp_path+'/images/ajax-loading.gif" alt="Yükleniyor" id="loading" />').fadeIn("fast")}}}$.ajax({type:"GET",url:iyimix_base_path+"/ajax.php",data:"p="+page+"&"+extra_params,dataType:type,success:function(data){if(output_sel.length>0){$(output_sel).html(data);

if(show==true){$(output_sel).show();

if(output_sel=="#yorumlar_ol"){$("#yorum-loader").html("")}if(output_sel=="#embed_Playerholder"){$("#video_yukleniyor").fadeOut(1000)}}}ret=true}});

return ret}function onpage_delete_comment(comment_id,video_id,selector){var confirm_msg="Mesaj Silinecek Emin misiniz? Eminseniz Tamam, değilseniz iptal deyin.";var response=false;if(confirm(confirm_msg)){if(selector.length>0){ajax_request("comments","do=onpage_delete_comment&cid="+comment_id+"&vid="+video_id,"","",false);

$(selector).fadeOut("slow")}}}this.tooltip=function(){xOffset=-10;yOffset=0;$("a.tooltip").hover(function(e){this.t=this.title;this.title="";$("body").append("<p id='tooltip'>"+this.t+"</p>");

$("#tooltip").css("top",(e.pageY-xOffset)+"px").css("left",(e.pageX+yOffset)+"px").fadeIn("normal")},function(){this.title=this.t;$("#tooltip").remove()});

$("a.tooltip").mousemove(function(e){$("#tooltip").css("top",(e.pageY-xOffset)+"px").css("left",(e.pageX+yOffset)+"px")})};

