function openPopUp_520x390(href, target)
{
	window.open(href, target, 'width=520, height=390, top=0, toolbar=0, location=0, directories=0, status=1, menuBar=0, scrollBars=1, resizable=0');
	return false;
}

function openPopUp_600x450(href, target)
{
	window.open(href, target, 'width=600, height=450, top=0, toolbar=0, location=0, directories=0, status=1, menuBar=0, scrollBars=1, resizable=0');
	return false;
}

function openPopUp_670x500(href, target)
{
	window.open(href, target, 'width=670, height=500, top=0, toolbar=0, location=0, directories=0, status=1, menuBar=0, scrollBars=1, resizable=0');
	return false;
}

function go(url)
{
	window.location = url;
	
	return false;
}

function blinkIt()
{
	if(!document.all)
		return;
	else
	{
		for(i=0; i<document.all.tags('blink').length; i++)
		{
			s=document.all.tags('blink')[i];
			s.style.visibility=(s.style.visibility=='visible')?'hidden':'visible';
		}
	}
}

function SymError()
{
	return true;
}

function Set_Cookie( name, value, expires, path, domain, secure ) 
{
	var today = new Date();
	today.setTime( today.getTime() );

	if ( expires )
	{
		expires = expires * 1000 * 60 * 60 * 24;
	}
	var expires_date = new Date( today.getTime() + (expires) );

	document.cookie = name + "=" + escape( value ) +
		( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
		( ( path ) ? ";path=" + path : "" ) + 
		( ( domain ) ? ";domain=" + domain : "" ) +
		( ( secure ) ? ";secure" : "" );
}

function Get_Cookie( name )
{
	var start = document.cookie.indexOf( name + "=" );
	var len = start + name.length + 1;
	if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) )
	{
		return null;
	}
	if ( start == -1 )
		return null;
	var end = document.cookie.indexOf( ";", len );
	if ( end == -1 )
		end = document.cookie.length;
	return unescape( document.cookie.substring( len, end ) );
}

function Delete_Cookie( name, path, domain )
{
	if ( Get_Cookie( name ) )
		document.cookie = name + "=" +
			( ( path ) ? ";path=" + path : "") +
			( ( domain ) ? ";domain=" + domain : "" ) +";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

function changeSize(elm, _size, class_name)
{
	document.getElementById(elm).className = class_name + ' ' + class_name + '_' + _size;
	Set_Cookie('text_size', _size, 30, '', '', '');
	//window.location.reload(false);
}

function mostlyPage(type, page)
{
    mostly_type = type;
	var xmlHttpReq = false;
    var self = this;
    var strURL = 'x_mostly.php?type=' + type + '&page=' + page;
    
    if (window.XMLHttpRequest)
    {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject)
    {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    
    self.xmlHttpReq.open('GET', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-javascript; charset=iso-8859-9');
    self.xmlHttpReq.onreadystatechange = function()
    {
        if (self.xmlHttpReq.readyState == 4)
        {
        	mostlyLoad(type, self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send('');
    return false;
}

function mostlyLoad(type, str)
{
	eval(str);
	
	document.getElementById("mostly_items_data_" + type).innerHTML = mostly_items;
	changeMostly(type, 0);
}

function changeMostly(type, idx, link)
{
	eval('elm = mostly_data_' + type);
	
	if(typeof(window['elm']) == "undefined")
		return;

	document.getElementById("mostly_image_" + type).src = './images/news/110x84/' + elm[idx]['image'] + '.jpg';
	document.getElementById("mostly_title_" + type).innerHTML = '<a href="' + link + '">' + elm[idx]['title'] + '</a>';
	document.getElementById("mostly_short_content_" + type).innerHTML = '<a href="' + link + '">' + elm[idx]['short_content'] + '</a>';
}

function goGazette(path, idx)
{
	if(idx == "")
		return false;
	
	window.open(path + "gazete-" + idx + ".htm", "", "");
	return true;
}

function getSWF(_WIDTH, _HEIGHT, _SRC, _ID, _VARS)
{
	document.write('<div style="width: ' + _WIDTH + 'px; height: ' + _HEIGHT + 'px; z-index: ' + _ZINDEX + ';">');
	document.write('<object id="' + _ID + '" width="' + _WIDTH + '" height="' + _HEIGHT + '" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,45,0">');
	document.write('<param name="FlashVars" value="' + _VARS + '">');
	document.write('<param name="movie" value="' + _SRC + '">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="wmode" value="transparent">');
	document.write('<param name="scale" value="1">');
	document.write('<param name="allowScriptAccess" value="always">');
	document.write('<embed name="' + _ID + '" FlashVars="' + _VARS + '" style="z-index: ' + _ZINDEX + ';" src="' + _SRC + '" width="' + _WIDTH + '" height="' + _HEIGHT + '" scale="exactfit" quality="high" wmode="transparent" allowScriptAccess="sameDomain" pluginspage="http://www.adobe.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>');
	document.write('</object>');
	document.write('</div>');
	_ZINDEX += 1;
}

function getFlashMovie(flash)
{
	return (isIE) ? window[flash] : document[flash];
}

function changeTarget(elm)
{
	tmp = elm.getElementsByTagName("a");
	for(i=0; i<tmp.length; i++)
		tmp[i].target = "_blank";
}

function getHeadlineSWF(_WIDTH, _HEIGHT, _SRC, _VARS)
{
	document.write('<div style="width: ' + _WIDTH + 'px; height: ' + _HEIGHT + 'px; z-index: ' + _ZINDEX + ';">');
	document.write('<object width="' + _WIDTH + '" height="' + _HEIGHT + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0">');
	document.write('<param name="movie" value="' + _SRC + '">');
	document.write('<param name="flashvars" value="' + _VARS + '">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="wmode" value="transparent">');
	document.write('<param name="scale" value="1">');
	document.write('<embed style="z-index: ' + _ZINDEX + ';" src="' + _SRC + '" width="' + _WIDTH + '" height="' + _HEIGHT + '" flashvars="' + _VARS + '" scale="exactfit" quality="high" wmode="transparent" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash"></embed>');
	document.write('</object>');
	document.write('</div>');
	_ZINDEX += 1;
}

var prevHeadlinePage = 1;
function headlinePageNext(count)
{
	if(prevHeadlinePage + 1 <= count)
		headlinePage(prevHeadlinePage + 1);
	return false;
}
function headlinePage(page, category, location)
{
    var xmlHttpReq = false;
    var self = this;
    var strURL = 'x_headline_page.php?page=' + page + '&category=' + category + '&location=' + location;
    
    if (window.XMLHttpRequest)
    {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject)
    {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    
    self.xmlHttpReq.open('GET', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-javascript; charset=iso-8859-9');
    self.xmlHttpReq.onreadystatechange = function()
    {
        if (self.xmlHttpReq.readyState == 4)
        {
        	if(prevHeadlinePage != null)
        	{
        		document.getElementById('headline_page_' + prevHeadlinePage).className = "item";
        	}
        	document.getElementById('headline_page_' + page).className = "item active";
        	prevHeadlinePage = page;
        	
            headlinePageLoad(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send('');
    return false;
}
function yazarDegistir(makaleurl, resim, baslik, tarih)
{
	document.getElementById("y_resim").src 					= 'files/author/'+ resim;
	document.getElementById("y_m_link").href 				= makaleurl;
	document.getElementById("y_m_tarih").innerHTML 			= tarih;
	document.getElementById("y_m_baslik").innerHTML 		= "<a href=\""+makaleurl+"\">"+ baslik +"</a>";
	return false;
}




var yazarAsagiSira	= 0;
var yazarYukariSira	= 0;

// Yazar Aşağı Yukarı Kaydırma
function yazarKaydir(yon, yukseklik)
{
	var isimDiv			= document.getElementById('yazar_isimler');
	var orjYukseklik	= isimDiv.offsetHeight;
	var pozisyon		= 0;
	var simdikiPoz		= isimDiv.offsetTop;
	var kalanYukseklik	= 0;
	
	if(yon == 1)
	{
		yazarAsagiSira	+= 1;
		pozisyon		= yazarAsagiSira * yukseklik;
		kalanYukseklik	= orjYukseklik - pozisyon;
		if(kalanYukseklik > 251)
		{
			isimDiv.style.top = "-"+pozisyon+"px";
		}
		else
		{
			yazarAsagiSira	= 0;
		}
	}
	else if(yon == 2)
	{
		yazarYukariSira	+= yukseklik;
		simdikiPoz		= simdikiPoz + yukseklik;
		if(simdikiPoz <= 0)
		{
			isimDiv.style.top = simdikiPoz+"px";
		}
		else
		{
			yazarYukariSira = 0;
		}
		
	}
		
	
}

function jsHataGizle()
{
	return true;	
}
function hidesubs(){document.getElementById("mainmenunews").style.height="5px";}
function showsubs(){hidesubdivs();document.getElementById("mainmenunews").style.height="148px";}
function showsubs2(){document.getElementById("mainmenunews").style.height="148px";}
var closeit = setTimeout('',500);
var showittime = setTimeout('',500);
function hidesubdivs(){
	x=document.getElementById("mainmenunews").getElementsByTagName("div"); 
	for (i=0;i<x.length;i++)
	{
		var theid = x[i].getAttribute("id");
		hideit(theid);
	}
}
function closeitfnc(){
	closeit = setTimeout('hidesubs();',500);
}
function showitfnc(theid){
	hidesubdivs();
	showittime = setTimeout('showsubs2();',500);
	showit(theid);
}
function showit(id){document.getElementById(id).style.display="inline";}
function showhl(id){document.getElementById(id).style.display="block";}
function hideit(id){document.getElementById(id).style.display="none";}
function crawlhide(){
	x=document.getElementById('headlineimg').getElementsByTagName("a"); 
	for (i=0;i<x.length;i++)
	{
		x[i].style.display="none";
	} 
	y=document.getElementById('spotcon').getElementsByTagName("a"); 
	for (i=0;i<y.length;i++)
	{
		y[i].style.display="none";
	} 
	z=document.getElementById('spotcon').getElementsByTagName("span"); 
	for (i=0;i<z.length;i++)
	{
		z[i].style.display="none";
	} 
}
function switchclass (containerID, prefix, elementID) {
	x=document.getElementById(containerID).getElementsByTagName("div"); 
	for (i=0;i<x.length;i++)
	{
		if(x[i].getAttribute("class") == "expandable regular" || x[i].getAttribute("class") == "expandable current"){
			if(x[i].getAttribute("id") != elementID){
				FM.addClass(x[i],"regular");
				FM.removeClass(x[i],"current");
			}else{
				FM.addClass(x[i],"current");
				FM.removeClass(x[i],"regular");
			}
		}
	} 
}
function showimage() {
	document.images.weatherimg.src = 'http://www.dmi.gov.tr/sunum/imgdurumgor-a1-p.aspx?merkez=' + document.getElementById('weatherselect').value + '&renkC=f2f2f2&renkT=000&renkZ=f2f2f2';
}
function textCounter(field, countfield, maxlimit) {
	if (field.value.length > maxlimit)
	field.value = field.value.substring(0, maxlimit);
	else 
	countfield.value = maxlimit - field.value.length;
}
function openup(thehref,thew,theh){
	window.open(thehref,'','width='+ thew +',height='+ theh +',left=0,top=0,scrollbars=yes,location=no,resizable=yes');
}
var strTitle = document.title;
var strURL = location.href;
var strThumb = "";
var strDesc = "";
var strKeyword = "";
var strTwit = strURL;
function GetThis(T, C, U, L){
    var targetUrl = 'http://www.myspace.com/index.cfm?fuseaction=postto&' + 't=' + encodeURIComponent(T)
    + '&c=' + encodeURIComponent(C) + '&u=' + encodeURIComponent(U) + '&l=' + L;
    window.open(targetUrl);
}
function facebook(){
	window.open('http://www.facebook.com/sharer.php?s=100&p[medium]=100&p[title]='+strTitle+'&p[images][0]='+strThumb+'&p[url]='+strURL+'&p[summary]='+strDesc+'','sharer','toolbar=0,status=0,width=626,height=436');
}
function delicious(){
	window.open('http://del.icio.us/post?v=4&noui&jump=close&url='+strURL+'&title='+strTitle+'&notes='+strDesc+'&tags='+strKeyword, 'delicious','toolbar=no,width=700,height=400');
}
function google(){
	window.open('http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk='+strURL+'&title='+strTitle+'&labels='+strKeyword+'&annotation='+strDesc, 'googlebookmark','toolbar=no,width=700,height=500');
}
function twitter(){
	window.open('http://twitter.com/home?status='+strTwit,'sharer','toolbar=0,status=0,width=626,height=436');										  
}
function myspace(){
	GetThis(strTitle, strDesc, strURL, 3);
}
function digg(){
	window.open('http://digg.com/submit?phase=2&url='+document.location.href+'&title='+strTitle, 'digg','scrollbars=yes,toolbar=no,width=760,height=500');
}
function email(){
	window.open('/arkadasina-gonder.php?url='+document.location.href+'&title='+strTitle, 'email','scrollbars=yes,toolbar=no,width=500,height=350');
}

function addBookmark(title,url) 
{
	if (window.sidebar) { 
		window.sidebar.addPanel(title, url,""); 
	} else if( document.all ) {
		window.external.AddFavorite( url, title);
	}
}
if (typeof FM != 'object') {
    FM = new Object();
}
FM.checkForClass = function(element, nameOfClass) {
    if (typeof element == 'string') { element = document.getElementById(element); }

    if (element.className == '') {
        return false;
    } else {
        return new RegExp('\\b' + nameOfClass + '\\b').test(element.className);
    }
}
FM.addClass = function(element, nameOfClass) {
    if (typeof element == 'string') { element = document.getElementById(element); }

    if (!FM.checkForClass(element, nameOfClass)) {
        element.className += (element.className ? ' ' : '') + nameOfClass;
        return true;
    } else {
        return false;
    }
}
FM.removeClass = function(element, nameOfClass) {
    if (typeof element == 'string') { element = document.getElementById(element); }

    if (FM.checkForClass(element, nameOfClass)) {
        element.className = element.className.replace(
            (element.className.indexOf(' ' + nameOfClass) >= 0 ? ' ' + nameOfClass : nameOfClass),
            '');
        return true;
    } else {
        return false;
    }
}
FM.replaceClass = function(element, class1, class2) {
    if (typeof element == 'string') { element = document.getElementById(element); }

    if (FM.checkForClass(element, class1)) {
        FM.removeClass(element, class1);
        FM.addClass(element, class2);
        return true;
    } else {
        return false;
    }
}
FM.toggleClass = function(element, nameOfClass) {
    if (typeof element == 'string') { element = document.getElementById(element); }

    if (FM.checkForClass(element, nameOfClass)) {
        FM.removeClass(element, nameOfClass);
    } else {
        FM.addClass(element, nameOfClass);
    }

    return true;
}
function changeFontSize(container,whatFont){
	document.getElementById(container).style.fontSize=whatFont+"px";
	x=document.getElementById("fontsize").getElementsByTagName("a");
	for (i=0;i<x.length;i++)
	{
		if(x[i].getAttribute("rel") == whatFont){
			FM.addClass(x[i], "current");
		}else{
			FM.removeClass(x[i], "current");
		}
	} 
}
