function obj(objID){
    return document.getElementById(objID);
}

function objStyle(objID){
    return document.getElementById(objID).style;
}

function IsSure(msg){
    c = confirm(msg);
    
    return c;
}

function replaceEnter2br(dataStr) {
        return dataStr.replace(/(\r\n|\r|\n)/g, "<br />");
    }
    
function writeFlash(path,width,height){
    AC_FL_RunContent('codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0','width',width,'height',height,'src',path,'quality','high','wmode','','pluginspage','http://www.macromedia.com/go/getflashplayer','movie',path,'wmode','','bgcolor','#41C6EA','allowScriptAccess','sameDomain' );
} 

function setFocus(objID){
    obj(objID).focus();
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function oyunlarTabChange(objID, mObj){
	obj=document.getElementById('iyiOyunlar');
	obj2=document.getElementById('yeniOyunlar');
	iHtmlText = '';
	if(objID=='yeniOyunlar'){
		obj.style.display = 'none';
		obj2.style.display = 'block';
		iHtmlText = '<a href="javascript:void(0);" class="oyunlarBtn01" onclick="oyunlarTabChange(\'iyiOyunlar\',this.parentNode)"><span>En İyi Oyunlar</span></a>'
		iHtmlText += '<a href="javascript:void(0);" class="oyunlarBtn02 oyunlarSeciliBtn" onclick="oyunlarTabChange(\'yeniOyunlar\',this.parentNode)"><span>Yeni Oyunlar</span></a>'
	}else{
		obj.style.display = 'block';
		obj2.style.display = 'none';
		iHtmlText = '<a href="javascript:void(0);" class="oyunlarBtn01 oyunlarSeciliBtn" onclick="oyunlarTabChange(\'iyiOyunlar\',this.parentNode)"><span>En İyi Oyunlar</span></a>'
		iHtmlText += '<a href="javascript:void(0);" class="oyunlarBtn02" onclick="oyunlarTabChange(\'yeniOyunlar\',this.parentNode)"><span>Yeni Oyunlar</span></a>'
	}
	mObj.innerHTML = iHtmlText;
}
function hanerlerTabChange(objID, mObj){
	obj=document.getElementById('haberler');
	obj2=document.getElementById('duyurular');
	obj3=document.getElementById('festivaller');
	iHtmlText = '';
	if(objID=='haberler'){
		obj.style.display = 'block';
		obj2.style.display = 'none';
		obj3.style.display = 'none';
		iHtmlText = '<a href="javascript:void(0);" class="haberlerBtn01 haberlerSeciliBtn" onclick="hanerlerTabChange(\'haberler\', this.parentNode)"><span>Haberler</span></a>'
		//iHtmlText += '<a href="javascript:void(0);" class="haberlerBtn02" onclick="hanerlerTabChange(\'duyurular\', this.parentNode)"><span>Duyurular</span></a>'
		iHtmlText += '<a href="javascript:void(0);" class="haberlerBtn03" onclick="hanerlerTabChange(\'festivaller\', this.parentNode)"><span>Festival</span></a>'
	}else if(objID=='duyurular'){
		obj.style.display = 'none';
		obj2.style.display = 'block';
		obj3.style.display = 'none';
		iHtmlText = '<a href="javascript:void(0);" class="haberlerBtn01" onclick="hanerlerTabChange(\'haberler\', this.parentNode)"><span>Haberler</span></a>'
		//iHtmlText += '<a href="javascript:void(0);" class="haberlerBtn02 haberlerSeciliBtn" onclick="hanerlerTabChange(\'duyurular\', this.parentNode)"><span>Duyurular</span></a>'
		iHtmlText += '<a href="javascript:void(0);" class="haberlerBtn03" onclick="hanerlerTabChange(\'festivaller\', this.parentNode)"><span>Festival</span></a>'
	}else{
		obj.style.display = 'none';
		obj2.style.display = 'none';
		obj3.style.display = 'block';
		iHtmlText = '<a href="javascript:void(0);" class="haberlerBtn01" onclick="hanerlerTabChange(\'haberler\', this.parentNode)"><span>Haberler</span></a>'
		//iHtmlText += '<a href="javascript:void(0);" class="haberlerBtn02" onclick="hanerlerTabChange(\'duyurular\', this.parentNode)"><span>Duyurular</span></a>'
		iHtmlText += '<a href="javascript:void(0);" class="haberlerBtn03 haberlerSeciliBtn" onclick="hanerlerTabChange(\'festivaller\', this.parentNode)"><span>Festival</span></a>'
	}
	mObj.innerHTML = iHtmlText;
}
function uyelerTabChange(objID, mObj){
	obj=document.getElementById('haftaninUyeleri');
	obj2=document.getElementById('enPuanliUyeler');
	iHtmlText = '';
	if(objID=='enPuanliUyeler'){
		obj.style.display = 'none';
		obj2.style.display = 'block';
		iHtmlText = '<a href="javascript:void(0);" class="uyelerBtn01" onclick="uyelerTabChange(\'haftaninUyeleri\',this.parentNode)"><span>Haftanın Üyeleri</span></a>'
		iHtmlText += '<a href="javascript:void(0);" class="uyelerBtn02 uyelerSeciliBtn" onclick="uyelerTabChange(\'enPuanliUyeler\',this.parentNode)"><span>En Puanlı Üyeler</span></a>'
	}else{
		obj.style.display = 'block';
		obj2.style.display = 'none';
		iHtmlText = '<a href="javascript:void(0);" class="uyelerBtn01 uyelerSeciliBtn" onclick="uyelerTabChange(\'haftaninUyeleri\',this.parentNode)"><span>Haftanın Üyeleri</span></a>'
		iHtmlText += '<a href="javascript:void(0);" class="uyelerBtn02" onclick="uyelerTabChange(\'enPuanliUyeler\',this.parentNode)"><span>En Puanlı Üyeler</span></a>'
	}
	mObj.innerHTML = iHtmlText;
}
function fotoGaleriTabChange(objID, mObj){
	obj=document.getElementById('fotoGaleri');
	obj2=document.getElementById('videoGaleri');
	iHtmlText = '';
	if(objID=='videoGaleri'){
		obj.style.display = 'none';
		obj2.style.display = 'block';
		iHtmlText = '<a href="javascript:void(0);" class="fotoGaleriBtn01" onclick="fotoGaleriTabChange(\'fotoGaleri\',this.parentNode)"><span>Fotoğraf Galerisi</span></a>'
		iHtmlText += '<a href="javascript:void(0);" class="fotoGaleriBtn02 fotoGaleriSeciliBtn" onclick="fotoGaleriTabChange(\'videoGaleri\',this.parentNode)"><span>Video Galerisi</span></a>'
	}else{
		obj.style.display = 'block';
		obj2.style.display = 'none';
		iHtmlText = '<a href="javascript:void(0);" class="fotoGaleriBtn01 fotoGaleriSeciliBtn" onclick="fotoGaleriTabChange(\'fotoGaleri\',this.parentNode)"><span>Fotoğraf Galerisi</span></a>'
		iHtmlText += '<a href="javascript:void(0);" class="fotoGaleriBtn02" onclick="fotoGaleriTabChange(\'videoGaleri\',this.parentNode)"><span>Video Galerisi</span></a>'
	}
	mObj.innerHTML = iHtmlText;
}
function loginFormAcKapat(){
	obj = document.getElementById('fldLogin');
	if(obj.style.display == "none"){
		obj.style.display = "block"
	}else{
		obj.style.display = "none"
	}
}

var subMenuID = "";
var subMenuParentID = "";
var IsMenuVisible = false;

function openSubMenu(mID,pID){
	clearInterval(menuInterval);
	subMenuID = mID;
	subMenuParentID = pID;
	document.getElementById(subMenuParentID).style.backgroundPosition = 'left bottom';
	document.getElementById(subMenuID).style.display='block';
	IsMenuVisible = true;
}
function closeSubMenu(){
	clearInterval(menuInterval);
	menuInterval = window.setInterval('closeSubMenu2()',500);
}
function closeSubMenu2(){
    if (IsMenuVisible){
	    clearInterval(menuInterval);
	    document.getElementById(subMenuID).style.display='none';
	    document.getElementById(subMenuParentID).style.backgroundPosition = 'left top';
	    IsMenuVisible = false;
	}
}
menuInterval = window.setInterval('closeSubMenu2()',150);

var YukleniyorHaberler = '<div style="width:500px; padding-top:50px;" align="center">Yukleniyor...<br> Lutfen bekleyin.<br /><br /><img src="/images/loading.gif" style="float:none;width:16px; height:16px;" border="0" alt="Yükleniyor..."></div>';

function ObjeOlustur(){
    try {
      return new XMLHttpRequest();
    } catch (trymicrosoft) {
      try {
        return new ActiveXObject("Msxml2.XMLHTTP");
      } catch (othermicrosoft) {
        try {
          return new ActiveXObject("Microsoft.XMLHTTP");
        } catch (failed) {
          return false;
        }
      }
    }
}

function GetComment(RelatedID,ModuleID,PageNo){
		GetCommentPage = new ObjeOlustur;
		document.getElementById('dynComment').innerHTML =  YukleniyorHaberler ;
		url='/xml/ajxGetComment.ashx?RelatedID=' + RelatedID + '&ModuleID='+ ModuleID + '&PageNo=' + PageNo + '&rnd=' + Math.random();
		//alert(url);
		GetCommentPage.open('GET',url ,true);
		GetCommentPage.onreadystatechange = GetCommentFillPage;
		GetCommentPage.send(null);
	}

function GetCommentFillPage(){
	if (GetCommentPage.readyState == 4){
		if (GetCommentPage.status == 200){
			var Cevap = GetCommentPage.responseText;   
			document.getElementById("dynComment").innerHTML = Cevap;
			//alert(Cevap);
		}else{
			//alert(GetCommentPage.responseText);
		}
	}
}