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=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 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 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, '', '', '');
}
function authorChange(author_id, article_id, _title, _date, gazette, seo_link)
{
	document.all["author_img"].src = 'images/author/' + author_id + "_s.jpg";
	document.all["author_article_title"].innerHTML = '<a href="' + seo_link + '">' + _title + "</a>";
	document.all["author_article_date"].innerHTML = _date;
	document.all["author_article_gazette"].innerHTML = gazette;
}
function authorSelectChanged(authorId)
{
	if(authorId != "")
		window.location = baseURL + authorId;
	return false;
}

function getSWF(swWidth, swHeight, swFile, swWmode, swVar, swName)
{
	nameO = '';
	nameE = '';
	if(swName)
	{
		nameO = ' id="' + swName + '"';
		nameE = ' name="' + swName + '"';
	}
	ext = '';
	str = '<object' + nameO + ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width='+swWidth+'  height='+swHeight+'>';
	str += '<param name="movie" value="'+swFile+'" /> ';
	if(swVar)
	{
		str += '<param name="flashvars" value="'+swVar+'" /> ';
		ext += ' flashvars="'+swVar+'"';
	}
	str += '<param name="quality" value="high" /> ';
	str += '<param name="salign" value="TL" /> ';
	str += '<param name="wmode" value="'+swWmode+'" /> ';
	str += '<param name="scale" value="noscale" /> ';
	str += '<param name="allowscriptaccess" value="always" /> ';
	
	str += '<embed' + nameE + ' allowscriptaccess="always" salign="TL" src='+swFile+' width='+swWidth+' height='+swHeight + ext + ' wmode='+swWmode+' quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" scale="noscale"></embed>';
	str += '</object> ';
	document.write(str);
}
function getFlashMovie( flash )
{
	var ua = navigator.userAgent;
	var MSIEOffset = ua.indexOf("MSIE ");
	
	if(MSIEOffset != -1)
	{
		ver = parseFloat(ua.substring(MSIEOffset + 5, ua.indexOf(";", MSIEOffset)));
		if(ver > 8)
		{
			return document[flash];
		}
		else
		{
			return window[flash];
		}
	}
	
	return document[flash];
}
function changeNewsDetail(idx)
{
	document.getElementById('news_spot').innerHTML = spotArr[idx];

	if(previousItem != -1)
		document.getElementById("news_img_" + previousItem).style.display = 'none';
	document.getElementById("news_img_" + idx).style.display = 'block';
	previousItem = idx;

	getFlashMovie("headlineFlashTitle").sendAUtoFlash(headlineArr[idx]);

	return false;
}
