// redirect to cep.sabah.com.tr
/*
var version = parseInt( navigator.appVersion );
if ( version >= 4 ) {
	x = screen.width ; y = screen.height
	if ( document.layers ) {
		if ( (x >= 800 ) && ( x <= 1028 ) ) {x = 1028}
		if ( (y >= 600 ) && ( y <= 780 ) )  {y = 780}
		if ( (x >= 640 ) && ( x <= 800 ) )  {x = 800}
		if ( (y >= 480 ) && ( y <= 600 ) )  {y = 600}
		if ( x <= 640 ) {x = 640}
		if ( y <= 480 ) {y = 480}
	}
	if ( x < 750 && y < 550 ) {
		document.location.href = "http://cep.sabah.com.tr";
	}
}
*/

var user_agent = navigator.userAgent;
var isOpera = user_agent.indexOf("Opera") >= 0;
var isFirefox = user_agent.indexOf("Firefox") >= 0;
var isWin32up = user_agent.indexOf("Win32") >= 0 
	|| user_agent.indexOf("Win64") >= 0
	|| user_agent.indexOf("Windows NT") >= 0;

// disallow Opera faking IE
var isIE = !isOpera && user_agent.indexOf("MSIE") >= 0;
var isIE55up = isIE && isWin32up && user_agent.match(/MSIE ((5\.5)|[6789])/);
var isIE70up = isIE && isWin32up && user_agent.match(/MSIE ([789])/);
var isIE55dn = isIE && !isIE55up;
var browser = "other";

if (isFirefox)
	browser = "firefox";
else if (isOpera) 
	browser = "opera";
else if (isIE55up) 
	browser = "ie55p";
else if (isIE55dn) 
	browser = "ie55d";

function setHomePage2(ths, url) {
	ths.style.behavior='url(#default#homepage)';
	ths.setHomePage(url);
}

function popup2(url, window_name, width, height) {
	var left = parseInt((screen.width - width) / 2);
	var top = parseInt((screen.height - height) / 2);
	
	var wnd = window.open(url, 
		window_name, 
		'status=1, toolbar=0, menubar=0, scrollbars=no, resizable=0, ' +
		'left=' + left + ', top=' + top + ', ' +
		'width=' + width + ', height=' + height);

	wnd.focus();
	return wnd;
}

function popup_sizeable(url, window_name, width, height) {
	var left = parseInt((screen.width - width) / 2);
	var top = parseInt((screen.height - height) / 2);
	
	var wnd = window.open(url, 
		window_name, 
		'status=1, toolbar=0, menubar=0, scrollbars=yes, resizable=1, ' +
		'left=' + left + ', top=' + top + ', ' +
		'width=' + width + ', height=' + height);

	wnd.focus();
	return wnd;
}

function doHaberYazdir(haber_id) {
	window.print();
}

id = 1;
function RpopUp( URL, W, H, L, T ) {
	id = id + 1;
	popup_sizeable(URL, id, W, H);
}

function popupUyelik(url) {
	popup_sizeable(url,'uyelik', 520, 600);
}

function popupBizeUlasin(haber_id) {
	var url = "/bize_ulasin";
	if (haber_id != null && haber_id != "")
		url += "," + haber_id;
	url += ".html";
	popup_sizeable(url,'bizeulasin', 510, 690);
}

function popupEditorEposta(haber_id) {
	var url = "/editore_eposta";
	if (haber_id != null && haber_id != "")
		url += "," + haber_id;
	url += ".html";
	popup_sizeable(url,'bizeulasin', 510, 690);
}

function popupYorumYap(haber_id) {
	var url = "/yorum," + haber_id + ".html";
	popup_sizeable(url,'haber_yorum', 510, 690);
}

function popupZiyaretciDefteri(defter_id) {
	var url = "/ziyaretci_formu," + defter_id + ".html";
	popup_sizeable(url,'yri_'+defter_id, 530, 580);
}

function popupHesapla() {
	var url = "/oks_sonuc_hesapla.php";
	popup_sizeable(url,'oks', 510, 690);
}

function popupVideoYorumYap( video_id ) {
	var url = "/video_yorum," + video_id + ".html";
	popup_sizeable(url,'video_yorum', 510, 690);
}

function popupYorumlar(haber_id) {
	var url = "/yorumlar," + haber_id + ".html";
	popup_sizeable(url,'haber_yorumlar', 510, 690);
}

function popupHaberGonder(haber_id) {
	var url = "/haber_gonder," + haber_id + ".html";
	popup_sizeable(url,'haber_gonder', 510, 690);
}

function popupVideoGonder(video_id) {
	var url = "/video_gonder," + video_id + ".html";
	popup_sizeable(url,'video_gonder', 510, 690);
}

function popupYazarEposta(haber_id) {
	var url = "/yazara_eposta," + haber_id + ".html";
	popup_sizeable(url,'yazara_eposta', 510, 690);
}

function popupHaberDinle(haber_id) {
	var url = 'http://dinle.sabah.com.tr/mp3/?h=' + haber_id;
	popup_sizeable(url, 'seslihaber', 520, 265);
}

function popupCepSabah() {
	var url = 'http://cep.sabah.com.tr/';
	popup_sizeable(url, 'cep_sabah', 360, 500);
}

function popupGaleri(url) {
	popup_sizeable(url,'haber_galeri',790,620);
}

function popupHisse(hisse_adi) {
	var hisseAdiFormatted=hisse_adi.toUpperCase();
	var url = 'hisse,' + hisseAdiFormatted + '.html';
	popup_sizeable(url, 'sabah_hisse', 623, 420);
	return false;
}

function popupBuyukResim(url,w,h) {
	popup_sizeable(url, 'buyuk_resim', w, h);
	return false;
}

function popupHaberResim(resim_id) {
	popup_sizeable('resim,' + resim_id + '.html', 'haber_resim', 600, 600);
}

function popupDosyaResim(resim_id) {
	popup_sizeable('resim,' + resim_id + '.html', 'haber_resim', 600, 600);
}
	
function popupHavaHarita(resim_adi, isDunya) {
	var wid, hgt;
	
	if (isDunya != null && isDunya) {
		// dunya haritalarinin boyutu degisik
		wid = 700;
		hgt = 700;
	} else {
		wid = 768;
		hgt = 576;
	}
	wid += 40;
	hgt += 200;
	var url = "hava_popup," + resim_adi + ".html";
	popup_sizeable(url, 'hava_popup', wid, hgt);
}

function popupKapakGuzeliOylama() {
	var url = '/kapakguzeli/index.php';
	popup_sizeable(url, 'kapakguzeli_oylama', 530, 600);
}

function getWindowClientSize() {
	var CScreenWidth;
	var CScreenHeight;

	// if (typeof(window.innerWidth) != "undefined") {
	if (window.innerWidth) {
		CScreenWidth = window.innerWidth;
		CScreenHeight = window.innerHeight;
	} else if (document.body.clientWidth) {
		CScreenWidth = document.body.clientWidth;
		CScreenHeight = document.body.clientHeight;
	} else {
		CScreenWidth = 0;
		CScreenHeight = 0;
	}
	return {width: CScreenWidth, height: CScreenHeight};
}

function video_popup(args) {
	var url = "/video_popup," + args + ".html";
	var screenW = screen.width;
	var screenH = screen.height;
	popup_sizeable(url,'video_popup', screenW, screenH);
}

function video_pclose(args) {
	var url = "/video_detay," + args + ".html";
	window.opener.location.href = url;
	window.open('','_parent','');
	window.close();
}

function video_getvideo(args) {
	var url = "/video_detay," + args + ".html";
	document.location.href = url;
}

// IE icin "anasayfam yap"
function linkHomePage(url) {
	if (isIE) {
		document.write("<span class=\"atvgununtarihi\">&nbsp;&nbsp;|&nbsp;&nbsp;</span>" +
			"<a href=\"javascript:;\" onClick=\"setHomePage2(this, '" + url + "');\" class=\"atvgirissayfam\">Giriş sayfam yap</a>");
	}
}

function navigateOpener(url) {
	if (window.opener)
		window.opener.document.location.href = url;
	else
		self.location.href = url;
}

function WriteSWF(width, height, movie, wmode) {
	if (wmode == null) wmode = "transparent";
	var ht = '';
	ht += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + width + '" height="' + height + '"  style="position: absolute; left: 0px; top: 0px;">';
	ht += '<param name=movie value="' + movie + '">';
	ht += '<param name=wmode value="' + wmode + '">';
	ht += '<param name="Quality" value="High">';
	ht += '<embed src="' + movie + '" quality=high ';
	ht += ' wmode="' + wmode + '" name="flashad" swLiveConnect="TRUE" width="' + width + '" height="' + height + '"';
	ht += ' type="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" >';
	ht += '</embed>';
	ht += '</object>';
	document.write(ht);
}

function writeVideoPlayer(stream_url, width, height, showTracker) {
	var trackerVal = (showTracker != null && showTracker) ? "1" : "0";
	
	var playerObj = 
	"<object id=\"TVVideoPlay\" width=\"" + width + "\" height=\"" + height + "\"" +
	"  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\">" +
	"          <param name=\"FileName\" value=\"" + stream_url + "\">" +
	"          <param name=\"AutoStart\" value=\"0\">" +
	"          <param name=\"AutoSize\" value=\"0\">" +
	"          <param name=\"Volume\" value=\"-200\">" +
	"          <param name=\"ShowControls\" value=\"1\">" +
	"          <param name=\"ShowDisplay\" value=\"0\">" +
	"          <param name=\"ShowStatusBar\" value=\"0\">" +
	"          <param name=\"ShowGotoBar\" value=\"0\">" +
	"          <param name=\"ShowTracker\" value=\"" + trackerVal + "\">" +
	"          <param name=\"ShowPositionControls\" value=\"0\">" +
	"          <param name=\"EnablePositionControls\" value=\"0\">" +
	"          <param name=\"EnableContextMenu\" value=\"0\">" +
	"          <embed type=\"application/x-mplayer2\" " +
	"  pluginspage=\"http://www.microsoft.com/Windows/MediaPlayer/download/default.asp\" " +
	"  src=\"" + stream_url + "\" " +
	"  filename=\"" + stream_url + "\" " +
	"  name=\"TVVideoPlay\" " +
	"  AutoStart=\"0\"" +
	"  AutoSize=\"0\"" +
	"  Volume=\"-200\"" +
	"  ShowControls=\"1\"" +
	"  ShowDisplay=\"0\"" +
	"  ShowStatusBar=\"0\" " +
	"  ShowGotoBar=\"0\" " +
	"  ShowTracker=\"" + trackerVal + "\" " +
	"  ShowPositionControls=\"0\" " +
	"  EnablePositionControls=\"0\" " +
	"  EnableContextMenu=\"0\" " +
	"  width=\"" + width + "\" height=\"" + height + "\"></embed>" +
	"</object>";
	document.write(playerObj);
}

function writeOnDemandPlayer(stream_url, width, height) {
	writeLivePlayer(stream_url, width, height, true);
}

function getSWFVideoPlayer(xml_params, width, height) {
	var swf_file = "http://video.sabah.com.tr/_vplayer_live.swf?v=20070430";
	var playerObj = 
		"<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\"" +
		" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\"" +
		" width=\"" + width + "\" height=\"" + height + "\"" +
		" style=\"width: " + width + "px; height: " + height + "px;\">" +
		"<param name=\"allowScriptAccess\" value=\"always\">" +
		"<param name=\"movie\" value=\"" + swf_file + "\">" +
		"<param name=\"flashvars\" value=\"src=" + xml_params + "\">	" +
		"<param name=\"quality\" value=\"high\">" +
		"<param name=\"bgcolor\" value=\"#ffffff\">" +
		"<embed src=\"" + swf_file + "\"" +
		" flashvars=\"src=" + xml_params + "\" " +
		" quality=\"high\" bgcolor=\"#ffffff\" " +
		" style=\"width: " + width + "px; height: " + height + "px\" " +
		" width=\"" + width + "\" height=\"" + height + "\"" +
		" swLiveConnect=\"true\" " +
		" allowScriptAccess=\"always\" " +
		" type=\"application/x-shockwave-flash\" " +
		" pluginspage=\"http://www.macromedia.com/go/getflashplayer\">" +
		"</object>";
	return playerObj;
}

function writeSWFVideoPlayer(xml_params, width, height) {
	var playerObj = getSWFVideoPlayer(xml_params, width, height);
	document.write(playerObj);
}

// haber icine veya video sayfasina video koyar
function writeSWFVideoPlayer2(video_id, width, height, add_border) {
	if (width == null || width == "") width = 364;
	if (height == null || height == "") height = 318;
	// add_border default is false
	add_border = add_border != null && add_border;
	width = parseInt(width);
	height = parseInt(height);
	if (width < 200 || height < 190) {
		width = 200;
		height = 190;
	}
	
	var padding = 5;
	var outer_width = width + 2 * padding + 2;
	var outer_height = height + 2 * padding + 2;
	
	var xml_params = video_id + "&amp;fscrn=false&amp;__siteref=" + escape(document.location.href);
	var ht = "";
	if (add_border) ht +=
		"<div align=\"center\"><div style=\"width: " + outer_width + "px; height: " + outer_height + "px;\">" + 
		"<div style=\"border: solid 1px #ACACAC; padding: " + padding + "px;\">";
	ht += getSWFVideoPlayer(xml_params, width, height);
	if (add_border) ht +=
		"</div></div></div>";
	
	document.write(ht);
}

function writeSWFVideoPlayerFullScreen(video_id) {
	var xml_params = video_id + "&amp;fscrn=true&amp;__siteref=" + escape(document.location.href);
	writeSWFVideoPlayer(xml_params, "100%", "100%");
}

function setInnerHTML(elementID, HTML) {
	var targetElement = document.getElementById(elementID);
	if (targetElement != null)
		targetElement.innerHTML = HTML;
}

function getNewsSoundPlayer(audio_link, width, audio_duration, newsTitle) {
	var playerObj;
	if ( audio_duration <= 0 ) {
		playerObj = "<div class=\"ver11 kalin mavi_renk\" style=\"padding:5px 10px 10px 10px;\">Bu " + newsTitle + " ses dosyası henüz hazır değil.</div>";
	} else {
		playerObj = 
		"<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\"" + 
		" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\"" +
		" width=\"" + width + "\" height=\"35\">" +
		"<param name=\"allowScriptAccess\" value=\"sameDomain\">" +
		"<param name=\"flashvars\" value=\"asrc=" + audio_link + "&amp;__w=" + width + "&amp;__ft=1&amp;__dur=" + audio_duration + "\">" +
		"<param name=\"movie\" value=\"" + siteroot + "audio/mp3_player_v4.swf\">" +
		"<param name=\"quality\" value=\"high\">" +
		"<param name=\"bgcolor\" value=\"#ffffff\">" +
		"<embed src=\"" + siteroot + "audio/mp3_player_v4.swf\"" +
		" flashvars=\"asrc=" + audio_link + "&amp;__w=" + width + "&amp;__ft=1&amp;__dur=" + audio_duration + "\"" +
		" quality=\"high\"" +
		" bgcolor=\"#ffffff\" width=\"" + width + "\" height=\"35\"" +
		" allowScriptAccess=\"sameDomain\"" +
		" type=\"application/x-shockwave-flash\"" +
		" pluginspage=\"http://www.macromedia.com/go/getflashplayer\">" +
		"</object>";
	}
	return playerObj;
}

function writeNewsSoundPlayer(audio_link, width, audio_duration) {
	var playerObj = getNewsSoundPlayer(audio_link, width, audio_duration, "haberin");
	document.write(playerObj);
}

function setNewsSoundBlock(audio_duration, audio_link) {
	var width = 198;
	var playerObj = getNewsSoundPlayer(audio_link, width, audio_duration, "haberin");

	var ht = '<div style="color:#71ad20; padding:5px 0px 0px 10px;" class="kalin ari11">Haberi Dinle</div>' +
		"<div>" + playerObj + "</div>";
	setInnerHTML("divHaberDinle", ht);
}

function setYazarSoundBlock(audio_duration, audio_link) {
	var width = 190;
	var playerObj = getNewsSoundPlayer(audio_link, width, audio_duration, "yazının");

	var ht = 
		'<div style="color:#71ad20; padding:5px 0px 0px 10px;" class="kalin ari11">Yazıyı Dinle</div>' + 
		"<div>" + playerObj + "</div>";
	setInnerHTML("divHaberDinle", ht);
}

/** returns a browser specific alpha image layer.
* - imgPNG - PNG with alpha channel
* - imgGIF - failsafe transparent GIF image
*/
function alphaImg(width, height, imgPNG, imgGIF, alt, title) {
	var imgSpacer = I_URL + "sp.gif";
	var html;
	var alt_title;
	
	if (alt != null)
		alt_title = " alt=\"" + alt + "\"";
	else
		alt_title = " alt=\"\"";

	if (title != null)
		alt_title += " title=\"" + title + "\"";

	if (isIE70up || isOpera || isFirefox) {
		// use PNGs directly
		html = '<img src="' + imgPNG + '" width="' + width + '" height="' + height + '"' + alt_title + '>';
	} else if (isIE55up) {
		// use directX filters
		html = '<img style="width: ' + width + 'px; height: ' + height + 'px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + imgPNG + '\',sizingMethod=\'scale\');\" src="' + imgSpacer + '" width="' + width + '" height="' + height + '"' + alt_title + '>';
	} else {
		// use failsafe GIF images
		html = '<img src="' + imgGIF + '" width="' + width + '" height="' + height + '"' + alt_title + '>';
	}
	
	document.write(html);
}

/** returns a browser specific alpha image background.
* - imgPNG - PNG with alpha channel
* - imgGIF - failsafe transparent GIF image
*/
function alphaImgBG(imgPNG, imgGIF) {
	var html;
	
	if (isIE70up || isOpera || isFirefox) {
		// use PNGs directly
		html = 'background-image: url(' + imgPNG + ');';
	} else if (isIE55up) {
		// use directX filters
		html = 'filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + imgPNG + '\',sizingMethod=\'scale\');';
	} else {
		// use failsafe GIF images
		html = 'background-image: url(' + imgGIF + ');';
	}
	
	return html;
}

function loginKeyPress(evt) {
	var keyValue;

	if (evt.which)
		keyValue = evt.which;
	else
		keyValue = window.event.keyCode;

	if (keyValue == 13) 
		validateLogin();
}

function PopUpFixed( URL, name, W, H, L, T ) {
	var wnd = window.open(URL, name, 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=' + W + ',height=' + H + ',left='+L+',top='+T);
	wnd.focus();
}

function strICompare(str1, str2) {
	if (str1.toLocaleUpperCase) {
		str1 = str1.toLocaleUpperCase();
		str2 = str2.toLocaleUpperCase();
	} else {
		str1 = str1.toUpperCase();
		str2 = str2.toUpperCase();
	}
		
	if (str1 < str2)
		return -1;
	else if (str1 > str2)
		return 1;
	else
		return 0;
}

/* Begin: MBG Ajax functions */
var arrMBGAjaxObjects = new Array();

function set_parameters()
{
	var params='';
	
	if(document.getElementsByTagName('input'))  
	{
		var inpts = document.getElementsByTagName('input');
		for ( i=0;i<inpts.length;i++)
		{
			if(inpts[i].type == "checkbox")
			{
				if(inpts[i].checked == true)
				{
	//				alert(inpts[i].name+'='+inpts[i].value)
					params+=inpts[i].name+'='+inpts[i].value+'&';
				}
			}
			else
				params+=inpts[i].name+'='+inpts[i].value+'&';
		}
	}
	  
	if(document.getElementsByTagName('textarea'))  
	{
		var txtars = document.getElementsByTagName('textarea');
		for ( i=0;i<txtars.length;i++)
		{
			params+=txtars[i].name+'='+txtars[i].value+'&'
		}
	}
	
	if(document.getElementsByTagName('select'))  
	{
		var slcts = document.getElementsByTagName('select');
		for ( i=0;i<slcts.length;i++)
		{
			params+=slcts[i].name+'='+slcts[i].value+'&'
		}
	}
	
	params = params.substring(0,params.length-1)
//	alert(params);
	return params;
} // function set_parameters()

function MBGAjaxProcessChange( index ) {
	var oMBGAjax = arrMBGAjaxObjects[index];
	if (oMBGAjax == null) return;
	
	// State 4 ise Sayfa yuklenmistir.
	//Ve tabii ki HTTP status 200 olmali
	if (oMBGAjax.XML.readyState == 4 && oMBGAjax.XML.status == 200) {
		// do callback if it is set
		if (oMBGAjax.callback != null)
			oMBGAjax.callback(oMBGAjax.XML.responseText);
		else if (oMBGAjax.targetDivID != null) {
			var obj = document.getElementById(oMBGAjax.targetDivID);
			if (obj != null)
				obj.innerHTML = oMBGAjax.XML.responseText;
		}
			
		// clear the referred object after it is used
		arrMBGAjaxObjects[index] = null;
	}
}

function MBGAjaxPOST(url, callback, params) {
	MBGAjaxInternal(url, callback, "POST", params);
}

function MBGAjax(url, callback, method, params) {
	MBGAjaxInternal(url, callback, method, params);
}

function MBGAjaxDIV(url, targetDivID, params) {
	MBGAjaxInternal(url, null, "POST", params, targetDivID);
}

// Executes an asynchronous AJAX operation using GET method and launches 
// the callback with the response text when the request finishes.
function MBGAjaxInternal(url, callback, method, params, targetDivID) {
	if (method == null) method = "GET";
	
	var oXML = null;
	
	// Internet Explorer ise
	try {
		oXML = new ActiveXObject( "Msxml2.XMLHTTP" );
	} catch( e ) {
		try {
			oXML = new ActiveXObject( "Microsoft.XMLHTTP" );
		}
		catch( oc ) { req = null; }
	}

	// Mozailla veya Safari ise
	if ( oXML == null && typeof(XMLHttpRequest) != "undefined" ) {
		oXML = new XMLHttpRequest();
	}

	// save fields to a new object
	var index = arrMBGAjaxObjects.length;
	arrMBGAjaxObjects[index] = new Object();
	arrMBGAjaxObjects[index].XML = oXML;
	arrMBGAjaxObjects[index].callback = callback;
	arrMBGAjaxObjects[index].targetDivID = targetDivID;
	
	// Sayfa yuklendiyse processChange fonksiyonunu cagiriyoruz.
	if ( oXML != null ) {
		oXML.onreadystatechange = function() {
			MBGAjaxProcessChange(index);
		};
		oXML.open( method, url, true );
		if (strICompare(method, "POST") == 0)
			oXML.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		oXML.send( params );
	}
}
/* End: MBG Ajax functions */


/*****************************************************/
/******** Home Page & Add To Favorites ***************/
/*****************************************************/

function setHomePage2(ths, url) {
	ths.style.behavior='url(#default#homepage)';
	ths.setHomePage(url);
}

function add2Favorites(ths, url, title) {
	if (isIE && window.external != null) {
		window.external.AddFavorite(url,title);
	} else if (isFirefox && window.sidebar && window.sidebar.addPanel) {
		window.sidebar.addPanel(title, url, '');
	} else if (isOpera) {
		ths.rel = "sidebar";
		ths.title = title
		ths.href = url;
	}
}

// IE icin "anasayfam yap"
function linkHomePage(url, cssClass) {
	cssClass = (cssClass == null || cssClass == "") ? "" : " class=\"" + cssClass + "\"";
	
	if (isIE) {
		return ("<a" +
			cssClass +
			" href=\"javascript:;\"" +
			" onclick=\"setHomePage2(this, '" + url + "');\"" +
			">Ana Sayfam Yap</a>");
	}
	
	return "";
}

// IE icin "Sık Kullanılanlara ekle"
function linkFavorites(url, title, cssClass) {
	cssClass = (cssClass == null || cssClass == "") ? "" : " class=\"" + cssClass + "\"";

	if (isIE || isFirefox || isOpera) {
		return ("<a" +
			cssClass +
			" href=\"javascript:;\"" +
			" onclick=\"add2Favorites(this, '" + url + "', '" + title + "');\"" +
			">Favorilerime Ekle</a>");
	}
	
	return "";
}

function sabahFavorites() {
	// render only on known browsers
	if (!(isIE || isFirefox || isOpera))
		return;

	var url = "http://www.sabah.com.tr/";
	var title = "SABAH";
	var link_class = "ver10 sol_widget_renk";

	var lnkFav = linkFavorites(url, title, link_class);
	var lnkHome = linkHomePage(url, link_class);
	
	if (lnkFav == "" && lnkHome == "")
		return;

	document.write(
	"<table width='88' border='0' cellpadding='0' cellspacing='0'>"
	);
	
	if (lnkFav != "") {
		document.write("<div style='width: 88px; padding-top: 4px; padding-bottom: 4px;'>" + lnkFav + "</div>");
	}
	if (lnkHome != "") {
		var brdr = (lnkFav != "") ? " border-top: solid 1px #DBDBDB;" : "";
		document.write("<div style='width: 88px; padding-top: 4px; padding-bottom: 4px;" + brdr + "'>" + lnkHome + "</div>");
	}

	document.write(
	"</table>"
	);
}

// IE icin "anasayfam yap" sabah_v2
function linkHomePage_v2(url) {
	if (isIE) {
		return ('<a href="javascript:;" onclick="setHomePage2(this, \'' + url + '\');"' +
                ' style="margin-right: 5px;"><img src="' + I_URL + '_anasayfam_yap.gif" width="108" height="19" alt="Anasayfam Yap!" title="Anasayfam Yap!"></a>');
	}
	
	return "";
}

// IE icin "Sık Kullanılanlara ekle" sabah_v2
function linkFavorites_v2(url, title) {
	if (isIE || isFirefox || isOpera) {
		return ('<a href="javascript:;" onclick="add2Favorites(this, \'' + url + '\', \'' + title + '\');"' +
                ' style="margin-right: 5px;"><img src="' + I_URL + '_favorilerime_ekle.gif" width="117" height="19" alt="Favorilerime Ekle!" title="Favorilerime Ekle!"></a>');
	}
	
	return "";
}

function sabahFavorites_v2() {
	var url = "http://www.sabah.com.tr/";
	var title = "SABAH";

	var lnkFav = linkFavorites_v2(url, title);
	var lnkHome = linkHomePage_v2(url);
	document.write(lnkFav + lnkHome);
}

function MM_jumpMenu(selObj,restore){ //v3.1
	document.location.href=selObj.options[selObj.selectedIndex].value;
	if (restore == null || restore) selObj.selectedIndex=0;
}

function jumpFilm(selObj){
	var filmUrl = "http://kultur.sabah.com.tr/film,0,0," + selObj.options[selObj.selectedIndex].value + ".html";
	blankWin = window.open(filmUrl,'_blank','menubar=yes,toolbar=yes,location=yes,directories=yes,fullscreen=no,titlebar=yes,hotkeys=yes,status=yes,scrollbars=yes,resizable=yes');
}

function getCategoryList(sel){
	var anaalanCode = sel.options[sel.selectedIndex].value;
	document.getElementById('tags').options.length = 0;	// Empty city select box
	if(anaalanCode.length>0){
		var url = 'sari_sayfa_kategoriler.php?anaalan='+anaalanCode;	// Specifying which file to get
		MBGAjax(url, createCategories, "GET");
	}
}

function createCategories(responseText){
	var obj = document.getElementById('tags');
	eval(responseText);	// Executing the response from Ajax as Javascript code	
}

function video_ac(video_id, page_no)
{
	var url = "video," + video_id;
	if (page_no != null && page_no != "")
		url += "~" + page_no;
	url += ".html";
	
	document.location.href = url;
}

function jump_arsiv() {
  var sene_degeri = document.frm_arsiv.sene.options[document.frm_arsiv.sene.selectedIndex].value;
  var ay_degeri = document.frm_arsiv.ay.options[document.frm_arsiv.ay.selectedIndex].value;
  var lnk = "/ars_" + sene_degeri + ay_degeri + ".html";
  document.location.href = lnk;
  return true;
}

function dgid(obj)
{
	return document.getElementById(obj);
} // function dgid(obj)

function displayDIVBlock(id) {
	var obj = document.getElementById(id);
	if (obj != null) obj.style.display = "block"
}

function hideDIVBlock(id) {
	var obj = document.getElementById(id);
	if (obj != null) obj.style.display = "none"
}
