function Browser(){
	var ua = navigator.userAgent.toLowerCase(); 
	this.Gecko = (ua.indexOf('gecko') != -1 && ua.indexOf('safari') == -1);
	this.Safari = (ua.indexOf('safari') != - 1);
	this.IE = (ua.indexOf('msie') != -1 && !this.Opera && (ua.indexOf('webtv') == -1) ); 
	this.Mozilla = (this.Gecko && ua.indexOf('gecko/') + 14 == ua.length);
	this.Firefox = ( (ua.indexOf('firebird/') != -1) || (ua.indexOf('firefox/') != -1) );
	this.NS = ( (this.Gecko) ? (ua.indexOf('netscape') != -1) : ( (ua.indexOf('mozilla') != -1) && !this.Opera && !this.Safari && (ua.indexOf('spoofer') == -1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('webtv') == -1) && (ua.indexOf('hotjava') == -1) ) );
	this.IECompatible = ( (ua.indexOf('msie') != -1) && !this.IE);
	this.NSCompatible = ( (ua.indexOf('mozilla') != -1) && !this.NS && !this.Mozilla);
	this.geckoVersion = ( (this.Gecko) ? ua.substring( (ua.lastIndexOf('gecko/') + 6), (ua.lastIndexOf('gecko/') + 14) ) : -1 );
	this.equivalentMozilla = ( (this.Gecko) ? parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) ) : -1 );
	this.versionMinor = parseFloat(navigator.appVersion); 
	if (this.Gecko && !this.Mozilla) this.versionMinor = parseFloat( ua.substring( ua.indexOf('/', ua.indexOf('gecko/') + 6) + 1 ) );
	else if (this.Mozilla) this.versionMinor = parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) );
	else if (this.IE && this.versionMinor >= 4) this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) );
	else if (this.Safari) this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('safari/') + 7 ) );
	this.versionMajor = parseInt(this.versionMinor); 
	this.DOM1 = (document.getElementById);
	this.DOM2Event = (document.addEventListener && document.removeEventListener);
	this.mode = document.compatMode ? document.compatMode : 'BackCompat';
	this.Win = (ua.indexOf('win') != -1);
	this.Win32 = (this.Win && ( ua.indexOf('95') != -1 || ua.indexOf('98') != -1 || ua.indexOf('nt') != -1 || ua.indexOf('win32') != -1 || ua.indexOf('32bit') != -1 || ua.indexOf('xp') != -1) );
	this.Mac = (ua.indexOf('mac') != -1);

	this.NS4 = (this.NS && this.versionMajor == 4);
	this.NS6x = (this.NS && this.versionMajor == 6);
	this.NS6up = (this.NS && this.versionMajor >= 6);
	this.NS7x = (this.NS && this.versionMajor == 7);
	this.NS7up = (this.NS && this.versionMajor >= 7);

	this.IE4 = (this.IE && this.versionMajor == 4);
	this.IE4up = (this.IE && this.versionMajor >= 4);
	this.IE5 = (this.IE && this.versionMajor == 5);
	this.IE55 = (this.IE && this.versionMinor == 5.5);
	this.IE5up = (this.IE && this.versionMajor >= 5);
	this.IE6x = (this.IE && this.versionMajor == 6);
	this.IE6up = (this.IE && this.versionMajor >= 6);
}
var is = new Browser();

function mover(I) {
	document.getElementById(I).src='/tr/i/tm_0'+I+'_0'+2+'.gif';
}

function mout(I) {
	document.getElementById(I).src='/tr/i/tm_0'+I+'_0'+1+'.gif';
}

function isDefined(property) {
	return (typeof property != 'undefined');
}

var flashVersion = 0;
function getFlashVersion() {
	var latestFlashVersion = 20;
	var agent = navigator.userAgent.toLowerCase(); 
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		var flashPlugin = navigator.plugins['Shockwave Flash'];
		if (typeof flashPlugin == 'object'){ 
			for (var i = latestFlashVersion; i >= 3; i--){
	            if (flashPlugin.description.indexOf(i + '.') != -1){
	               flashVersion = i;
	               break;
	            }
			}
		}
	}

	else if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4 && agent.indexOf("win")!=-1 && agent.indexOf("16bit")==-1) {
		var doc = '<scr' + 'ipt language="VBScript"\> \n';
		doc += 'On Error Resume Next \n';
		doc += 'Dim obFlash \n';
		doc += 'For i = ' + latestFlashVersion + ' To 3 Step -1 \n';
		doc += '	Set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash." & i) \n';
		doc += '	If IsObject(obFlash) Then \n';
		doc += '		flashVersion = i \n';
		doc += '		Exit For \n';
		doc += '	End If \n';
		doc += 'Next \n';
		doc += '</scr' + 'ipt\> \n';
		document.write(doc);
	}
	else{
		flashVersion = flashVersion_DONTKNOW;
	}

return flashVersion;

}
flashVersion_DONTKNOW = -1;

function FlashObject(){
	this.maxVersion;
	this.SwfFile;
	this.noFlashRedirect;

	this.minVersion;
	this.altSwfFile;

	this.altImage;
	this.altImageAddAtribute;
	this.altImageHTML;

	this.width;
	this.height;
	this.menu;
	this.background;
}

FlashObject.prototype.rnd=function(){
	this.ranNum= Math.random()*255;
    return this.ranNum;
}

FlashObject.prototype.embed=function(){
	var buff;
	if(getFlashVersion()>=this.maxVersion){
		buff=''+
			'<OBJECT ID="'+this.ID+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH='+this.width+' HEIGHT='+this.height+'><PARAM NAME=movie VALUE="'+this.SwfFile+'"><PARAM NAME=menu VALUE='+this.menu+'><param name="wmode" value="'+this.wmode+'"><PARAM NAME="quality" VALUE="high"><PARAM NAME="flashvars" VALUE="'+ this.flashvars +'"><PARAM NAME="bgcolor" VALUE="'+this.background+'"><PARAM NAME="scale" VALUE="'+this.scale+'"><PARAM NAME="salign" VALUE="'+this.salign+'">'+
				'<EMBED name="'+this.ID+'" src="'+this.SwfFile+'" menu="'+this.menu+'" wmode="'+this.wmode+'" quality="high" bgcolor="'+this.background+'"  WIDTH="'+this.width+'" HEIGHT="'+this.height+'" scale="'+this.scale+'" salign="'+this.salign+'" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" swLiveConnect="true"></EMBED>'+
			'</OBJECT>';
	}else if((getFlashVersion()> this.minVersion) && (getFlashVersion()< this.maxVersion) && this.altSwfFile){
		buff=''+
			'<OBJECT ID="'+this.ID+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH='+this.width+' HEIGHT='+this.height+'><PARAM NAME=movie VALUE="'+this.altSwfFile+'"><PARAM NAME=menu VALUE='+this.menu+'<param name="wmode" value="'+this.wmode+'">><PARAM NAME="quality" VALUE="high"><PARAM NAME="bgcolor" VALUE='+this.background+'>'+
				'<EMBED flashvars="'+ this.flashvars +'" name="'+this.ID+'" src="'+this.altSwfFile+'" menu="'+this.menu+'" wmode="'+this.wmode+'" quality=high bgcolor='+this.background+'  WIDTH='+this.width+' HEIGHT='+this.height+' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" swLiveConnect="true"></EMBED>'+
			'</OBJECT>';
	}else{
		if (this.noFlashRedirect != undefined && this.noFlashRedirect != null){
			self.resizeTo(570,360);
			self.location.href=this.noFlashRedirect;
		}
		this.altImageAddAtribute ? (buff='<img src="'+this.altImage+'" width="'+this.width+'" height="'+this.height+'" border="0" '+this.altImageAddAtribute+' />'+this.altImageHTML) : (buff='<img src="'+this.altImage+'" width="'+this.width+'" height="'+this.height+'" border="0" />');
	}
	document.write(buff);
}

function fixSize(){

	if (document.getElementById('scont')) {
		var scontHeight = document.getElementById('scont').offsetHeight;
	}
	if (document.getElementById('mid')) {
		var midHeight = document.getElementById('mid').offsetHeight;
	}
	if (document.getElementById('lmenu')) {
        var lmenuHeight = document.getElementById('lmenu').offsetHeight;
	}
	if (document.getElementById('left')) {
		var leftHeight = document.getElementById('left').offsetHeight;
	}

	
	if (midHeight > leftHeight)
	{
		if (is.Firefox)
		{
			document.getElementById('left').style.height  =  (midHeight-171) +"px";
		} else {
			document.getElementById('left').style.height  =  (midHeight-171) +"px";
		}

		document.getElementById('scont').style.height  =  (midHeight+5) +"px";

	}

	if (leftHeight > midHeight)
	{
		document.getElementById('mid').style.height  =  (leftHeight-35) +"px";
		if (document.getElementById('scont'))
		{
			document.getElementById('scont').style.height  =  (leftHeight+5) +"px";
		}

	}



	if ((lmenuHeight < 296) && (leftHeight > 296))
	{
		if (is.Firefox)
		{
			document.getElementById('lmenu').style.height  =  leftHeight-30 +"px";
			if ((leftHeight > scontHeight) && (leftHeight >= midHeight))
			{
				document.getElementById('scont').style.height  =  (leftHeight+170) +"px";
			}else {
				document.getElementById('scont').style.height  =  (midHeight+100) +"px";
			}


		} else {
			document.getElementById('lmenu').style.height  =  leftHeight +"px";
			leftHeight = document.getElementById('left').offsetHeight;
			if ((leftHeight > scontHeight-100))
			{
				document.getElementById('scont').style.height  =  (leftHeight+120) +"px";
			}
		
		}

	}


}


function init(){
if (typeof document.body.style.maxHeight != "undefined") {

} else {
	if ((!is.IE4  || !is.NS4) && (is.IE5 || is.IE55 || is.IE6 || is.NS6 || is.Safari ||is.Firefox)){

		imgArray = document.getElementsByTagName("img");
			for (i=0;i<imgArray.length;i++){
				if(imgArray[i].alt!=-1) imgArray[i].title=imgArray[i].alt;
			}
		aArray = document.getElementsByTagName("a");
			for (i=0;i<aArray.length;i++){
				if(aArray[i] && aArray[i].href && !aArray[i].title)	aArray[i].title = aArray[i].childNodes[0].nodeValue;
			}
	}
}
}


function getExternalLinks() {
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
			anchor.target = "_blank";
		}
	}
}

var win= null;
function NewWindow(mypage,myname,w,h,scroll){
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/2;
var settings ='height='+h+',';
settings +='width='+w+',';
settings +='top='+wint+',';
settings +='left='+winl+',';
settings +='scrollbars='+scroll+',';
settings +='resizable=no';
win=window.open(mypage,myname,settings);
if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
} 
function MM_openBrWindow(theURL,winName,features) { 
window.open(theURL,winName,features);
}



function getWindowHeight(){
	var windowHeight = 0;
	if(typeof(window.innerHeight) == 'number'){
		windowHeight = window.innerHeight;
	}else{
		if(document.documentElement && document.documentElement.clientHeight){
			windowHeight = document.documentElement.clientHeight;
		}else{
			if(document.body && document.body.clientHeight){
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}


function mailTo(m,e) {
	if (!e) {
		e='';
	}
	
	
	document.write('<a href="mailto:'+m+String.fromCharCode(64)+e+'">'+m+String.fromCharCode(64)+e+'</a>');
}

function setFooter(){
	if (document.getElementById){
		var windowHeight = getWindowHeight();
		if (windowHeight>0){
			var contentHeight = document.getElementById('wrapper').offsetHeight;
			var footerElement = document.getElementById('footer');
			var footerHeight  = footerElement.offsetHeight;
			if (windowHeight - (contentHeight + footerHeight)>= 0) {
				footerElement.style.marginTop = (windowHeight - (contentHeight+footerHeight)) + 'px';
			}else{
				footerElement.style.marginTop = '0';
			}
		}
	}
}

window.onload = function() {
    var links = document.getElementsByTagName('a');
    for (var i=0;i < links.length;i++) {
        if (links[i].className == 'yenipencere') {
            links[i].onclick = function() {
                window.open(this.href);
                return false;
            };
        }
    }
    setFooter();
};

window.onresize = function () {
    setFooter();
}




function HaberScr(name) {
	this.name = name;
	this.contDivID;
	this.news;
	this.transition;
	this.cIndex = 0;
	this.timer;
	this.width;
	this.height;
	this.cDiv;
	this.duration = 5;
	this.step = 1;
	this.delay = 1000;
	this.opc;
	//this.ie = browser.ie;
}


HaberScr.prototype.run = function () {
	
	if(this.read()) {
	
		switch(this.transition) {
			case 'SCROLL2TOP':
				this.scroll2top();
			break;
			case 'SCROLL2LEFT':
				this.scroll2left();
			break;
			case 'FADE':
				this.fade();
			break;
			default:
				alert("HATALI GEÇİŞ");
		}
	}
}


HaberScr.prototype.read = function () {
	var i, j;
	var cont = document.getElementById(this.contDivID);
	var data = cont.childNodes;
	
	cont.style.overflow = 'hidden';
	cont.style.position = 'relative';
	
	this.width	= cont.offsetWidth;
	this.height	= cont.offsetHeight;
	
	this.news = new Array();
	
	j = 0;
	for(i=0; i < data.length; i++) {
		if(data[i].nodeName != '#text') {
			this.news[j] = data[i];
			j++;
		}
	}
	
	return true;
}


HaberScr.prototype.scroll2top = function () {
	if(this.cIndex == this.news.length) {
		this.cIndex = 0;
	}
	
	if(this.cDiv) {
		this.cDiv.style.display = 'none';
	}
	
	this.cDiv = this.news[this.cIndex];
	this.cDiv.style.marginTop = this.height + "px";
	this.cDiv.style.display = 'block';
	this.cDiv.style.position = 'absolute';
	
	this.timer = setInterval(this.name + ".scrollTop()", this.duration);
	
	this.cIndex++;
}


HaberScr.prototype.scrollTop = function () {
	var dist = parseInt(this.cDiv.style.marginTop);
	
	if(dist < -this.cDiv.offsetHeight) {
		clearInterval(this.timer);
		this.scroll2top();
	} else if(dist > 0 && dist <= this.step) {
		clearInterval(this.timer);
		this.cDiv.style.marginTop = "0px";
		this.timer = setTimeout(this.name+".goOn('scrollTop')", this.delay);
	} else {
		this.cDiv.style.marginTop = (dist - this.step) + "px";
	}
}


HaberScr.prototype.scroll2left = function () {
	if(this.cIndex == this.news.length) {
		this.cIndex = 0;
	}
	
	if(this.cDiv) {
		this.cDiv.style.display = 'none';
	}
	
	this.cDiv = this.news[this.cIndex];
	this.cDiv.style.marginLeft = this.width + "px";
	this.cDiv.style.display = 'block';
	
	
	this.timer = setInterval(this.name + ".scrollLeft()", this.duration);
	
	this.cIndex++;
}


HaberScr.prototype.scrollLeft = function () {
	var dist = parseInt(this.cDiv.style.marginLeft);
	
	if(dist < -this.cDiv.offsetWidth) {
		clearInterval(this.timer);
		this.scroll2left();
	} else if(dist > 0 && dist <= this.step) {
		clearInterval(this.timer);
		this.cDiv.style.marginLeft = "0px";
		this.timer = setTimeout(this.name+".goOn('scrollLeft')", this.delay);
	} else {
		this.cDiv.style.marginLeft = (dist - this.step) + "px";
	}
}


HaberScr.prototype.fade = function () {
	if(this.cIndex == this.news.length) {
		this.cIndex = 0;
	}
	
	this.cDiv = this.news[this.cIndex];
	if(browser.isIE) {
		this.cDiv.filters.alpha.opacity = 0;
	} else {
		this.cDiv.style.MozOpacity = 0;
	}
	this.cDiv.style.display = 'block';
	this.opc = 0;
	this.timer = setInterval(this.name + ".fadeIN()", this.duration);
	this.cIndex++;
}


HaberScr.prototype.fadeIN = function () {
	if(this.opc >= 100) {
		clearInterval(this.timer);
		this.opc = 100;
		this.timer = setTimeout(this.name + ".goOn('fadeOUT')", this.delay);
	} else {
		this.opc += this.step;
		if(browser.isIE) {
			this.cDiv.filters.alpha.opacity = this.opc;
		} else {
			this.cDiv.style.MozOpacity = this.opc/100;
		}
	}
}


HaberScr.prototype.fadeOUT = function () {
	if(this.opc <= 0) {
		clearInterval(this.timer);
		this.cDiv.style.display = 'none';
		this.fade();
	} else {
		this.opc -= this.step;
		if(browser.isIE) {
			this.cDiv.filters.alpha.opacity = this.opc;
		} else {
			this.cDiv.style.MozOpacity = this.opc/100;
		}
	}
}



HaberScr.prototype.goOn = function (func) {
	this.timer = setInterval(this.name + "." + func + "()", this.duration);
}
