// JavaScript Document
// lutfen kodlarla oynamayin! bir degisiklik calismamasina sebep ola bilir.
if ( typeof(AW) == 'undefined' ) AW = function() {};
if ( typeof(AW.config) == 'undefined' ) AW.config = function() {};
AW.poweredby ='ANADOLUWEB[faiq,aykut]';
AW.get_path = function(x){return this.config.siyt_path + x;}
AW.loadingIMG = new Image();
AW.loadingIMG.src = AW.get_path('images/loading_0.gif');
AW.loadingIMG1 = new Image();
AW.loadingIMG1.src = AW.get_path('images/loading_1.gif');
AW.loadingIMG2 = new Image();
AW.loadingIMG2.src = AW.get_path('images/loading_1.gif');
AW.loadingIMG3 = new Image();
AW.loadingIMG3.src = AW.get_path('images/loading_3.gif');
var blankSrc = AW.get_path('images/blank.gif');

AW.loading = function(oId)
{
	h=document.getElementById(oId).offsetHeight;
	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="'+ AW.loadingIMG3.src +'"><br>Yükleniyor...</td>';
	html += '            </tr>';
	html += '          </table>';
	
	return html;
}

AW.onLoad = new Array();
AW.startOnLoad = function(){for(i=0;i<AW.onLoad.length;i++){eval(AW.onLoad[i]);}}
AW.addOnLoad = function(){var args = AW.addOnLoad.arguments; for(var i=0; i<args.length; i++){AW.onLoad[AW.onLoad.length]=args[i];}}

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();

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+')';
}
AW.setStyle = function(oId,style,value)
{
	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;
	elem.style[style] = value;
}
function redirect(url)
{
 	location.href=url;
}

function ltrim(str)
{
   var whitespace = new String(" \t\n\r");
   var s = new String(str);
   if (whitespace.indexOf(s.charAt(0)) != -1) {
      var j=0, i = s.length;
      while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
         j++;
      s = s.substring(j, i);
   }
   return s;
}

//RTrim(string) : Returns a copy of a string without trailing spaces.
function rtrim(str)
{
   var whitespace = new String(" \t\n\r");
   var s = new String(str);
   if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {
      var i = s.length - 1;       // Get length of string
      while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
         i--;
      s = s.substring(0, i+1);
   }
   return s;
}

// Trim(string) : Returns a copy of a string without leading or trailing spaces
function str_rep_arr(str,str_search,str_rpl)
{
	for(i=0;i<str_search.length;i++)
	{
		while(str.indexOf(str_search[i])!=-1)
		{
	 		str=str.replace(str_search[i],str_rpl[i]);
		}
	}
	return str;
}
function str_rep(str,str_search,str_rpl)
{
	while(str.indexOf(str_search)!=-1)
	{
		str=str.replace(str_search,str_rpl);
	}
    return str;
}
function trim(str)
{
   str=ltrim(str);
   str=rtrim(str);
   while(str.indexOf("  ")!=-1)
	{
	 str=str.replace("  "," ");
	}
   return str;
}

function illegalaz2(chara,at)
{
	durum=true;
	keyStr = MailVars.keyStr + at;
	for (i=0; i < chara.length; i++)
 	{
  		var e = chara.substring(i, i + 1);
		e = e.charCodeAt();
		bulundu=false;
		for (z=0; z < keyStr.length; z++)
		{
			var k = keyStr.substring(z, z + 1);
			k = k.charCodeAt();
			if(k==e){bulundu=true;break;}
		}
  		if(bulundu==false){durum=false;break;}
 	}
	return durum;
}
function onlyNumbers(c)
{
  	s = new String("0123456789");
   	for( j = 0; j<c.length; j++ )
   		if( s.indexOf(c.charAt(j)) == -1  ) 
	  	{
			return true;
      	}
	return false;
}
function cnfrm(x)
{
	return confirm(x);
}

function num_chk( e )
{
	var k;
	k = e.keyCode;
	durum = false
	if(k>=48 && k<58)durum = true 
	return durum
}

function createRequestObject() {
    var ro;
    var browser = navigator.appName;
    if(browser == "Microsoft Internet Explorer"){
        ro = new ActiveXObject("Microsoft.XMLHTTP");
    }else{
        ro = new XMLHttpRequest();
    }
    return ro;
}

AW.decode = function(input,eq){var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var output = "";var chr1, chr2, chr3 = "";var enc1, enc2, enc3, enc4 = "";var i = 0;if(eq!="" && eq>0)for(j=0;j<eq;j++)input+="=";input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");	do {enc1 = keyStr.indexOf(input.charAt(i++));enc2 = keyStr.indexOf(input.charAt(i++));      enc3 = keyStr.indexOf(input.charAt(i++));enc4 = keyStr.indexOf(input.charAt(i++));chr1 = (enc1 << 2) | (enc2 >> 4);chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);chr3 = ((enc3 & 3) << 6) | enc4;output = output + String.fromCharCode(chr1);if (enc3 != 64) {output = output + String.fromCharCode(chr2);}if (enc4 != 64) {output = output + String.fromCharCode(chr3);}chr1 = chr2 = chr3 = "";enc1 = enc2 = enc3 = enc4 = "";} while (i < input.length);return output;}
function randomNumber(limit){
  return Math.floor(Math.random()*limit);
}
AW.createForm = function(formAttr,vars) 
{
	if(document.createElement)
	{
		var defaultForm = {action : '', id : 'jsForm', name : 'jsForm', method : 'POST'};
		var objBody = document.getElementsByTagName("body").item(0);
		if(document.getElementById("jsForm"))document.getElementById("jsForm").parentNode.removeChild(document.getElementById("jsForm"));
		var form = document.createElement("form");
		for(k in defaultForm)form.setAttribute(k,defaultForm[k]);
		for(k in formAttr)form.setAttribute(k,formAttr[k]);
		for(k in vars)
		{
			var input = document.createElement("input");
			input.setAttribute('type','hidden');
			input.setAttribute('name',k);
			input.value = vars[k];
			form.appendChild(input);
			
		}
		var input = document.createElement("input");
		input.setAttribute('type','hidden');
		input.setAttribute('name','post_id');
		input.value = AW.config.pid;
		form.appendChild(input);
		objBody.appendChild(form);
		form.submit();
	}
}
function GetElementByName(xml, start, end) 
{
   	startpos = xml.indexOf(start);
   	if (startpos == -1) return false;
   	startpos = startpos + start.length;
   	endpos =  xml.indexOf(end);
   	tag = xml.substring(startpos, endpos);
  	return trim(tag);
}
function XPathValue(XPath,node)
{
   	list = XPath.split('/');
    for (i=0;i < list.length;i++) 
   	{
    	node = GetElementByName(node, '<'+ list[i] +'>', '</'+ list[i] +'>'); 
   	}
    return node;
}
function getHtml(url,id,inner_html,fnct) 
{
	var http = createRequestObject();
	http.open('get', url);
    http.onreadystatechange = function()
	{
		if(http.readyState == 4)
		{
        	var response = http.responseText;
			insertHtml(id,response,1);
            if(fnct!=null && fnct!="")eval(fnct);
       	}
		else 
		{
			if(inner_html=="" || inner_html==null)inner_html=AW.loading(id);
			else
			{
				inner_html = inner_html.replace('%1','<img align="left" src="'+ AW.loadingIMG1.src +'">');
				inner_html = inner_html.replace('%2','<img align="left" src="'+ AW.loadingIMG2.src +'">');
				inner_html = inner_html.replace('%3','<img align="left" src="'+ AW.loadingIMG3.src +'">');
			}
			insertHtml(id,inner_html,1);
		}
	}
    http.send(null);
}
function insertHtml(oDiv,html,display) 
{
    if(document.getElementById(oDiv))
	{
		document.getElementById(oDiv).innerHTML = html;
		if(display==1)document.getElementById(oDiv).style.display="";
		else document.getElementById(oDiv).style.display="none";
	}
}
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);
		getMouseLoc();
		if(AW.browser.ie || AW.browser.op)greInfoElemAlpha(5);
		else AW.setAlpha(div,100);
	}
}
var cron_greInfoElemAlpha;
function greInfoElemAlpha(ocp)
{
	if(ocp < 90)
	{
		ocp = ocp + 5;
		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); }

function greElemIns(elem,html)
{
	elem = elem.parentNode;
	var div = elem.getElementsByTagName('span');
	elemtr = elem.parentNode;
	if(div[0])
	{
		if(html!="" && html!=null){div[0].innerHTML=html;elemtr.bgColor='#ededed';}
		else {div[0].parentNode.removeChild(div[0]);elemtr.bgColor='#ffffff';}
	}
	else
	{
		if(html!="" && html!=null)
		{
			var ndiv = document.createElement("span");
			AW.setStyle(ndiv,'color','#ff0000');
			ndiv.innerHTML=html;
			elem.appendChild(ndiv);
			elemtr.bgColor='#ededed';
		}
		else elemtr.bgColor='#ffffff';
	}
}
function defaultHomepage(x)
{
	x.style.behavior='url(#default#homepage)';
	x.setHomePage(AW.config.siyt_path);
}
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");
	document.getElementById("news_text").className = "";
	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';
			}
		}
	}
	document.getElementById("news_text").className = "news_text";
} 
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';
		}
	}
}
if(AW.browser.ie)setInterval('blinkIt()',400);
function addComment(mode,id)
{
	url=AW.get_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=AW.get_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=AW.get_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=AW.get_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 isBrowserComplient(x,y)
{
	var appUserAgent = navigator.userAgent.toUpperCase();
	if(appUserAgent.indexOf("FIREFOX")>0)
	{
		if(document.getElementById)
		{
			if(y=='over')
			{
				divs=document.getElementById(x);
				divs.style.visibility='';
			}
			if(y=='out')
			{
				divs=document.getElementById(x);
				divs.style.visibility='Collapse';
			}
		}
	}
}
function printFile(path,width,height)
{
	var ext=path.substring(path.lastIndexOf(".") + 1,path.length);
	var html = '';
	if(ext=="swf")
	{
		if(width==468 && height>60)
		{
			i="i";
			html += '<DIV id="AdID12766" onmouseover="isBrowserComplient(\'AdID22766\',\'over\');" onmouseout="isBrowserComplient(\'AdID22766\',\'out\');">';
			html += '<DIV id="AdID22766" style="position: relative; width: 468px; height: 60px; z-index: +5;visibility:collapse">';
			html += '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"';
			html += ' width="468" height="'+ height +'" style="position: absolute; left: 0; top: 0;">';
			html += '<PARAM name="Movie" value="'+ path +'">';
			html += '<PARAM name="WMode" value="Transparent">';
			html += '<!--['+i+'f !IE]><-->';
			html += '<OBJECT data="'+ path +'"';
			html += 'width="468" height="'+ height +'" type="application/x-shockwave-flash" style="position: absolute; left: 0; top: 0;">';
			html += '<PARAM name="WMode" value="Transparent">';
			html += '<PARAM name="pluginurl" value="http://www.macromedia.com/go/getflashplayer">';
			html += '<\/OBJECT>';
			html += '<!--><![end'+i+'f]-->';
			html += '<\/OBJECT>';
			html += '<\/DIV>';
			html += '<\/DIV>';
		}
		else
		{
			html += '<div style="z-index:111111111;"><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 +'" wmode="transparent"></embed>';
			html += '    </object></div>';
		}
	}
	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(' + AW.config.siyt_path + 'images/loading2.gif);background-repeat:no-repeat;background-position:50% 50%;">';
	}
	return html;
}
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;
	}
}
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 $(oId){return document.getElementById(oId);}
handlePrevButtonState = function(type, args) 
{
		var enabling = args[0];
		var leftImage = args[1];
		if(enabling) {
			leftImage.parentNode.className = leftImage.parentNode.className.replace(' btn_p','');
		} else {
			leftImage.parentNode.className = leftImage.parentNode.className + ' btn_p';	
		}
}

handleNextButtonState = function(type, args) 
{
		var enabling = args[0];
		var rightImage = args[1];

		if(enabling) {
			rightImage.parentNode.className = rightImage.parentNode.className.replace(' btn_p','');
		} else {
			rightImage.parentNode.className = rightImage.parentNode.className + ' btn_p';
		}
}
AW.changePage = function(elem,carousel,pageNum) 
{
	var rows = elem.parentNode.getElementsByTagName('a');
	for ( var i = 0; i < rows.length; i++ ) rows[i].className = "";
	elem.className = "select";
	carousel.scrollTo(pageNum);
}
var cpy = true;
AW.changePageY = function(elem,pageNum) 
{
	if(!cpy)return;
	cpy = false;
	var rows = elem.parentNode.getElementsByTagName('a');
	for ( var i = 0; i < rows.length; i++ )if(rows[i].className=="select")rows[i].className = "yazarMenu";
	
	elem.className = "select";
	yazarc.scrollTo(pageNum);
	cpy = true;
}
function tS(){ x=new Date(); x.setTime(x.getTime()); return x; } 
function lZ(x){ return (x>9)?x:'0'+x; } 
function fixImg(oId) 
{
	var sp = /MSIE ((5\.5)|[6789])/.test(navigator.userAgent) && navigator.platform == "Win32";
	var blankSrc = AW.get_path('images/blank.gif');
	if (sp)
	{
		var element = document.getElementById(oId);
		var src = element.src;
		var ext=src.substring(src.lastIndexOf(".") + 1,src.length);
		if(ext=="png")
		{
			element.src = blankSrc;
			element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='scale')";
		}
	}
}
function fixImage() 
{
	var sp = /MSIE ((5\.5)|[6789])/.test(navigator.userAgent) && navigator.platform == "Win32";
	var tag = document.getElementsByTagName("img");
	var blankSrc = AW.get_path('images/blank.gif');
	if (sp && tag.length>0)
	{
		for(i=0;i<tag.length;i++)
		{
			var element = tag[i];
			var src = element.src;
			var ext=src.substring(src.lastIndexOf(".") + 1,src.length);
			if(ext=="png")
			{
				element.src = blankSrc;
				element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='scale')";
			}
		}
	}
}
function listenKpageLink(page)
{
	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.replace(AW.get_path(''),'');
				var page = x.substring(0,x.lastIndexOf("?"));
				x = x.substring(x.lastIndexOf("?")+1,x.length);
				x = AW.get_path('ajax.php?page='+ page +'&' + x + '&random=' + randomNumber(100000000));
				getHtml(x,'osbjct','','listenKpageLink()');
				return false;
			}
		}
	}
}
