

function NewsScroller(name) {
	this.name = name;
	this.contDivID;
	this.news;
	this.transition;
	this.cIndex = 0;
	this.timer;
	this.width;
	this.height;
	this.cDiv;
	this.duration = 30;
	this.step = 1;
	this.delay = 1000;
	this.opc;
	//this.ie = browser.ie;
}

NewsScroller.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ÇİŞ");
		}
	}
}

NewsScroller.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;
}

NewsScroller.prototype.fade = function () {
	if(this.cIndex == this.news.length) {
		this.cIndex = 0;
	}
	
	this.cDiv = this.news[this.cIndex];
	if(is.IE) {
		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++;
}

NewsScroller.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(is.IE) {
			this.cDiv.filters.alpha.opacity = this.opc;
		} else {
			this.cDiv.style.MozOpacity = this.opc/100;
		}
	}
}

NewsScroller.prototype.fadeOUT = function () {
	if(this.opc <= 0) {
		clearInterval(this.timer);
		this.cDiv.style.display = 'none';
		this.fade();
	} else {
		this.opc -= this.step;
		if(is.IE) {
			this.cDiv.filters.alpha.opacity = this.opc;
		} else {
			this.cDiv.style.MozOpacity = this.opc/100;
		}
	}
}

NewsScroller.prototype.goOn = function (func) {
	this.timer = setInterval(this.name + "." + func + "()", this.duration);
}
var myOrientArr = new Array();

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.Firefox = ( (ua.indexOf('firebird/') != -1) || (ua.indexOf('firefox/') != -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.Mac = (ua.indexOf('mac') != -1);
	this.NS6up = (this.NS && this.versionMajor >= 6);
	this.NS7up = (this.NS && this.versionMajor >= 7);
	this.IE4 = (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();
var flashVersion_DONTKNOW = -1;
function FlashObject(){
	this.ID=this.ID;
	this.maxVersion=this.maxVersion;
	this.SwfFile;
	this.minVersion;
	this.altSwfFile;
	this.altImage;
	this.altImageAddAtribute;
	this.altImageHTML;
	this.width;
	this.height;
	this.menu;
	this.background;
	this.wmode;
	this.flashvars;
	this.scale;
	this.salign;
}
