// Strict by root@azeri.net,faiq@anadoluweb.net
// lutfen kodlarla oynamayin! bir degisiklik calismamasina sebep ola bilir.
if ( typeof(AW) == 'undefined' ) AW = {};
if ( typeof(AW.config) == 'undefined' ) AW.config = {};
AW.poweredby ='AFRMEDIA[faiq agayev]';
AW.get_path = function(x){return this.config.aw_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(oDiv)
{
	if(typeof(oDiv)=="string" && $(oDiv))oDiv = $(oDiv);
	else if(typeof(oDiv)=="object"){}
	else return;
	
	h=oDiv.offsetHeight;
	w=oDiv.offsetWidth;
	var html='';
	html += '		<table width="'+ w +'" border="0" cellspacing="0" cellpadding="0">';
	html += '            <tr>';
	html += '              <td height="'+ h +'" width="'+ w +'" 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($(oId))elem = $(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($(oId))elem = $(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;
}
function getAjax(url,id,inner_html,fnct) 
{
	var http = createRequestObject();
	http.open('get', url);
    http.onreadystatechange = function()
	{
		if(http.readyState == 4)
		{
        	var response = http.responseText;
			AW.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 +'">');
			}
			AW.insertHTML(id,inner_html,1);
		}
	}
    http.send(null);
}
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($("jsForm"))$("jsForm").parentNode.removeChild($("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.setAttribute('id',k);
			input.value = vars[k];
			form.appendChild(input);
		}
		var input = document.createElement("input");
		input.setAttribute('type','hidden');
		input.setAttribute('name','post_id');
		input.setAttribute('id','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;
}
AW.insertHTML = function(oDiv,html,display) 
{
 	if(typeof(oDiv)=="string" && $(oDiv)){var oId = $(oDiv);}
	else if(typeof(oDiv)=="object"){var oId = oDiv;}
	else return;
	oId.innerHTML = html;
	if(display==1 && oId.style)oId.style.display="";
	else oId.style.display="none";
}
function greInfoElem(html,m)
{
	var objBody = document.getElementsByTagName("body").item(0);
	if($('greInfoElem'))objBody.removeChild($('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($('greInfoElem'))
	{
		h=$('greInfoElem').offsetHeight;
		$('greInfoElem').style.left=mLoc.x + 10 + 'px';
		$('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.aw_path);
}
var news_text_default = '-1';

function fontSize(elem,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';
			}
		}
	}
	
	var rows = elem.parentNode.getElementsByTagName('A');
	for (var i = 0; i < rows.length; i++) AW.setAlpha(rows[i],100);
	AW.setAlpha(elem,51);
} 
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,uid)
{
	if ( typeof(uid) == 'undefined' ) uid = -1;
	url=AW.get_path('addComment.php?mode=' + mode + '&id=' + id + '&uid=' + uid);
	window.open(url, '_blank', 'width=570, height=360,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=$(x);
				divs.style.visibility='';
			}
			if(y=='out')
			{
				divs=$(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.aw_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;
			var v = c.answer[i].value;
			break; 
		}
	}
	if(durum)
	{
		AW.createForm({action : 'anket?'},{poll_id : c.poll_id.value,answer : v,mode : c.mode.value});
	}
	else 
	{
		alert("Lütfen seçim yapınız!");
		return false;
	}
}
function pollGrafik()
{
	var durum=false;
	for(i=0;i<pollArr.length;i++)
	{
		w=$('sdf' + i).style.width.replace('%','');
		w++;
		z=pollArr[i] + 1;
		if(w<z)
		{
			$('sdf' + i).style.width= w + '%';
			$('sdfl' + i).innerHTML= '%' + w; 
			durum=true;
		}
	}
	if(durum)setTimeout('pollGrafik()', 10);
}
function $(oId)
{
	if(document.getElementById(oId))return document.getElementById(oId);
	else return false;
}
handlePrevButtonState = function(type, args) 
{
		var enabling = args[0];
		var leftImage = args[1];
		if(enabling) {
			leftImage.parentNode.className = 'btn_a';
		} else {
			leftImage.parentNode.className = 'btn_p';	
		}
}

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

		if(enabling) {
			rightImage.parentNode.className = 'btn_a';
		} else {
			rightImage.parentNode.className = 'btn_p';
		}
}
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 = $(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 opCtgryMn(elem,ctgryId,pg)
{
	if ( typeof(pg) == 'undefined' ) pg = '';
	clCtgryMn2();
	var oDiv = 'subCtgryMenu_' + ctgryId;
	var objUL = elem.parentNode.getElementsByTagName("ul")[0];
	
	if(objUL.innerHTML == "")
	{
		objUL.setAttribute('id',oDiv);
		objUL.setAttribute('name',oDiv);
		objUL.onmouseover = function(){ if(clCtgryMnTimer)clearTimeout(clCtgryMnTimer); }
		objUL.onmouseout = function(){ clCtgryMn(); }
		var url = AW.get_path('ajax.php?page=' + pg + 'subCtgry&id=' + ctgryId + '&random=' + randomNumber(100000000));
		getAjax(url,oDiv);	
	}
	objUL.style.visibility = 'visible';
}
var clCtgryMnTimer;
function clCtgryMn()
{
	clCtgryMnTimer = setTimeout('clCtgryMn2()', 1000);
}
function clCtgryMn2()
{
	var rows = $("ctgryMenu").getElementsByTagName("ul");
	for(i=0;i<rows.length;i++)rows[i].style.visibility = 'hidden';
	if(clCtgryMnTimer)clearTimeout(clCtgryMnTimer);
}
AW.cookie = 
{
	set : function(name, value, hours, domain)
	{
		if ( typeof(hours) == 'undefined' ) hours = 48;
		if ( typeof(domain) == 'undefined' ) domain = AW.config.aw_path.substring(AW.config.aw_path.lastIndexOf("http://")+7,AW.config.aw_path.length - 1);
		
		var expire = "";
		if(hours != null)
		{
			expire = new Date((new Date()).getTime() + hours * 3600000);
			expire = "; expires=" + expire.toGMTString();
		}
		//if(domain != null)expire = expire + "; domain=" + domain;
		
		document.cookie = name + "=" + escape(value) + expire;
	},
	get : function(name)
	{
		var cookieValue = "";
		var search = name + "=";
		if(document.cookie.length > 0)
		{ 
			offset = document.cookie.indexOf(search);
			if (offset != -1)
			{ 
				offset += search.length;
				end = document.cookie.indexOf(";", offset);
				if (end == -1) end = document.cookie.length;
				cookieValue = unescape(document.cookie.substring(offset, end))
			}
		}
		return cookieValue;
	},
	del : function(name)
	{
		document.cookie = name + "=; expires=Fri, 31 Dec 1999 23:59:59 GMT;";
		this.set(name,"","0");
	}
}
AW.select = function(main,subs){this.init(main,subs);}
AW.select.prototype = 
{
	init : function(main,subs)
	{
		this.main = main;
		this.sub = subs;
	},
	chng : function(x)
	{
		var vLink = $(this.main.id).getElementsByTagName("A");
		if(vLink.length==0)return;
		if(this.main.clss!='')
		{
			for (var i = 0; i < vLink.length; i++)
			{
				if(vLink[i].className==this.main.clss)vLink[i].className = '';
				else vLink[i].className = vLink[i].className.replace(' ' + this.main.clss,'');
			}
			if(vLink[x].className!='')vLink[x].className = vLink[x].className + ' ' + this.main.clss;
			else vLink[x].className = this.main.clss;
		}
		for(var j=0; j < this.sub.length; j++)
		{
			var vChng = $(this.sub[j]).getElementsByTagName("A");
			for(var k=0; k < vChng.length; k++)vChng[k].style.display = 'none';
			vChng[x].style.display = 'block';
		}
	}
}
AW.tabSelect = function(fname,tab,link){this.init(fname,tab,link);}
AW.tabSelect.prototype = 
{
	init : function(fname,tab,link)
	{
		this.fname = fname;
		this.tab = tab;
		this.link = link;
	},
	select : function(x)
	{
		var vTab = $(this.tab.id).getElementsByTagName(this.tab.tag);
		if(vTab.length==0)return;
		if ( typeof(x) == 'undefined'){var x = AW.cookie.get(this.fname);if ( typeof(x) == 'undefined' || x==null || x=='' || x=="" || onlyNumbers(x) || x>vTab.length)x=0;}
		AW.cookie.set(this.fname,x,360);
		if(this.tab.clss!='')
		{
			for (var i = 0; i < vTab.length; i++)
			{
				if(vTab[i].className==this.tab.clss)vTab[i].className = '';
				else vTab[i].className = vTab[i].className.replace(' ' + this.tab.clss,'');
			}
			if(vTab[x].className!='')vTab[x].className = vTab[x].className + ' ' + this.tab.clss;
			else vTab[x].className = this.tab.clss;
		}
		var vLink = $(this.link.id).getElementsByTagName(this.link.tag);
		for(var j=0; j < vLink.length; j++)vLink[j].style.display = 'none';
		vLink[x].style.display = 'block';
		
	}
}
function getPLinkNews(ctgry_id,sayfa,elem)
{
	elem = elem.parentNode.parentNode;
	var url = AW.get_path('ajax.php?page=subCtgry&sayfa=' + sayfa + '&id=' + ctgry_id + '&random=' + randomNumber(100000000));
	getAjax(url,elem);	
}
function getPageLinkNews(news_id,sayfa,mode)
{
	var url = AW.get_path('ajax.php?page=pageLinkNews&sayfa=' + sayfa + '&news_id=' + news_id + '&mode=' + mode + '&random=' + randomNumber(100000000));
	getAjax(url,'otherTab_' + mode);
}
function getPageLinkArticle(article_id,sayfa,mode)
{
	var url = AW.get_path('ajax.php?page=pageLinkArticle&sayfa=' + sayfa + '&article_id=' + article_id + '&mode=' + mode + '&random=' + randomNumber(100000000));
	getAjax(url,'otherTab_' + mode);
}
function getPageLinkGlry(glry_id,sayfa,mode)
{
	var url = AW.get_path('ajax.php?page=pageLinkGlry&sayfa=' + sayfa + '&glry_id=' + glry_id + '&mode=' + mode + '&random=' + randomNumber(100000000));
	getAjax(url,'otherTab_' + mode);
}
// siteye ozel
function out_MyHspMenu()
{
	if(typeof(kronometre_MyHspMenu) != 'undefined')clearTimeout(kronometre_MyHspMenu);
	kronometre_MyHspMenu=setTimeout("out_MyHspMenu2()",500);
}
function out_MyHspMenu2()
{
	document.getElementById('hsp_mng_div').style.display='none';
	document.getElementById('hsp_mng_a').className='hesap_out';
}
function over_MyHspMenu()
{
	if(typeof(kronometre_MyHspMenu) != 'undefined')clearTimeout(kronometre_MyHspMenu);
	document.getElementById('hsp_mng_div').style.display='block';
	//document.getElementById('hsp_mng_div').style['z-index']=-1;
	document.getElementById('hsp_mng_a').className='hesap_over';
}
function vfTab(x)
{
	if ( typeof(x) == 'undefined'){var x = AW.cookie.get('vfTabDiv');if ( typeof(x) == 'undefined' || x==null || x=='' || x=="" || onlyNumbers(x))x=0;}
	AW.cookie.set('vfTabDiv',x,360);
	var tab = new Array('glry','video');
	var tag = $('vfTabDiv').getElementsByTagName('A');
	for (var i = 0; i < tag.length; i++) tag[i].className = tag[i].className.replace('open','close');
	tag[x].className = tag[x].className.replace('close','open');
	$('videoTabInner').style.display = 'none';
	$('glryTabInner').style.display = 'none';
	$(tab[x] + 'TabInner').style.display = 'block';
}
function markTabRows()
{
		var rows = $("otherTab").getElementsByTagName('li');
		for ( var i = 0; i < rows.length; i++ ) 
		{
			rows[i].onmousedown = function() 
			{
				var rows2 = $("otherTab").getElementsByTagName('li');
				for ( var j = 0; j < rows2.length; j++ )
				{ 
					if(j==0)rows2[j].className="tab first";
					else rows2[j].className="tab";
				}
				if(!this.previousSibling)this.className="tab selected first";
				else this.className="tab selected";
				if(this.nextSibling)this.nextSibling.className="tab after_selected";
				if($("otherTab_new"))$("otherTab_new").style.display = 'none';
				if($("otherTab_topread"))$("otherTab_topread").style.display = 'none';
				if($("otherTab_comment"))$("otherTab_comment").style.display = 'none';
				$("otherTab_" + this.title).style.display = 'block';
			}
		}
		if($("otherTab_new").getElementsByTagName('li')[0])$("otherTab_new").style.display = 'block';
		else
		{
			$("otherTab_inner").style.display = 'none';
			$("otherTab").style.display = 'none';
		}
}
//