_ZINDEX = 2000;

function floatingBanner()
{
	// writed by CM Bilisim
	this.x_index = 820;
	this.min_client_width = 900;
	this.top_margin = 2;
	
	this.banner_CSS = "display: none; visibility: visible; width: 156px; position: absolute; top: 2px; z-index: " + _ZINDEX + ";";
	
	this.banner_Code = '';
	
	this._show = _show;
	this._hidden = _hidden;
	this._paint = _paint;
	this._draw = _draw;
	this.swapStatus = swapStatus;
	
	this.show_status = false;
	
	_ZINDEX += 1;
	
	function _show()
	{
		document.getElementById('CM_Float_banner_div').style.visibility = 'visible';
		document.getElementById('CM_Float_banner_div').style.display = 'block';
		this.show_status = true;
		this._paint();
	}

	function _hidden()
	{
		document.getElementById('CM_Float_banner_div').style.visibility = 'hidden';
		this.show_status = false;
	}
	
	function swapStatus()
	{
		if(this.show_status)
			this._hidden()
		else
			this._show();
	}
	function _paint()
	{
		with(document.body)
		{
			if(clientWidth > this.min_client_width)
			{
				if (this.show_status)
				{
					document.getElementById('CM_Float_banner_div').style.left = this.x_index + 'px';
					
					document.getElementById('CM_Float_banner_div').style.top = (scrollTop + this.top_margin) + 'px';
					
					document.getElementById('CM_Float_banner_div').style.display = "block";
				}
			}
			else
			{
				document.getElementById('CM_Float_banner_div').style.display = "none";
			}
		}
	}
	function _draw()
	{
		document.write ('<div id="CM_Float_banner_div" style="' + this.banner_CSS + '">' + this.banner_Code + '</div>');
	}
	
}
function CM_Floating_changeStatus()
{
	elm.swapStatus()
}
function CM_Floating_Event()
{
	elm._paint();
}

function getNormalSWF(_WIDTH, _HEIGHT, _SRC, _WMODE)
{
	if(!_WMODE)
	{
		_WMODE = 'opaque';
	}
	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,45,0">');
	document.write('<param name="movie" value="' + _SRC + '">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="wmode" value="' + _WMODE + '">');
	document.write('<param name="scale" value="1">');
	document.write('<embed style="z-index: ' + _ZINDEX + ';" src="' + _SRC + '" width="' + _WIDTH + '" height="' + _HEIGHT + '" scale="exactfit" quality="high" wmode="' + _WMODE + '" 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;
}

function getRolloverSWF(_WIDTH, _HEIGHT, _ROLL_WIDTH, _ROLL_HEIGHT, _SRC, _ROLL_DIR)
{
	_LEFT = '0px';
	_TOP = '0px';
	switch(_ROLL_DIR)
	{
		case '1':
			_TOP = '-' + (_ROLL_HEIGHT - _HEIGHT) + 'px';
			_LEFT = '0px';
			break;
		case '4':
			_TOP = '0px';
			_LEFT = '-' + (_ROLL_WIDTH - _WIDTH) + 'px';
			break;
	}
	
	document.write('<div style="width: ' + _WIDTH + 'px; height: ' + _HEIGHT + 'px; position: relative; z-index: ' + _ZINDEX + '; top: ' + _TOP + '; left: ' + _LEFT + '">');
	document.write('<object width="' + _ROLL_WIDTH + 'px" height="' + _ROLL_HEIGHT + 'px" style="position: absolute; left: 0px; top: 0px;" 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="movie" value="' + _SRC + '">');
	document.write('<param name="menu" value="false">');
	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="' + _ROLL_WIDTH + '" height="' + _ROLL_HEIGHT + '" scale="exactfit" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash"></embed>');
	document.write('</object>');
	document.write('</div>');
	
	_ZINDEX += 1;
}

function hideFloatingBanner()
{
	var elm = document.getElementById('CM_floatingElm');
	if (typeof(elm) == 'undefined')
		return;
	elm.style.display = "none";
}function authorChange(author_id, author_name, article_id, article_link, _title, _date)
{
    document.getElementById("author_img").src = 'http://www.giresunguncel.com/images_up/' + author_id + "_s";
    document.getElementById("author_article_name").innerHTML = author_name;
    document.getElementById("author_article_title").innerHTML = '<a href="' + article_link + '">' + _title + "</a>";
    document.getElementById("author_article_date").innerHTML = _date;
}
function heightOptimizer()
{
    _height = document.getElementById('base_middle').offsetHeight;
    
    if(_height < document.getElementById('base_right').offsetHeight)
        _height = document.getElementById('base_right').offsetHeight;
    
    _height += 60;
    
    document.getElementById('base').style.height = _height + "px";
    document.getElementById('base_middle').style.height = _height + "px";
    document.getElementById('base_right').style.height = _height + "px";
}
function goGazette(idx)
{
    if(idx == "")
        return false;
    
    window.open("newspaper.php?newspaper=" + idx, "", "");
    return false;
}
function changeLeftTab(index, no)
{
    var xmlHttpReq = false;
    var self = this;
    if (no != 1 && no != 2)
    	return false;
    	
    var strURL = 'x_tab_content.php?index=' + index + '&no=' + no;
    
    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.onreadystatechange = function()
    {
        if (self.xmlHttpReq.readyState == 4)
        {
            document.getElementById('left_tab_' + index).className = 'tab_content tab_content_' + no;
            if (no == 1)
	            cl = 'left';
	        else
	        	cl = 'right';
            document.getElementById('left_tab_' + index + '_' + prevLeftTab[index]).className = cl;
            document.getElementById('left_tab_' + index + '_' + no).className = cl;
            document.getElementById('left_tab_container_' + index).innerHTML = self.xmlHttpReq.responseText;
            prevLeftTab[index] = no;
        }
    }
    self.xmlHttpReq.send('');
    return false;
}
function changeMostlyTab()
{
    var xmlHttpReq = false;
    var self = this;
    var strURL = 'x_mostly.php?type=' + mostlyType + '&page=' + mostlyPage;
    
    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.onreadystatechange = function()
    {
        if (self.xmlHttpReq.readyState == 4)
        {
        	document.getElementById('mostly_tab').className = 'mostly_tab mostly_tab_' + mostlyType;
        	if (mostlyType == 1)
	            cl = 'left';
	        else
	        	cl = 'right';
            document.getElementById('mostly_tab_' + mostlyType).className = cl;
            document.getElementById('mostly_tab_' + (3 - mostlyType) * 1).className = cl;
            document.getElementById('mostly_tab_' + mostlyType).style.color = 'white';
            document.getElementById('mostly_tab_' + (3 - mostlyType) * 1).style.color = 'black';
            if (prevMostlyPage > 1)
                document.getElementById('mostly_page_' + prevMostlyPage).style.color = 'white';
            if (mostlyPage > 1)
                document.getElementById('mostly_page_' + mostlyPage).style.color = 'yellow';
            document.getElementById('mostly_tab_container').innerHTML = self.xmlHttpReq.responseText;
            prevMostlyPage = mostlyPage;
        }
    }
    self.xmlHttpReq.send('');
    return false;
}
function go(href)
{
	window.open(href, '_blank', '');
	return false;
}
function openPopUp_520x390(href, target)
{
	window.open(href, target, 'width=568, height=500, 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 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 getSWF(swWidth, swHeight, swFile, swWmode)
{
	var str = '<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='+swWidth+'  height='+swHeight+'>';
	str += ' <param name="movie" value="'+swFile+'" /> ';
	str += ' <param name="quality" value="high" /> ';
	str += ' <param name="wmode" value="'+swWmode+'" /> ';
	str += ' <embed src='+swFile+' width='+swWidth+' height='+swHeight+' quality="high" pluginspage="http://www .macromedia.com/go/getflashplayer" type="application/x-shoc kwave-flash" wmode="transparent"></embed> ';
	str += ' </object> ';
	document.write(str);
}
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=7,0,19,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;
}
function SymError()
{
	return true;
}
function whichBrowser()
{
	var agt = navigator.userAgent.toLowerCase();
	if (agt.indexOf("opera") != -1)
		return 'Opera';
	if (agt.indexOf("staroffice") != -1)
		return 'Star Office';
	if (agt.indexOf("webtv") != -1) 
		return 'WebTV';
	if (agt.indexOf("beonex") != -1)
		return 'Beonex';
	if (agt.indexOf("chimera") != -1)
		return 'Chimera';
	if (agt.indexOf("netpositive") != -1)
		return 'NetPositive';
	if (agt.indexOf("phoenix") != -1)
		return 'Phoenix';
	if (agt.indexOf("firefox") != -1)
		return 'Firefox';
	if (agt.indexOf("safari") != -1)
		return 'Safari';
	if (agt.indexOf("skipstone") != -1)
		return 'SkipStone';
	if (agt.indexOf("msie") != -1)
		return 'MSIE';
	if (agt.indexOf("netscape") != -1)
		return 'Netscape';
	if (agt.indexOf("mozilla/5.0") != -1)
		return 'Mozilla';
	if (agt.indexOf('\/') != -1)
	{
		if (agt.substr(0,agt.indexOf('\/')) != 'mozilla') 
		{
			return navigator.userAgent.substr(0,agt.indexOf('\/'));
		}
		else
			return 'Netscape';
	}
	else if (agt.indexOf(' ') != -1)
		return navigator.userAgent.substr(0,agt.indexOf(' '));
	else
		return navigator.userAgent;
}
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 changeTarget(elm)
{
	tmp = elm.getElementsByTagName("a");
	for(i=0; i<tmp.length; i++)
		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, '', '', '');
}
/* Box News Paging */
var prevBoxNewsPage = 1;
function boxNewsPage(page, category, location)
{
    var xmlHttpReq = false;
    var self = this;
    var strURL = 'x_box_news_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=utf-8');
    self.xmlHttpReq.onreadystatechange = function()
    {
        if (self.xmlHttpReq.readyState == 4)
        {
        	if(prevBoxNewsPage != null)
        	{
        		document.getElementById('box_news_page_' + prevBoxNewsPage).className = "item";
        	}
        	document.getElementById('box_news_page_' + page).className = "item active";
        	prevBoxNewsPage = page;
        	document.getElementById("index_box_news").innerHTML = self.xmlHttpReq.responseText;
        	window.location = '#index_box_news_start';
        }
    }
    self.xmlHttpReq.send('');
    return false;
}
function getFixture(league_id, week)
{
	var xmlHttpReq = false;
    var self = this;
    
    if (week > 34)
    	week = 1;
    else if (week < 1)
    	week = 34;
    	
	var strURL  = 'x_fixture.php?league_id=' + league_id + '&week=' + week;

	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-www-form-urlencoded; charset=UTF-8');
    self.xmlHttpReq.onreadystatechange = function()
    {
        if (self.xmlHttpReq.readyState == 4)
        {
        	document.getElementById('div_fixture').innerHTML = self.xmlHttpReq.responseText;
        }
    }
    self.xmlHttpReq.send('');
    return false;
}
var prevVideoID = 0;
var video_titleList = Array();
var video_spotList = Array();
var video_seoList = Array();
var video_imageList = Array();
function changeVideo(id)
{
	document.getElementById('video_title').innerHTML = video_titleList[id];
	document.getElementById('video_spot').innerHTML = video_spotList[id];
	document.getElementById('video_link').href = video_seoList[id];
	document.getElementById('video_image_b').src = 'http://www.giresunguncel.com/images_up/' + video_imageList[id] + '';
	if (prevVideoID)
		document.getElementById('video_image_' + prevVideoID).className = 'image';
	document.getElementById('video_image_' + id).className = 'image_act';
	prevVideoID = id;
}
function voteComment(type, id, rating)
{
	var xmlHttpReq = false;
    var self = this;

	var strURL  = 'x_comment_rating.php?type=' + type + '&id=' + id + '&rating=' + rating;

	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.onreadystatechange = function()
    {
        if (self.xmlHttpReq.readyState == 4)
        {
        	alert(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send('');
    return false;
}function HD_changeItem(opcode)
{
	eval('elm = news_data');
	
	if(typeof(window['elm']) == "undefined")
		return;
	
	HD_clearTimeout();
	
	HD_curIndex += opcode;
	
	if(HD_curIndex >= elm.length)
		HD_curIndex = 0;
	else if (HD_curIndex < 0)
		HD_curIndex = elm.length - 1;
	
	
	imageElement.src = "http://www.giresunguncel.com/images_up/" + elm[HD_curIndex]['image'] + "";
	
	linkElement.href = "news_detail.php?id=" + elm[HD_curIndex]['id'];
	if(elm[HD_curIndex]['is_linked'])
	{
		linkElement.target = "_blank";
	}
	
	titleElement.innerHTML = elm[HD_curIndex]['title'];
	
	shortContentElement.innerHTML = elm[HD_curIndex]['short_content'];
	
	dateElement.innerHTML = elm[HD_curIndex]['category'] + ' - ' + elm[HD_curIndex]['date'];
	
	if (elm[HD_curIndex]['comment'] > 0)
	{
		commentElement.style.display = 'block';
		commentElement.innerHTML = elm[HD_curIndex]['comment'];
	}
	else
		commentElement.style.display = 'none';
		
	if (elm[HD_curIndex]['news_type'] > 0)
	{
		newsTypeElement.style.display = 'block';
		newsTypeElement.src = 'http://www.giresunguncel.com/images_up/' + elm[HD_curIndex]['news_type'] + '.png';
	}
	else
		newsTypeElement.style.display = 'none';
	
	document.getElementById("headline_item_" + HD_curIndex).className = "item active";
	document.getElementById("HD_arrow").style.top = (57 + (HD_curIndex * 30)) + "px";
	
	if(HD_prevItem != -1)
	{
		document.getElementById("headline_item_" + HD_prevItem).className = "item";
	}
	
	
	HD_prevItem = HD_curIndex;
	
	if(HD_isChangeable)
	{
		//HD_timeoutIndex = setTimeout(timeoutFunction, 8000);
	}
}

function HD_clearTimeout()
{
	if(HD_timeoutIndex != "")
	{
		clearTimeout(HD_timeoutIndex);
		HD_timeoutIndex = "";
	}
}

function HD_jumpTo(idx)
{
	if(idx == HD_prevItem)
		return;
	
	HD_isChangeable = 0;
	HD_clearTimeout();
	HD_changeItem(idx - HD_prevItem);
}

function HD_forwClick()
{
	HD_isChangeable = 1;
	
	timeoutFunction = "HD_changeItem(1)";
	
	if(HD_curIndex == -1)
	{
		HD_changeItem(1);
		return;
	}
	
	HD_clearTimeout();
	
	//HD_timeoutIndex = setTimeout(timeoutFunction, 8000);
}

function HD_backClick()
{
	HD_isChangeable = 1;
	HD_timeoutFunction = "HD_changeItem(-1)";
	HD_changeItem(-1);
}

/* HD Paging */
var prevHeadlinePage = 1;
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=utf-8');
    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 headlinePageLoad(str)
{
	eval(str);

	document.getElementById("headline_items").innerHTML = headlineItems;
	document.getElementById("headline_images").innerHTML = headlineImages;
	
	HD_curIndex = -1;
	HD_prevItem = -1;
	HD_forwClick();
}function HD_pre_changeItem(opcode)
{
	if (navigator.appName != "Netscape" && navigator.appName != "Opera")
	{
		imageElement_pre.style.filter = 'blendTrans(duration = 0)';
		imageElement_pre.filters.blendTrans.Apply();
		imageElement_pre.filters.blendTrans.Play();
		
		titleElement_pre.style.filter = 'blendTrans(duration = 0)';
		titleElement_pre.filters.blendTrans.Apply();
		titleElement_pre.filters.blendTrans.Play();
	}
	
	HD_pre_clearTimeout();

	HD_pre_curIndex += opcode;
	
	if(HD_pre_curIndex >= HD_pre_imageList.length)
		HD_pre_curIndex = 0;
	else if (HD_pre_curIndex < 0)
		HD_pre_curIndex = HD_pre_imageList.length - 1;
	
	imageElement_pre.src = "http://www.giresunguncel.com/images_up/" + HD_pre_imageList[HD_pre_curIndex] + "";
	linkElement_pre.href = HD_pre_seoList[HD_pre_curIndex];
	
	if (HD_pre_headlineList[HD_pre_curIndex])
	{
		titleElement_pre.style.display = 'block';
		spotElement_pre.style.display = 'block';
		transparentElement_pre.style.display = 'block';
		titleElement_pre.innerHTML = HD_pre_headlineList[HD_pre_curIndex];
		spotElement_pre.innerHTML = HD_pre_spotList[HD_pre_curIndex];
	}
	else
	{
		titleElement_pre.style.display = 'none';
		spotElement_pre.style.display = 'none';
		transparentElement_pre.style.display = 'none';
	}

	document.getElementById("news_arrow_pre_1").style.top = (0 + (HD_pre_curIndex * 24)) + "px";
	//document.getElementById("news_arrow_pre_2").style.left = (6 + (HD_pre_curIndex * 56)) + "px";
	
	if (HD_pre_prevItem > -1)
	{
		document.getElementById("pre_item_title_" + HD_pre_prevItem).className = 'item';
		//document.getElementById("pre_news_type_" + HD_pre_prevItem).style.display = 'none';
	}
	
	document.getElementById("pre_item_title_" + HD_pre_curIndex).className = 'item active';
	//document.getElementById("pre_news_type_" + HD_pre_curIndex).style.display = 'block';
	
	
	HD_pre_prevItem = HD_pre_curIndex;
	
	if(HD_pre_isChangeable)
		HD_pre_timeoutIndex = setTimeout(HD_pre_timeoutFunction, 8000);
}

function HD_pre_clearTimeout()
{
	if(HD_pre_timeoutIndex != "")
	{
		clearTimeout(HD_pre_timeoutIndex);
		HD_pre_timeoutIndex = "";
	}
}

function HD_pre_jumpTo(idx)
{
	if(idx == HD_pre_prevItem)
		return;
	HD_pre_isChangeable = 0;
	HD_pre_clearTimeout();
	HD_pre_changeItem(idx - HD_pre_prevItem);
}

function HD_pre_forwClick()
{
	HD_pre_isChangeable = 1;
	
	timeoutFunction = "HD_pre_changeItem(1)";
	
	if(HD_pre_curIndex == -1)
	{
		HD_pre_changeItem(1);
		return;
	}
	
	HD_pre_clearTimeout();
	
	HD_pre_timeoutIndex = setTimeout(timeoutFunction, 8000);
}

function HD_pre_backClick()
{
	HD_pre_isChangeable = 1;
	HD_pre_timeoutFunction = "HD_pre_changeItem(-1)";
	HD_pre_changeItem(-1);
}

prevPHeadlinePage = 1;
function preHeadlinePage( page )
{
	var xmlHttpReq = false;
	var self = this;
	var strURL = 'x_pre_headline_page.php?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 )
		{
			if ( prevPHeadlinePage != null )
			{
				document.getElementById('preheadline_page_' + prevPHeadlinePage).className = "";
			}
			document.getElementById('preheadline_page_' + page).className = "active";
			prevPHeadlinePage = page;

			preHeadlinePageLoad(self.xmlHttpReq.responseText);
		}
	}
	self.xmlHttpReq.send('');
	return false;
}

function preHeadlinePageLoad( str )
{
	eval(str);

	document.getElementById("pre_headline_items").innerHTML = preHeadlineItems;
	document.getElementById("pre_headline_images").innerHTML = preHeadlineImages;
	
	HD_pre_jumpTo(0);
}function HD_sport_changeItem(opcode)
{
	if (navigator.appName != "Netscape" && navigator.appName != "Opera")
	{
		imageElement_sport.style.filter = 'blendTrans(duration = 0)';
		imageElement_sport.filters.blendTrans.Apply();
		imageElement_sport.filters.blendTrans.Play();
		
		titleElement_sport.style.filter = 'blendTrans(duration = 0)';
		titleElement_sport.filters.blendTrans.Apply();
		titleElement_sport.filters.blendTrans.Play();
	}
	
	HD_sport_clearTimeout();

	HD_sport_curIndex += opcode;
	
	if(HD_sport_curIndex >= HD_sport_imageList.length)
		HD_sport_curIndex = 0;
	else if (HD_sport_curIndex < 0)
		HD_sport_curIndex = HD_sport_imageList.length - 1;
	
	imageElement_sport.src = "http://www.giresunguncel.com/images_up/" + HD_sport_imageList[HD_sport_curIndex] + "";
	linkElement_sport.href = HD_sport_seoList[HD_sport_curIndex];
	
	categoryElement_sport.innerHTML = HD_sport_categoryList[HD_sport_curIndex];
	categoryElement_sport.href = HD_sport_catLinkList[HD_sport_curIndex];
	titleElement_sport.innerHTML = HD_sport_titleList[HD_sport_curIndex];
	spotElement_sport.innerHTML = HD_sport_spotList[HD_sport_curIndex];
	commentElement_sport.innerHTML = HD_sport_commentList[HD_sport_curIndex];
	
	document.getElementById("news_arrow_sport").style.backgroundPosition = (HD_sport_curIndex * 32 ) + "px 0px";
	
	
	HD_sport_prevItem = HD_sport_curIndex;
	
	if(HD_sport_isChangeable)
		HD_sport_timeoutIndex = setTimeout(HD_sport_timeoutFunction, 8000);
}

function HD_sport_clearTimeout()
{
	if(HD_sport_timeoutIndex != "")
	{
		clearTimeout(HD_sport_timeoutIndex);
		HD_sport_timeoutIndex = "";
	}
}

function HD_sport_jumpTo(idx)
{
	if(idx == HD_sport_prevItem)
		return;
	HD_sport_isChangeable = 0;
	HD_sport_clearTimeout();
	HD_sport_changeItem(idx - HD_sport_prevItem);
}

function HD_sport_forwClick()
{
	HD_sport_isChangeable = 1;
	
	timeoutFunction = "HD_sport_changeItem(1)";
	
	if(HD_sport_curIndex == -1)
	{
		HD_sport_changeItem(1);
		return;
	}
	
	HD_sport_clearTimeout();
	
	HD_sport_timeoutIndex = setTimeout(timeoutFunction, 8000);
}

function HD_sport_backClick()
{
	HD_sport_isChangeable = 1;
	HD_sport_timeoutFunction = "HD_sport_changeItem(-1)";
	HD_sport_changeItem(-1);
}v_width = 290;
v_height = 26;
v_paddingTop = 0;
v_paddingLeft = 4;
v_timeout = 2500;
v_slideSpeed = 30;
v_slideDirection = 0;
v_pauseOnMouseOver = true;
v_slideStep = 4;
v_textAlign = 'left';
v_textVAlign = 'middle';

v_ua = navigator.userAgent;
v_nS4 = document.layers ? 1 : 0;
v_iE = document.all && !window.innerWidth && v_ua.indexOf("MSIE") !=  - 1 ? 1 : 0;
v_oP = v_ua.indexOf("Opera") !=  - 1 && document.clear ? 1 : 0;
v_oP7 = v_oP && document.appendChild ? 1 : 0;
v_oP4 = v_ua.indexOf("Opera") !=  - 1 && !document.clear;
v_kN = v_ua.indexOf("Konqueror") !=  - 1 && parseFloat(v_ua.substring(v_ua.indexOf("Konqueror/") + 10)) < 3.1 ? 1 : 0;
v_cur = 1;
v_cl = 0;
v_d = v_slideDirection ?  - 1: 1;
v_TIM = 0;
v_canPause = 0;

function v_getOS(a)
{
	return v_iE ? document.all[a].style: v_nS4 ? document.layers["v_container"].document.layers[a]: document.getElementById(a).style
}
function v_start()
{
	var o, px;
	o = v_getOS("v_1");
	px = v_oP && !v_oP7 || v_nS4 ? 0 : "px";
	if (parseInt(o.top) == v_paddingTop)
	{
		v_canPause = 1;
		if (v_count > 1)
			v_TIM = setTimeout("v_canPause=0;v_slide()", v_timeout);
		return 
	}
	o.top = (parseInt(o.top) - v_slideStep * v_d) * v_d > v_paddingTop * v_d ? parseInt(o.top) - v_slideStep * v_d + px: v_paddingTop + px;
	if (v_oP && o.visibility.toLowerCase() != "visible")
		o.visibility = "visible";
	setTimeout("v_start()", v_slideSpeed)
}

function v_slide()
{
	var o, o2, px;
	o = v_getOS("v_" + v_cur);
	o2 = v_getOS("v_" + (v_cur < v_count ? v_cur + 1: 1));
	px = v_oP && !v_oP7 || v_nS4 ? 0 : "px";
	if (parseInt(o2.top) == v_paddingTop)
	{
		if (v_oP)
			o.visibility = "hidden";
		o.top = v_height * v_d + px;
		v_cur = v_cur < v_count ? v_cur + 1: 1;
		v_canPause = 1;
		v_TIM = setTimeout("v_canPause=0;v_slide()", v_timeout);
		return ;
	}
	if (v_oP && o2.visibility.toLowerCase() != "visible")
		o2.visibility = "visible";
	if ((parseInt(o2.top) - v_slideStep * v_d) * v_d > v_paddingTop * v_d)
	{
		o.top = parseInt(o.top) - v_slideStep * v_d + px;
		o2.top = parseInt(o2.top) - v_slideStep * v_d + px
	}
	else
	{
		o.top =  - v_height * v_d + px;
		o2.top = v_paddingTop + px
	}
	setTimeout("v_slide()", v_slideSpeed)
}
function v_init()
{
	v_count = v_content.length;
	if (v_nS4 || v_iE || v_oP || document.getElementById && !v_kN && !v_oP4)
	{
		v_temp = "<div class='v_container' " + (v_nS4 ? "name" : "id") + "=v_container>" + (v_iE ? "<div style='position:absolute;top:0px;left:0px;width:100%;height:100%;clip:rect(0," + v_width + "," + v_height + ",0)'>": "");
		for (v_i = 0; v_i < v_count; v_i++)
			v_temp += "<div " + (v_nS4 ? "name" : "id") + "=v_" + (v_i + 1) + " style='position:absolute;top:" + (v_height * v_d) + "px;left:" + v_paddingLeft + "px;width:" + (v_width - v_paddingLeft * 2) + "px;height:" + (v_height - v_paddingTop * 2) + "px;clip:rect(0," + (v_width - v_paddingLeft * 2) + "," + (v_height - v_paddingTop * 2) + ",0);overflow:hidden" + (v_oP ? ";visibility:hidden" : "") + ";text-align:" + v_textAlign + "' class=vnewsticker>" + (!v_nS4 ? "<table width=" + (v_width - v_paddingLeft * 2) + " height=" + (v_height - v_paddingTop * 2) + " cellpadding=0 cellspacing=0 border=0><tr><td width=" + (v_width - v_paddingLeft * 2) + " height=" + (v_height - v_paddingTop * 2) + " align=" + v_textAlign + " valign=" + v_textVAlign + " class=vnewsticker>": "") + (v_content[v_i][0] != "" ? "<a href='" + v_content[v_i][0] + "' class=vnewsticker" + (v_pauseOnMouseOver ? " onmouseover='if(v_canPause&&v_count>1){clearTimeout(v_TIM);v_cl=1};window.status=\"\";return true' onmouseout='if(v_canPause&&v_count>1&&v_cl)v_TIM=setTimeout(\"v_canPause=0;v_slide();v_cl=0\"," + v_timeout + ")' onmouseover='if(v_canPause&&v_count>1){clearTimeout(v_TIM);v_cl=1};window.status=\"" + v_content[v_i][1] + "\";return true'": "") + ">": "<span" + (v_pauseOnMouseOver ? " onmouseover='if(v_canPause&&v_count>1){clearTimeout(v_TIM);v_cl=1}' onmouseout='if(v_canPause&&v_count>1&&v_cl)v_TIM=setTimeout(\"v_canPause=0;v_slide();v_cl=0\"," + v_timeout + ")'": "") + "><span class=time>") + v_content[v_i][1] + "</span> - <b>" + v_content[v_i][2] + '</b>' + (v_content[v_i][0] != "" ? "</a>" : "</span>") + (!v_nS4 ? "</td></tr></table>" : "") + "</div>";
		v_temp += (v_iE ? "</div>" : "") + "</div>";
		document.write(v_temp);
		setTimeout("v_start()", 1000);
		if (v_nS4)
		onresize = function()
		{
			location.reload()
		}
	}
}
