function Browser() {
	var b=navigator.appName;
	if (b=="Netscape") this.b="ns";
	else if ((b=="Opera") || (navigator.userAgent.indexOf("Opera")>0)) this.b = "opera";
	else if (b=="Microsoft Internet Explorer") this.b="ie";
	if (!b) alert('Unidentified browser./nThis browser is not supported,');
	this.version=navigator.appVersion;
	this.v=parseInt(this.version);
	this.ns=(this.b=="ns" && this.v>=4);
	this.ns4=(this.b=="ns" && this.v==4);
	this.ns6=(this.b=="ns" && this.v==5);
	this.ie=(this.b=="ie" && this.v>=4);
	this.ie4=(this.version.indexOf('MSIE 4')>0);
	this.ie5=(this.version.indexOf('MSIE 5')>0);
	this.ie55=(this.version.indexOf('MSIE 5.5')>0);
	this.ie6=(this.version.indexOf('MSIE 6')>0);
	this.opera=(this.b=="opera");
	this.dom=(document.createElement && document.appendChild && document.getElementsByTagName)?true:false;
	this.def=(this.ie||this.dom); // most used browsers, for faster if loops
	var ua=navigator.userAgent.toLowerCase();
	if (ua.indexOf("win")>-1) this.platform="win32";
	else if (ua.indexOf("mac")>-1) this.platform="mac";
	else this.platform="other";
}
is = new Browser();

function mover(I) {
	document.getElementById('l'+I).src='../images/tmenu/l'+I+'_a.gif';
}

function mout(I) {
	document.getElementById('l'+I).src='../images/tmenu/l'+I+'_p.gif';
}
function moverEn(I) {
	document.getElementById('l'+I).src='../images_en/tmenu/l'+I+'_a.gif';
}

function moutEn(I) {
	document.getElementById('l'+I).src='../images_en/tmenu/l'+I+'_p.gif';
}

function preload() {
	for (i=1;i<=5;i++) {
		x=new Image();
		x.src='../images/tmenu/l'+i+'_p.gif';
	}
}

preload();

function MagiCScroller(nm) {
		this.NewsArray=new Array();
		this.name=nm;
		this.Speed=5;
		this.Pause=3;
		this.Width=15;
		this.Height=15;
		this.pos='absolute';
		this.l='0px';
		this.t='0px';
		this.Initiated=false;
		this.newsIndex=0;
		this.stX=0;
	}
	
	MagiCScroller.prototype.run=function() {
		
		
		slideLayer(this.name+'Sub1',this.stX,this.name+'Main');
		slideLayer(this.name+'Sub2',this.stX+this.Height,this.name+'Main');
		
		this.stX+=-this.Speed;
		
		if (this.stX<-this.Height) {
			
			this.stX=0;
			this.fN++;
			if (this.fN>this.nL) {
				this.fN=0;
			}
			
			this.sN=this.fN+1;
		
		
			if (this.sN>this.nL) {
				this.sN=0;
			}
			
			writeLayer(this.name+'Sub1',this.name+'Main',this.NewsArray[this.fN]);
			writeLayer(this.name+'Sub2',this.name+'Main',this.NewsArray[this.sN]);
			
			slideLayer(this.name+'Sub1',this.stX,this.name+'Main');
		slideLayer(this.name+'Sub2',this.stX+this.Height,this.name+'Main');
			setTimeout(this.name+'.run()',this.Pause*1000);
		} else {
			setTimeout(this.name+'.run()',100);
		}
		
		
	}
	
	
	
	
	MagiCScroller.prototype.init=function() {
		//style'i yaz...
		t='';
		t+='<style>\n'
		
		t+='#'+this.name+'Main { position:'+this.pos+'; left:'+this.l+'; top:'+this.t+'; overflow:hidden; width:'+this.Width+'px; height:'+this.Height+'px;}\n';
		t+='#'+this.name+'Sub1 { position:absolute; left:0px; top:0px; width:'+this.Width+'px; height:'+this.Height+'px;}\n';
		t+='#'+this.name+'Sub2 { position:absolute; left:0px; top:0px; width:'+this.Width+'px; height:'+this.Height+'px;}\n';
		
		t+='</style>\n';
		
		//layer'lari yaz...
		
		
		document.write(t);
		t='';
		
		
		this.nL=(this.NewsArray).length-1;
		this.newsIndex=0;
		this.fN=0;
		this.sN=this.fN+1;
		if (this.sN>this.nL) {
			this.sN=0;
		}
		
		t+='<div id="'+this.name+'Main">';
		t+='<div id="'+this.name+'Sub1">'+this.NewsArray[this.fN]+'</div>';
		t+='<div id="'+this.name+'Sub2">'+this.NewsArray[this.sN]+'</div>';
		t+='</div>';
		
		document.write(t);
		
		slideLayer(this.name+'Sub1',this.stX,this.name+'Main');
		slideLayer(this.name+'Sub2',this.stX+this.Height,this.name+'Main');
		
		
		setTimeout(this.name+'.run()',this.Pause*1000);
		
	}
	
	
	//dom utilities
	
	function slideLayer(lyr,t,pr) {
		
		if (is.ie) {
			
			document.all[lyr].style.top=t;
		} else if (is.ns6) {
			document.getElementById(lyr).style.top=t+'px';
		} else if (is.ns4) {
			document.layers[pr].document.layers[lyr].top=t;
		}
	}
	
	function writeLayer(lyr,pr,cont) {
		if (is.ie) {
			document.all[lyr].innerHTML=cont;
		} else if (is.ns6) {
			document.getElementById(lyr).innerHTML=cont;
		} else if (is.ns4) {
			
			document.layers[pr].document.layers[lyr].document.open();
			document.layers[pr].document.layers[lyr].document.write(cont);
			document.layers[pr].document.layers[lyr].document.close();
		}
	}

function selectGo(u) {
	if (u!='' && u!='#') {
		location.href=u;
	}
}

function swapA(I) {
		var txt=new Array();
		txt[0]='';
		txt[1]='Elektronik Ürünler';
		txt[2]='Bilisim Ürünleri';
		txt[3]='Beyaz Esya';
		txt[4]='Klimalar';
		txt[5]='Uydu Sistemleri';
		txt[6]='Küçük Ev Aletleri';
		txt[7]='Ankastreler';
		txt[8]='Otel Ürünleri';
		
		
		document.getElementById('icon'+I).src='../images/icon/'+I+'o.gif';
		
		document.getElementById('iconText').className='urun';
		document.getElementById('iconText').innerHTML=txt[I];
		
	}
	
function swapP(I) {
		
		document.getElementById('iconText').innerHTML='';
		document.getElementById('iconText').className='urunP';
		document.getElementById('icon'+I).src='../images/icon/'+I+'.gif';
}
	
 function popup(url,ww,wh,nm)
     {
        FWin = window.open(url,"YeniPencere","toolbar=0,top=20,left=20,width=" + ww + ",height=" + wh + ",location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,copyhistory=0");
        //FWin.title = nm;
        FWin.focus();
      }
	
	
function openPrint(url) {
		
		ww=600;
		wh=500;
        pvWin = window.open(url,"Talihli","toolbar=0,top=20,left=20,width=" + ww + ",height=" + wh + ",location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,copyhistory=0");
        //FWin.title = nm;
        pvWin.focus();
      
}