function authorChange(type, author_id, article_id, _title, _date, gazette, seo_title, seo_link)
{
	document.getElementById("author_img_" + type).src = '' + author_id
	document.getElementById("author_article_title_" + type).innerHTML = '<a href="' + seo_link + '" title="' + seo_title + '">' + _title + "</a>";
	document.getElementById("author_article_date_" + type).innerHTML = _date;
}
function changeMostlyTab(idx)
{
	if(idx == 1)
	{
	    document.getElementById("yazardiv1").style.display = 'block';
	    document.getElementById("yazardiv2").style.display = 'none';
		document.getElementById("captionust").className = 'captionust caption2';
	}
	else if(idx == 2)
	{
	    document.getElementById("yazardiv1").style.display = 'none';
	    document.getElementById("yazardiv2").style.display = 'block';
	}
}
function heightOptimizer()
{
	var _height = document.getElementById('base_right').offsetHeight;
	
	if(_height < document.getElementById('base_middle').offsetHeight)
		_height = document.getElementById('base_middle').offsetHeight;
	
	document.getElementById('base').style.height = _height + "px";
	document.getElementById('base_middle').style.height = _height + "px";
	document.getElementById('base_right').style.height = _height + "px";
}
function resizeIFrame(idx)
{
	var _height = document.getElementById(idx).contentWindow.document.body.scrollHeight;

	document.getElementById(idx).height = _height;
}

function changeSize(elm, _size, class_name)
{
	document.getElementById(elm).className = class_name + ' ' + class_name + '_' + _size;
	Set_Cookie('text_size', _size, 30, '', '', '');
}

function PopupAc_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 PopupAc_520x590(href, target)
{
	window.open(href, target, 'width=520, height=590, top=0, toolbar=0, location=0, directories=0, status=1, menuBar=0, scrollBars=1, resizable=0');
	return false;
}

function PopupAc_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 PopupAc_620x700(href, target)
{
	window.open(href, target, 'width=620, height=700, top=0, toolbar=0, location=0, directories=0, status=1, menuBar=0, scrollBars=1, resizable=0');
	return false;
}

String.prototype.buyukHarf=function() {
var str = [];
for(var i = 0; i < this.length; i++) {
var ch = this.charCodeAt(i);
var c = this.charAt(i);
if(ch == 105) str.push('Ý');  // Ý
else if(ch == 305) str.push('I'); //I
else if(ch == 287) str.push('Ð'); //Ð
else if(ch == 252) str.push('Ü'); //Ü
else if(ch == 351) str.push('Þ'); //Þ
else if(ch == 246) str.push('Ö'); //Ö
else if(ch == 231) str.push('Ç'); //Ç
else if(ch >= 97 && ch <= 122) str.push(c.toUpperCase());
else str.push(c);
}
return str.join('');
}

function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}

	function burclar(divID) {
		
		for(var i = 0; i < 12; i++) {
			document.getElementById('burcform_'+i).style.display = 'none';
		}
		
		document.getElementById('burcform_'+divID).style.display = 'block';
	}

function yorumkontrol(yv,id)
{
	if (yv==0)
		{
		}else{
			return PopupAc_520x590('yorumlar.asp?id='+id, '');
		}
}


function videogosterhaber(videoid,siraid,wx,hx)
{
$("#video-"+siraid).hide();
$("#videooynatp"+siraid).append("<p><img src='/gif/video-loader.gif' border='0' align='center' /></p>");
$.ajax({type: 'POST',url: '/videogoster.asp?id='+videoid+'&sira='+siraid+'&w='+wx+'&h='+hx,success: function(ajaxvideo) {$("#videooynatp"+siraid).html(ajaxvideo);}});
}
function videogosterd(videoid,siraid,wx,hx)
{
$("#video-"+siraid).append("<p><img src='/gif/video-loader.gif' border='0' align='center' /></p>");
$.ajax({type: 'POST',url: '/videogoster.asp?id='+videoid+'&sira='+siraid+'&w='+wx+'&h='+hx,success: function(ajaxvideo) {$("#video-"+siraid).html(ajaxvideo);}});
}

function anasayfavideogoster(videoid,siraid,wx,hx)
{
$("#video_anasayfa").html("<div class='loadingr'><p><img src='/gif/video-loader.gif' border='0' align='center' /></p><br><span class='bold'>Video Yükleniyor.<br>Lütfen bekleyiniz..</span></div>");
$.ajax({type: 'POST',url: '/videogosteranasayfa.asp?id='+videoid+'&sira='+siraid+'&w='+wx+'&h='+hx,success: function(ajaxvideo) {
$("#video_anasayfa").html(ajaxvideo);
}});
}

function videogosterdx(videoid,siraid,wx,hx)
{
 //document.getElementById('video'+siraid).style.display='none';	
 $("#videooynatp").append("<p><img src='/gif/video-loader.gif' border='0' align='center' /></p>");
$.ajax({type: 'POST',url: '/videogoster.asp?id='+videoid+'&sira='+siraid+'&w='+wx+'&h='+hx,success: function(ajaxvideo) {$('#video'+siraid).html(ajaxvideo);}});
}

	function vac(idx)
	{
		document.getElementById('video1').style.display='none';
		document.getElementById('video2').style.display='none';
		document.getElementById('video3').style.display='none';
		document.getElementById('video'+idx).style.display='';
	}

function isValidEmailAddress(emailAddress) {
		var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
		return pattern.test(emailAddress);
}

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-shoc kwave-flash" scale="noscale"></embed> ';
	str += '</object> ';
	document.write(str);
}


function GetDateDifference(startDate, endDate) {
    var retArray = new Array();
    if (endDate == null) {
        var cuDate = new Date();
        endDate = (cuDate.getMonth() + 1) + "/" + cuDate.getDate() + "/" + cuDate.getFullYear();
    }
    if (startDate == null || endDate == null) {
        return retArray;
    }
    var dateStAr = startDate.split("/");
    var stDate = new Date(dateStAr[2], dateStAr[0] - 1, dateStAr[1]);

    var dateEdAr = endDate.split("/");
    var edDate = new Date(dateEdAr[2], dateEdAr[0] - 1, dateEdAr[1]);

    var yearstDate = stDate.getFullYear();
    var monthstDate = stDate.getMonth();
    var datestDate = stDate.getDate();

    var yearedDate = edDate.getFullYear();
    var monthedDate = edDate.getMonth();
    var dateedDate = edDate.getDate();

    yearDiff = yearedDate - yearstDate;

    if (monthedDate >= monthstDate)
        var monthDiff = monthedDate - monthstDate;
    else {
        yearDiff--;
        var monthDiff = 12 + monthedDate - monthstDate;
    }

    if (dateedDate >= datestDate)
        var dateDiff = dateedDate - datestDate;
    else {
        monthDiff--;
        var dateDiff = 31 + dateedDate - datestDate;

        if (monthDiff < 0) {
            monthDiff = 11;
            yearDiff--;
        }
    }


    retArray[0] = dateDiff;
    retArray[1] = monthDiff;
    retArray[2] = yearDiff;

    //return retArray;
    return yearDiff;
}


function popupac(url,sid) 
{
 var yeniurl=null;
 yeniurl="/gazeteonizleme/onizleme.asp?id="+url+"&sid="+sid
 params  = 'width='+screen.width;
 params += ', height='+screen.height;
 params += ', scrollbars=yes'
 params += ', top=0, left=0'
 params += ', toolbar=no'
 params += ', location=no'
 params += ', status=no'
 params += ', fullscreen=yes';
 newwin=window.open(yeniurl,'windowname4', params);
 if (window.focus) {newwin.focus()}
 return false;
}

