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=800, height=600, 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 heightOptimizer()
{
	window.onresize = heightOptimizer;
	
	/*var tmp = window.location.href;
	var page;

	if(tmp.indexOf("php") == -1 && tmp.indexOf("html") == -1)
		page = 1;
	else if(tmp.indexOf("index.php") != -1)
		page = 1;
	else
		page = 0;

	if(page)
		_h = -265;
	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;

	document.getElementById('base').style.height = (_height - _h) + "px";
	document.getElementById('base_middle').style.height = _height + "px";
	document.getElementById('base_left').style.height = (_height - _h) + "px";
}
function goGazette(idx)
{
	if(idx == "")
		return false;
	
	window.open("newspaper.php?newspaper=" + idx, "", "");
	return true;
}
function changeTarget(elm)
{
	tmp = elm.getElementsByTagName("a");
	for(i=0; i<tmp.length; i++)
	{
		if(tmp[i].href.indexOf(baseURL) == -1 || tmp[i].href.indexOf('http://') == -1)
			tmp[i].target = "_blank";
	}
}
function changeSize(elm, _size, class_name)
{
	document.getElementById(elm).className = class_name + ' ' + class_name + '_' + _size;
	Set_Cookie('text_size', _size, 30, '', '', '');
}
function clearItems(elm)
{
	tmp = elm.getElementsByTagName("table");
	for(i=0; i<tmp.length; i++)
	{
		document.getElementById('advert').style.display = 'none';
		break;
	}
}
function deleteConfirm()
{
	var restart = confirm("Bu Kayıtı Silmek İstediğinizden Emin misiniz?");
	if(restart)
		return true;
	else
		return 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=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_data").innerHTML = mostly_items;
	changeMostly(type, 0);
}
function changeMostly(type, idx)
{
	eval('elm = mostly_data_' + type);
	
	if(typeof(window['elm']) == "undefined")
		return;

	document.getElementById("mostly_image_1").src = './images/news/110x84/' + elm[idx]['image'] + '.jpg';
	document.getElementById("mostly_title_1").innerHTML = '<a href="news_detail.php?id=' + idx + '">' + elm[idx]['title'] + '</a>';
	document.getElementById("mostly_short_content_1").innerHTML = "<a href=\"news_detail.php?id=" + idx + "\">" + elm[idx]['short_content'] + "</a>";
}

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=\"news_detail.php?id=" + idArr[idx] + "\">" + spotArr[idx] + "</a>";
	document.getElementById("news_link").href = "news_detail.php?id=" + idArr[idx];
	
	previousItem = idx;
	return false;
}
function changeMiddleNews(type, id, title, image)
{
	document.getElementById("middle_news_image" + type).src = './images/news/' + image + '.jpg';
	document.getElementById("middle_news_title" + type).innerHTML = "<a href=news_detail.php?id=" + id + ">" + title + "</a>";
	document.getElementById("middle_news_link" + type).href = "news_detail.php?id=" + id;
	
	return false;
}
function getFlashMovie(flash) {
	return (isIE) ? window[flash] : document[flash];
}
function changeNewsDetailFlash(idx)
{
	var holder = document.getElementById('holder').value;

	document.getElementById("news_headline_" + idx).style.background= "url('images/headline_nav_bck_red.png') no-repeat right bottom";
	document.getElementById("news_headline_" + idx).style.color = '#FFFFFF';
	if(holder != idx)
	{
		document.getElementById("news_headline_" + holder).style.color = '#000';
		document.getElementById("news_headline_" + holder).style.backgroundImage = "";
		document.getElementById('holder').value = idx;
	}

	document.getElementById("news_image").src = './images/news/' + imageArr2[idx] + '.jpg';
	document.getElementById("news_spot").innerHTML = "<a href=\"" + linkArr2[idx] + "\">" + spotArr2[idx] + "</a>";
	document.getElementById("news_link").href = linkArr2[idx];
	getFlashMovie("headlineFlashTitle").sendAUtoFlash(titleArr2[idx]);
	return false;
}
function changeNewsDetailFlash_2(idx)
{
	document.getElementById("news_image_2").src = './images/news/' + imageArr3[idx] + '.jpg';
	document.getElementById("news_spot_2").innerHTML = "<a href=\"" + linkArr3[idx] + "\">" + spotArr3[idx] + "</a>";
	document.getElementById("news_link_2").href = linkArr3[idx];
	getFlashMovie("headlineFlashTitle_2").sendAUtoFlash(titleArr3[idx]);
	return false;
}
function authorChange(type, author_id, article_id, _title)
{
	document.getElementById("author_img_" + type).src = 'images/author/' + author_id + "_s.jpg";
	document.getElementById("author_article_title_" + type).innerHTML = '<a href="' + article_id + '">' + _title + "</a>";
}

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=7,0,19,0">');
	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">');
	flashvars = '';
	if(_VARS)
	{
		document.write('<param name="flashvars" value="' + _VARS + '">');
		flashvars = ' flashvars="' + _VARS + '"';
	}
	document.write('<embed name="' + _ID + '" style="z-index: ' + _ZINDEX + ';" src="' + _SRC + '" width="' + _WIDTH + '" height="' + _HEIGHT + '" scale="exactfit" quality="high" wmode="transparent" ' + flashvars + ' 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;
}