// JavaScript Document
if ( typeof(AW) == 'undefined' ) AW = function() {};
var loadingIMG = new Array();
loadingIMG[0] = new Image();
loadingIMG[0].src = siyt_cnfg['siyt_path'] + 'images/loading0.gif';
loadingIMG[1] = new Image();
loadingIMG[1].src = siyt_cnfg['siyt_path'] + 'images/loading1.gif';
loadingIMG[2] = new Image();
loadingIMG[2].src = siyt_cnfg['siyt_path'] + 'images/loading2.gif';
var blankSrc = siyt_cnfg['siyt_path'] + 'images/blank.gif';

function AW_Browser()
{
	d=document;
	this.agt=navigator.userAgent.toLowerCase();
	this.major=parseInt(navigator.appVersion);
	this.dom=(d.getElementById);
	this.ns=(d.layers);
	this.ns4up=(this.ns && this.major>=4);
	this.ns6=(this.dom&&navigator.appName=="Netscape");
	this.op=(window.opera);
	if(d.all)this.ie=1;else this.ie=0;
	this.ie4=(d.all&&!this.dom);
	this.ie4up=(this.ie&&this.major>=4);
	this.ie5=(d.all&&this.dom);
	this.ie6=(d.nodeType);
	this.sf=(this.agt.indexOf("safari")!=-1);
	this.win=((this.agt.indexOf("win")!=-1)||(this.agt.indexOf("16bit")!=-1));
	this.winme=(this.agt.indexOf("win 9x 4.90")!=-1);
	this.xpsp2=(this.agt.indexOf("sv1")!=-1);
	this.mac=(this.agt.indexOf("mac")!=-1);
}
AW.browser = new AW_Browser();

function loading(x,h)
{
	var html='';
	html += '		<table width="100%" border="0" cellspacing="0" cellpadding="0">';
	html += '            <tr>';
	html += '              <td height="'+ h +'" align="center" style="font-family:Tahoma;font-size:11px;"><img src="'+ siyt_cnfg['siyt_path'] +'images/loading'+ x +'.gif"><br>Yükleniyor...</td>';
	html += '            </tr>';
	html += '          </table>';
	
	return html;
}


function redirect(url)
{
 location.href=url;
}

function createRequestObject() {
    var ro;
    var browser = navigator.appName;
    if(browser == "Microsoft Internet Explorer"){
        ro = new ActiveXObject("Microsoft.XMLHTTP");
    }else{
        ro = new XMLHttpRequest();
    }
    return ro;
}
var http = createRequestObject();
function getHtml(url,id,fnct) 
{
	if(fnct!='')run_fnct=fnct;
	else run_fnct='';
	url = siyt_cnfg['siyt_path'] + 'ajax.php' + url;
	http.open('get', url);
    http.onreadystatechange = function()
	{
		insertHtml(id);
	}
    http.send(null);
}
var run_fnct='';
function insertHtml(id) {
    if(http.readyState == 4){
        var response = http.responseText;
        
            document.getElementById(id).innerHTML = response;
			if(run_fnct!=''){eval(run_fnct);run_fnct='';}
       
    }else
	{
		h=document.getElementById(id).offsetHeight;
		document.getElementById(id).innerHTML = loading(2,h);
	}
}
function listenPpageLink()
{
	if(document.getElementById('divPpage'))
	{
		tags = document.getElementById('divPpage').getElementsByTagName('A');
		for(i=0;i<tags.length;i++)
		{
			tags[i].onclick = function()
			{
				x=this.href;
				x = x.substring(x.lastIndexOf("?"),x.length);
				getHtml(x,'osbjct','listenPpageLink()');
				return false;
			}
		}
	}
}
function listenKpageLink()
{
	if(document.getElementById('divKpage'))
	{
		tags = document.getElementById('divKpage').getElementsByTagName('A');
		for(i=0;i<tags.length;i++)
		{
			tags[i].onclick = function()
			{
				x=this.href;
				x = x.substring(x.lastIndexOf("?"),x.length);
				getHtml(x,'osbjct','listenKpageLink()');
				return false;
			}
		}
	}
}
function listenCmntLink()
{
	if(document.getElementById('divCpage'))
	{
		tags = document.getElementById('divCpage').getElementsByTagName('A');
		for(i=0;i<tags.length;i++)
		{
			tags[i].onclick = function()
			{
				x=this.href;
				x = x.substring(x.lastIndexOf("?"),x.length);
				x = x.replace('page=news','page=comment&mode=news');
				x = x.replace('page=article','page=comment&mode=article');
				x = x.replace('page=glry','page=comment&mode=glry');
				getHtml(x,'divComment','listenCmntLink()');
				return false;
			}
		}
	}
}

//kayan yazı function
function initScroller()
{
	if(offerArr.length>1)
	{
	    for (x=1; x<(offerArr.length); x++)
		{
			itemArr[x] = document.getElementById("td"+x).offsetLeft;
		}
	}
	startScroller();
}
function startScroller()
{   
	if(!is_macie)
	{
		oTable=document.getElementById("scrollertable"); 
		oDiv=document.getElementById("scrollerdiv");   
		width=oTable.offsetWidth;
		halfWidth=Math.floor(width/2);
		newWidth = (halfWidth*2)+2;
		oDiv.style.width=newWidth
		scrollText(oDiv, newWidth);
	}
}
function scrollText(oDiv, width)
{
	maxLeft = 0-width+20;
	oDiv.style.left=(parseInt(oDiv.style.left) <= maxLeft)?0:parseInt(oDiv.style.left)-1
	if(parseInt(oDiv.style.left)==0)sec=2000;
	if(parseInt(oDiv.style.left) == parseInt(itemArr[itm])*(-1))
	{
	    pause = setTimeout("pauseScroller(oDiv, "+width+");", 1);
		itm++;
	}
	else
	{
	    timer = setTimeout ("scrollText(oDiv, "+width+");", sec);
	}
	sec = 20;
}
function hideScroller(vis) 
{
	if (document.getElementById("scrollerdiv")) document.getElementById("scrollerdiv").style.visibility = vis;
}
function stopScroller() {clearTimeout(timer); }
function pauseScroller(oDiv, width)
{
	clearTimeout(pause);
	timer = setTimeout("scrollText(oDiv, "+width+");", 750);
}
function buildScroller(txtArr,w,h,bgcolor,target)
{
	var scroller = "";
						
	scroller+= '<div style="width:'+w+';position:relative; overflow:hidden" class="divSnDkCenter2">';
	scroller+='<div id="scrollerdiv" name="scrollerdiv" style="position:relative; left:0; z-index:1">';
	scroller+='<table border="0" cellpadding="0" cellspacing="0" name="table" id="scrollertable"><tr>';
	for (x=0; x<(txtArr.length); x++)
	{
		scroller+='<td id="td'+x+'" class="blog" nowrap onMouseOver="stopScroller();" onMouseOut="startScroller()">';
		if(txtArr[x][1]!="")
		{
			if(target>"")
			{
				scroller+='<a class="link-SnDk" href="'+txtArr[x][1]+'" target="'+target+'">'+txtArr[x][0]+'<\/a>';
			}
			else
			{
				scroller+='<a class="link-SnDk" href="'+txtArr[x][1]+'">'+txtArr[x][0]+'<\/a>';
			}
		}
		else
		{
			scroller+=''+txtArr[x][0]+' '+txtArr[x][1];
		}
		scroller+='<\/td>';
	}
	scroller+='<\/tr><\/table><\/div><\/div>';
	document.writeln(scroller);
					  
}
//kayan yazı function end
var news_text_default = '-1';
function fontSize(x)
{
	var htmlTag = new Array("FONT","SPAN","DIV","TD","P","B","A","CENTER","U","I","SUP","SUB","PRE","UL","LI","OL","H1","H2","H3","H4","H5","H6","S","TT","DL","DT","DD");
	if(news_text_default=='-1')news_text_default=document.getElementById("news_text").innerHTML;
	
	if(x==12)
	{
		document.getElementById("news_text").style.fontSize = '';
		document.getElementById("news_text").innerHTML=news_text_default;
	}
	else
	{
		document.getElementById("news_text").innerHTML=news_text_default;
		document.getElementById("news_text").style.fontSize = x + 'pt';
		for (var t = 0; t < htmlTag.length; t++) 
		{
			var tag = document.getElementById("news_text").getElementsByTagName(htmlTag[t]);
			
			for (var i = 0; i < tag.length; i++) 
			{
				tag[i].style.fontSize = x + 'pt';
			}
		}
	}
} 


function go(url)
{
	if(url!="s")window.open(url,"","");
}

function listenToMnst()
{
	if(document.getElementById('divMnstLink'))
	{
		tags = document.getElementById('divMnstLink').getElementsByTagName('A');
		for(i=0;i<tags.length;i++)
		{
			tags[i].onmouseover = function()
			{
				setMnstLinkClass();
				for(j=0;j<mnstArr.length;j++)
				{
					if(mnstArr[j][0]==this.href)
					{
						this.parentNode.className='link-02';
						chngMnst(j);
						break;	
					}
				}
			}
		}
	}
}
function setMnstLinkClass()
{
	tags = document.getElementById('divMnstLink').getElementsByTagName('ul');
	for(i=0;i<tags.length;i++)
	{
		if(tags[i].className != 'link-01')tags[i].className='link-01';
	}
}
function chngMnst(j)
{
	if(mnstArr[j])
	{
		document.getElementById('divMnstMnst_' + mnstPrev).style.display='none';
		if(document.getElementById('divMnstMnst_' + j))document.getElementById('divMnstMnst_' + j).style.display='';
		
		document.getElementById('mnstZt').innerHTML=mnstArr[j][2];
		if(siyt_cnfg['agt']==1)
		{
			img=document.getElementById('mnstImg').getElementsByTagName('img')[0];
			img.src=mnstArr[j][3].src;
			document.getElementById('mnstImg').getElementsByTagName('A')[0].href=mnstArr[j][0];
		}
		else document.getElementById('mnstImg').innerHTML='<a href="'+ mnstArr[j][0]  +'"><img border="0" src="'+ mnstArr[j][1] +'"></a>';
		mnstPrev=j;
	}
}
function blinkIt()
{
	var tag = document.getElementsByTagName('blink');
	if(document.all)
	{
		for(i=0; i<tag.length; i++)
		{
			s=tag[i];
			s.style.visibility=(s.style.visibility=='visible')?'hidden':'visible';
		}
	}
}
setInterval('blinkIt()',400);
function addComment(mode,id)
{
	url=siyt_cnfg['siyt_path'] + 'addComment.php?mode=' + mode + '&id=' + id;
	window.open(url, '_blank', 'width=500, height=320,top=0, toolbar=0, location=0, directories=0, status=0, menuBar=0, scrollBars=1, resizable=0' ) ;
	
}
function sendFriend(mode,id)
{
	url=siyt_cnfg['siyt_path'] + 'sendFriend.php?mode=' + mode + '&id=' + id;
	window.open(url, '_blank', 'toolbar=0, location=0, directories=0, status=0, menuBar=0, scrollBars=1, resizable=0, width=500, height=300, top=0' ) ;
}
function printf(mode,id)
{
	url=siyt_cnfg['siyt_path'] + 'printf.php?mode=' + mode + '&id=' + id;
	window.open(url, '_blank', 'toolbar=0, location=0, directories=0, status=0, menuBar=0, scrollBars=1, resizable=0, width=550, height=550, top=0' ) ;
}
function openPage(url,width,height)
{
	url=siyt_cnfg['siyt_path'] + url;
	width=width + 10;
	height=height + 10;
	window.open(url, '_blank', 'toolbar=0, location=0, directories=0, status=0, menuBar=0, scrollBars=1, resizable=0, width='+ width +', height='+ height +', top=0' ) ;
}
function printFile(path,width,height,wmode)
{
	var ext=path.substring(path.lastIndexOf(".") + 1,path.length);
	var html = '';
	if(ext=="swf")
	{
		html += '<object  classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+ width +'" height="'+ height +'">';
		html += '      <param name="menu" value="false">';
        html += '      <param name="movie" value="'+ path +'" />';
        html += '      <param name="quality" value="high" />';
		html += '      <param name="wmode" value="transparent"';
		html += '      <embed src="'+ path +'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ width +'" height="'+ height +'"></embed>';
        html += '    </object>';
	}
	else if(ext=="jpg" || ext=="jpeg" || ext=="gif")
	{
		html +='<img src="'+ path +'" width="'+ width +'" height="'+ height +'" border="0">';
	}
	document.write(html);
}
function printFile2(path,width,height)
{
	var ext=path.substring(path.lastIndexOf(".") + 1,path.length);
	var html = '';
	if(ext=="swf")
	{
		html += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+ width +'" height="'+ height +'">';
        html += '      <param name="movie" value="'+ path +'" />';
        html += '      <param name="quality" value="high" />';
		html += '      <param name="wmode" value="transparent"';
        html += '      <embed src="'+ path +'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ width +'" height="'+ height +'"></embed>';
        html += '    </object>';
	}
	else if(ext=="jpg" || ext=="jpeg" || ext=="gif")
	{
		html +='<img src="'+ path +'" width="'+ width +'" height="'+ height +'" border="0" style="background-image:url(' + siyt_cnfg['siyt_path'] + 'images/loading2.gif);background-repeat:no-repeat;background-position:50% 50%;">';
	}
	return html;
}
function defaultHomepage(x)
{
	x.style.behavior='url(#default#homepage)';
	x.setHomePage(siyt_cnfg['siyt_path']);
}
function getPollSource()
{
	durum=false;
	c=document.poll;
	x=c.answer.length;
	for(i=0;i<c.answer.length;i++)
	{
		if(c.answer[i].checked) 
		{
			durum=true;
			break; 
		}
	}
	if(durum)c.submit();
	else 
	{
		alert("Lütfen seçim yapınız!");
		return false;
	}
}
var onLoadFnctn = new Array();
function startOnLoadFnctn()
{
	for(i=0;i<onLoadFnctn.length;i++)
	{
		eval(onLoadFnctn[i]);	
	}
	
	dT();
	fixImage();
	//prevLink();
	listenToMnst();
}
function addOnLoadFnctn(x)
{
	onLoadFnctn[onLoadFnctn.length]=x+'()';
}
function fixImage() {
	// get src
	var supported = /MSIE ((5\.5)|[6789])/.test(navigator.userAgent) && navigator.platform == "Win32";
	if (supported && document.getElementById('arsivimg'))
	{
		var element = document.getElementById('arsivimg');
		var src = element.src;
			// set filter
		element.src = blankSrc;
		element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='scale')";
	}
}
function pollGrafik()
{
	var durum=false;
	for(i=0;i<pollArr.length;i++)
	{
		w=document.getElementById('sdf' + i).style.width.replace('%','');
		w++;
		z=pollArr[i] + 1;
		if(w<z)
		{
			document.getElementById('sdf' + i).style.width= w + '%';
			document.getElementById('sdfl' + i).innerHTML= '%' + w; 
			durum=true;
		}
	}
	if(durum)setTimeout('pollGrafik()', 10);
}
function listenToHabersahibiCom()
{
	if(document.getElementById('divIframe'))
	{
		tags = document.getElementById('divIframe').getElementsByTagName('A');
		for(i=0;i<tags.length;i++)
		{
			tags[i].onmouseover = function()
			{
				setHabersahibiComLinkClass();
				for(j=0;j<iframeArr.length;j++)
				{
					if(iframeArr[j][0]==this.href)
					{
						this.parentNode.className='iframe_link2';
						chngHabersahibiCom(j);
						break;	
					}
				}
			}
		}
	}
}
function setHabersahibiComLinkClass()
{
	tags = document.getElementById('divIframe').getElementsByTagName('ul');
	for(i=0;i<tags.length;i++)
	{
		tags[i].className='iframe_link';
	}
}
function chngHabersahibiCom(j)
{
	
	if(iframeArr[j])
	{
		html='<img src="'+ iframeArr[j][1] +'" align="right" width="154" style="border:1px solid #060606;margin-left:2px;"><span style="color:#ffb935;font-weight:bold;font-size:12px;">'+ iframeArr[j][2] +'</span><br>'+ iframeArr[j][3];
		
		document.getElementById('divIfameInner').innerHTML=html;
	}
}
var ArrayNews = new Array();
function prevLink()
{
	tags = document.getElementById("divLeft").getElementsByTagName('A');
	for(i=0;i<tags.length;i++)
	{
		z = tags[i].href.split("/");
		
		if(typeof(z[3]) != 'undefined' && z[3]=="news")
		{
			tags[i].onmouseover = function()
			{
				z = this.href.split("/");
				if(typeof(ArrayNews[z[4]]) == 'undefined')getHtml2(z[4]);
				else greInfoElem(ArrayNews[z[4]]);
			}
			tags[i].onmouseout = function()
			{
				greInfoElem('',0);
			}
		}
	}
	tags = document.getElementById("divCenter").getElementsByTagName('A');
	for(i=0;i<tags.length;i++)
	{
		z = tags[i].href.split("/");
		
		if(typeof(z[3]) != 'undefined' && z[3]=="news")
		{
			tags[i].onmouseover = function()
			{
				z = this.href.split("/");
				if(typeof(ArrayNews[z[4]]) == 'undefined')getHtml2(z[4]);
				else greInfoElem(ArrayNews[z[4]]);
			}
			tags[i].onmouseout = function()
			{
				greInfoElem('',0);
			}
		}
	}
	tags = document.getElementById("divRight").getElementsByTagName('A');
	for(i=0;i<tags.length;i++)
	{
		z = tags[i].href.split("/");
		
		if(typeof(z[3]) != 'undefined' && z[3]=="news")
		{
			tags[i].onmouseover = function()
			{
				z = this.href.split("/");
				if(typeof(ArrayNews[z[4]]) == 'undefined')getHtml2(z[4]);
				else greInfoElem(ArrayNews[z[4]]);
			}
			tags[i].onmouseout = function()
			{
				greInfoElem('',0);
			}
		}
	}
}

function getHtml2(idx) 
{
	url = siyt_cnfg['siyt_path'] + 'ajax.php?page=prevLink&id=' + idx;
	http.open('get', url);
    http.onreadystatechange = function()
	{
		if(http.readyState == 4)
		{
        	var response = http.responseText;
          	greInfoElem(response);
			ArrayNews[idx] = response;
    	}
	}
    http.send(null);
}

function greInfoElem(html,m)
{
	var objBody = document.getElementsByTagName("body").item(0);
	if(document.getElementById('greInfoElem'))objBody.removeChild(document.getElementById('greInfoElem'));
	if(m!=0 || m==1)
	{
		var div = document.createElement('div');
		div.setAttribute('id','greInfoElem');
		div.innerHTML=html;
		div.className='greInfoElem';
		if(AW.browser.ie || AW.browser.op)AW.setAlpha(div,5);
		objBody.appendChild(div);
		AW.setAlpha(div,95);
	}
}
var cron_greInfoElemAlpha;
function greInfoElemAlpha(ocp)
{
	if(ocp < 90)
	{
		ocp = ocp + 10;
		AW.setAlpha('greInfoElem',ocp);
		cron_greInfoElemAlpha = setTimeout("greInfoElemAlpha("+ocp+")",1);
	}else if(cron_greInfoElemAlpha)clearTimeout(cron_greInfoElemAlpha);
}

function Point(x,y) {  this.x = x; this.y = y; }
var mLoc = new Point(0,0);
function getMouseLoc(e)
{
  	if(!document.all)  //NS
	{
	    mLoc.x = e.pageX;
	    mLoc.y = e.pageY;
  	}
 	else               //IE
  	{
	    mLoc.x = event.x + document.body.scrollLeft;
	    mLoc.y = event.y + document.body.scrollTop;
	}
	if(document.getElementById('greInfoElem'))
	{
		h=document.getElementById('greInfoElem').offsetHeight;
		document.getElementById('greInfoElem').style.left=mLoc.x + 10 + 'px';
		document.getElementById('greInfoElem').style.top=mLoc.y - h + 'px';
	}
	return true;
}
//NS init:
if(AW.browser.ie)document.onmousemove = getMouseLoc;
else {addEventListener("mousemove", getMouseLoc, false); }
AW.setAlpha = function(oId,opacity)
{
	var elem;
	if(typeof(oId)=="string")
	{	
		if(document.getElementById(oId))elem = document.getElementById(oId);
		else return;
	}
	else if(typeof(oId)=="object")elem = oId;
	if(!elem.style)return;
	
	if(opacity > 1)opacity = opacity / 100;
	elem.style['opacity'] = opacity;
	elem.style['-moz-opacity'] = opacity;
	elem.style['filter'] = 'alpha(opacity='+opacity*100+')';
}