//JavaScript Kodları
//Coder ErsaT
function fb_paylas(url,baslik){
	window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(url)+'&t='+encodeURIComponent(baslik)+'', 'fb_baylas', 'toolbar=0,status=0,width=626,height=436');
}
function FilmAra(){
	ackapa('film_arama');
	document.header_arama.etiket.focus();
}
function ackapa(id){
	var e = document.getElementById(id).style;
	if(e.display == 'none'){
		e.display = 'block';
	}else if(e.display == 'block'){
		e.display = 'none';
	}else{
		e.display = 'block';
	}
}
function gosterme(id){
	document.getElementById(id).style.display = 'none';
}
function HataBildir(id){
	if(confirm('Hata Bildirimi\n\n1- Hata bildirimi yapmadan önce sayfayı yenileyip tekrar deneyiniz.\n2- F5 tuşu ile sayfayı yenileyebilirsiniz.\n3- Videoları izleyebilmeniz için sisteminizde Flash Player gerekli, Flash Playerinizin olduğundan veya güncel olduğundan emin olun.\n4- Lütfen son olarak yardım sayfamızı ziyaret edip olası nedenleri tekrar gözden geçirin\n5- Bütün bunlara rağmen videoyu izleyemiyorsanız lütfen bize bildirin.\n\nDikkat! İnternet Explorer 6 veya daha altı sürüm kullanıyorsanız filmleri izleyemeyebilirsiniz.\n\nBildirim yaptığınız için teşekkür ederiz.')){
		window.open('/hatabildir.php?id='+id+'', 'hatabildir', 'width=425, height=295');
	
	}
}
function TamEkran(id){
	document.getElementById('tamekran').style.display = 'block';
	document.getElementById('player').style.display = 'none';
	window.open('/tamekran.php?id='+id+'', 'tamekran', 'DisplayFullScreen');
}
function TamEkranAc(id,w,h){
	//document.getElementById('tamekran').style.display = 'block';
	//document.getElementById('player').style.display = 'none';
	window.open('http://www.cizgifilm.in/tamekran_resim.php?id='+id+'', 'tamekran', 'width='+w+', height='+h+'');
}
function TamEkranCik(){
	document.getElementById('tamekran').style.display = 'none';
	document.getElementById('player').style.display = 'block';
}
function Tavsiye(id){
	window.open('/tavsiye.php?id='+id+'', 'tavsiye', 'width=440, height=450');
}
function Favoriler(isim,url){
var msg_netscape = "NetScape message";
var msg_opera = "Bu özellik Opera'nın bu versiyonunda kullanılmıyor. Lütfen browser ayarlarınızdan tamamlayın.";
var msg_other = "Bu özellik browseriniz tarafından desteklemiyor. Lütfen browser ayarlarınızdan tamamlamaya çalışın.";
var agt = navigator.userAgent.toLowerCase();
if(agt.indexOf("opera") != -1){
	if(window.opera && window.print){
		return true;
		}else{
			alert(msg_other);
		}
	}else if(agt.indexOf("firefox") != -1)
		window.sidebar.addPanel(isim,url,"");
	else if((agt.indexOf("msie") != -1) && (parseInt(navigator.appVersion) >=4)) window.external.AddFavorite(url,isim);
	else if(agt.indexOf("netscape") != -1) window.sidebar.addPanel(isim,url,"")
else if(window.sidebar && window.sidebar.addPanel) window.sidebar.addPanel(isim,url,"");
else alert(msg_other);
}
function AnaSayfamYap(URL){
	var l = document.getElementById('anasayfa');
    var Text = 'Giriş sayfanızı http://www.erenetoyun.com olarak ayarlamak ister misiniz?';
    if (document.all){
		l.style.behavior='url(#default#homepage)';
		l.setHomePage(URL);

	}else if(document.getElementById || document.layers){
		if(confirm(Text)){
			netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite");
			navigator.preference('browser.startup.homepage',URL);
		}
	}else{
		alert('Üzgünüz, browseriniz bu özelliği desteklemiyor. Browser ayarlarınızdan tamamlayın.');
	}
	return false;    
}
function video_ekrani(vi,w,h){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+w+'" height="'+h+'">');
	document.write('<param name="movie" value="'+vi+'">');
	document.write('<param name="quality" value="High">');
	document.write('<param name="menu" value="0">');
	document.write('<param name="_cx" value="7673">');
	document.write('<param name="_cy" value="5583">');
	document.write('<param name="FlashVars" value>');
	document.write('<param name="Src" value="'+vi+'">');
	document.write('<param name="WMode" value="Window">');
	document.write('<param name="Play" value="-1">');
	document.write('<param name="Loop" value="-1">');
	document.write('<param name="SAlign" value>');
	document.write('<param name="Base" value>');
	document.write('<param name="allowNetworking" value="internal">');
	document.write('<param name="AllowScriptAccess" value="sameDomain">');
	document.write('<param name="Scale" value="ShowAll">');
	document.write('<param name="DeviceFont" value="0">');
	document.write('<param name="EmbedMovie" value="0">');
	document.write('<param name="BGColor" value>');
	document.write('<param name="SWRemote" value>');
	document.write('<param name="MovieData" value>');
	document.write('<param name="SeamlessTabbing" value="1">');
	document.write('<embed id="VideoPlayback" src="'+vi+'" width="'+w+'" height="'+h+'" allowNetworking="internal" allowScriptAccess="sameDomain" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" menu="false"><\/embed><\/object>');
}
function video_ekrani2(vi){
	document.write('<embed id="VideoPlayback" src="'+vi+'" width="300" height="252" allowNetworking="internal" allowScriptAccess="sameDomain" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" menu="false"><\/embed>');
}
function cizgi_film_kutusu(u,g,y){
	document.write('<iframe width="'+g+'" height="'+y+'" src="cizgifilm.in_player/player.php?video='+u+'" scrolling="no" border="0" frameborder="0" name="cizgi_film_ekrani" style="background:#000000"><\/iframe>');	
}
function cizgi_film_media_player(id,w,h){
	document.write('<object id="player" name="player" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" type="application/x-oleobject" standby="Loading Microsoft Windows Media Player components..." classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" height="'+h+'" width="'+w+'">');
	document.write('<param name="src" value="'+id+'">');
	document.write('<param name="fileName" value="'+id+'">');
	document.write('<param name="autostart" value="1">');
	document.write('<param name="showcontrols" value="1">');
	document.write('<param name="showdisplay" value="0">');
	document.write('<param name="showstatusbar" value="1">');
	document.write('<param name="showgotobar" value="0">');
	document.write('<param name="enablecontextmenu" value="0">');
	document.write('<param name="volume" value="90">');
	document.write('<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/download/default.asp" src="'+id+'" filename="'+id+'" autostart="1" showcontrols="1" showdisplay="0" showstatusbar="1" showgotobar="0" enablecontextmenu="0" volume="90" height="'+h+'" width="'+w+'"><\/embed><\/object>');
}
function cizgi_film_media_player2(id,w,h){
	document.write('<object id="player" height="'+h+'" width="'+w+'" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" border="0">');
	document.write('<param NAME="rate" value="1">');
	document.write('<param NAME="balance" value="0">');
	document.write('<param NAME="currentPosition" value="0">');
	document.write('<param NAME="defaultFrame" value>');
	document.write('<param NAME="playCount" value="5">');
	document.write('<param NAME="autoStart" value="-1">');
	document.write('<param NAME="currentMarker" value="0">');
	document.write('<param NAME="invokeURLs" value="-1">');
	document.write('<param NAME="baseURL" value>');
	document.write('<param NAME="volume" value="99">');
	document.write('<param NAME="mute" value="0">');
	document.write('<param NAME="uiMode" value="full">');
	document.write('<param NAME="stretchToFit" value="-1">');
	document.write('<param NAME="windowlessVideo" value="0">');
	document.write('<param NAME="enabled" value="-1">');
	document.write('<param NAME="enableContextMenu" value="0">');
	document.write('<param NAME="fullScreen" value="0">');
	document.write('<param NAME="SAMIStyle" value>');
	document.write('<param NAME="SAMILang" value>');
	document.write('<param NAME="SAMIFilename" value>');
	document.write('<param NAME="captioningID" value>');
	document.write('<param name="URL" value="'+id+'">');
	document.write('<param name="enableErrorDialogs" value="0">');
	document.write('<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/download/default.asp" height="'+h+'" width="'+w+'" rate="1" balance="0" currentPosition="0" defaultFrame="" playCount="5" autoStart="-1" currentMarker="0" invokeURLs="-1" baseURL="" volume="99" mute="0" uiMode="full" stretchToFit="-1" windowlessVideo="0" enabled="-1" enableContextMenu="0" fullScreen="0" SAMIStyle="" SAMILang="" SAMIFilename="" captioningID="" URL="'+id+'" enableErrorDialogs="0"><\/embed><\/object>');
}

//Yorum için
function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit){
field.value = field.value.substring(0, maxlimit);

}else{
countfield.value = maxlimit - field.value.length;}
}

var say1=0
var say2=2
function say(){
say1++
say2--
if(say2 > 0){
	document.getElementById('similey_sinir').innerHTML = "<strong>"+say2+"<\/strong> similey hakkınız kaldı.";
}else{
 	 document.getElementById('similey_sinir').innerHTML = "İkiden fazla similey kullanamazsınız. İkiden fazla similey kullanırsanız yorumunuz <span style=\"color:#FF3300;\"><strong>kabul edilmez<\/strong>.<\/span>";
}
if(say1 >= 2){
document.getElementById('similey').style.display = 'none';
}
}
function mesaja_ekle(simi){
		say();
		document.yorumlar.yorum.value += " "+simi+" ";
		document.yorumlar.yorum.focus();
}
function ForumKodu(Kod, Metin) {
	if (Kod != "") {
		KodEkle = prompt(Metin,"");
		if ((KodEkle != null) && (KodEkle != "")){
			document.yorumlar.yorum.value += "[" + Kod + "]" + KodEkle + "[/"+ Kod + "] ";
		}
	}
	document.yorumlar.yorum.focus();
}
//Cookie Reklam
function writeCookie(name, value, days){
    if(days==null || days=="")days=365;
    var d=new Date();
    d.setTime(d.getTime()+(days*24*60*60*1000));
    var expires="; expires="+d.toGMTString();
    document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name){
    var c=document.cookie ;
    if (c.indexOf(name)!=-1){
        pos1=c.indexOf("=", c.indexOf(name))+1;
        pos2=c.indexOf(";",pos1);
		if(pos2==-1) pos2=c.length;;
        data=c.substring(pos1,pos2);
        return data;
    }
}
function r_kapat(){
	var r = document.getElementById('dikey_reklam_alani');
	var rg = document.getElementById('dikey_reklam_alani_g');
	if(r.style.display == "block"){
		r.style.display="none";
		rg.style.display="block";
		writeCookie('kayan_reklam', 0, 1);
	}else{
		r.style.display="block";
		rg.style.display="none";
		writeCookie('kayan_reklam', 1, 1);
	}
}
function r_bak(){
	var r = document.getElementById('dikey_reklam_alani');
	var rg = document.getElementById('dikey_reklam_alani_g');
	if(readCookie('kayan_reklam') == 0 ){
		r.style.display = 'none';
		rg.style.display = 'block';
	}else{
		r.style.display = 'block';
		rg.style.display = 'none';
	}
}
//Cookie Reklam