function openPopUp_520x390(href, target)
{
	window.open(baseURL + 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(baseURL + 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 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 deleteConfirm()
{
	var restart = confirm("Bu Kayıtı Silmek İstediğinizden Emin misiniz?");
	if(restart)
		return true;
	else
		return false;
}
function onlyNumber()
{
	if (event.keyCode < 48 || event.keyCode> 57) event.returnValue = false;
}
function changeNewsDetail(idx)
{
	if(previousItem != -1)
	{
		document.getElementById("news_headline_" + previousItem).style.display = 'none';
	}
	document.getElementById("news_headline_" + idx).style.display = 'block';
	
	document.getElementById("news_image").src = './images/news/' + imageArr[idx] + '.jpg';
	document.getElementById("news_spot").innerHTML = "<a href=\"" + seoLinkArr[idx] + "\">" + spotArr[idx] + "</a>";
	document.getElementById("news_link").href = seoLinkArr[idx];
	
	previousItem = idx;
	return false;
}
function getFlashMovie(flash) {
	return (isIE) ? window[flash] : document[flash];
}
function changeNewsDetailFlash(idx)
{
	document.getElementById("news_image").src = './images/news/' + imageArr[idx] + '.jpg';
	document.getElementById("news_spot").innerHTML = "<a href=\"" + linkArr[idx] + "\">" + spotArr[idx] + "</a>";
	document.getElementById("news_link").href = linkArr[idx];
	getFlashMovie("headlineFlashTitle").sendAUtoFlash(titleArr[idx]);
	return false;
}
function changeSize(elm, _size, class_name)
{
	document.getElementById(elm).className = class_name + ' ' + class_name + '_' + _size;
	Set_Cookie('text_size', _size, 30, '', '', '');
}
function authorChange(author_type, author_id, author_name, article_id, article_link, _title, _spot)
{
	document.getElementById("author_img_" + author_type).src = './images/author/' + author_id + "_s.jpg";
	document.getElementById("author_article_name_" + author_type).innerHTML = '<a href="' + article_link + '">' + author_name + "</a>";
	document.getElementById("author_article_title_" + author_type).innerHTML = '<a href="' + article_link + '">' + _title + "</a>";
}
function authorSelectChanged(authorId)
{
	if(authorId != "")
		window.location = "author_article_detail.php?authorId=" + authorId;
	return false;
}
function heightOptimizer()
{
	var tmp = window.location.href;
	var page = 0;
	
	if(tmp.indexOf("php") == -1 && tmp.indexOf("htm") == -1)
		page = 1;
	else if(tmp == '')
		page = 1;
	else
		page = 0;
	
	if(page)
		_h = -140;
	else
		_h = 0;

	var _height = document.getElementById('base_middle').offsetHeight;
	
	if(_height < document.getElementById('base_left').offsetHeight + _h)
		_height = document.getElementById('base_left').offsetHeight + _h;
		
	if(_height < document.getElementById('base_right').offsetHeight)
		_height = document.getElementById('base_right').offsetHeight;
	
	document.getElementById('base').style.height = (_height - _h) + "px";
	document.getElementById('base_right').style.height = (_height) + "px";
	document.getElementById('base_middle').style.height = (_height) + "px";
	document.getElementById('base_left').style.height = (_height - _h) + "px";
}

function mostlyPage(type, page)
{
    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=UTF-8');
    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_" + type).innerHTML = mostly_items;
	changeMostly(type, 0);
}

function changeMostly(type, idx, seo_link, seo_title)
{	
	eval('elm = mostly_data_' + type);
	
	if(typeof(window['elm']) == "undefined")
		return;
	
	document.getElementById("mostly_image_" + type).src = './images/news/101x76/' + elm[idx]['image'] + '.jpg';
	document.getElementById("mostly_title_" + type).innerHTML = '<a href="' + seo_link + '">' + elm[idx]['title'] + '</a>';
	document.getElementById("mostly_short_content_" + type).innerHTML = "<a href=\"" + seo_link + "\">" + elm[idx]['short_content'] + "</a>";
	//document.getElementById("mostly_link_" + type).href = seo_link;
}
function goGazette(idx)
{
	if(idx == "")
		return false;
	
	window.open("gazeteler.asp?g=" + idx, "", "");
	return true;
}
function goRadio(href, target)
{
	window.open(baseURL + 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 goTV(href, target)
{
	window.open(baseURL + 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 playVideo(strURL)
{
	document.write('<object id="objVideo" width="320" height="285" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">');
	document.write('<param name="FileName" value="' + strURL + '">');
	document.write('<param name="AutoStart" value="1">');
	document.write('<param name="AutoSize" value="0">');
	document.write('<param name="Volume" value="-200">');
	document.write('<param name="ShowControls" value="1">');
	document.write('<param name="ShowDisplay" value="0">');
	document.write('<param name="ShowStatusBar" value="0">');
	document.write('<param name="ShowGotoBar" value="0">');
	document.write('<param name="ShowTracker" value="1">');
	document.write('<param name="ShowPositionControls" value="0">');
	document.write('<param name="EnablePositionControls" value="0">');
	document.write('<param name="EnableContextMenu" value="0">');
	document.write('<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/download/default.asp" filename="' + strURL + '" name="TVLivePlay" AutoStart="1" AutoSize="0" Volume="-200" ShowControls="1" ShowDisplay="0" ShowStatusBar="0" ShowGotoBar="0" ShowTracker="0" ShowPositionControls="0" EnablePositionControls="1" EnableContextMenu="1" width="320" height="285"></embed>');
	document.write('</object>');
}