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 = 0;
function getFlashVersion() {
    if(flashVersion == 0)
    {
	    var latestFlashVersion = 25;
	    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'+
			    'On Error Resume Next \n'+
			    'Dim obFlash \n'+
			    'For i = ' + latestFlashVersion + ' To 3 Step -1 \n'+
			    '	Set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash." & i) \n'+
			    '	If IsObject(obFlash) Then \n'+
			    '		flashVersion = i \n'+
			    '		Exit For \n'+
			    '	End If \n'+
			    'Next \n'+
			    '</scr' + 'ipt\> \n';
			    
		    document.write(doc);
	    } else {flashVersion = flashVersion_DONTKNOW; }
	    //alert(flashVersion);
    }
return flashVersion;

}
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;
}
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+'" ID="'+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+'" ID="'+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.altImageAddAtribute){
			document.write('<img src="'+this.altImage+'" width="'+this.width+'" height="'+this.height+'" border="0" '+this.altImageAddAtribute+' />');
			document.write(this.altImageHTML);
		}else{
			if(this.altImage){
				document.write('<img src="'+this.altImage+'" width="'+this.width+'" height="'+this.height+'" border="0" />');
			}
			else {
			
			}
		}
	}
	document.write(buff);
}

function alignBottom(divid) {
	boy=92;
	if (is.ns6) {
		if (parseInt(document.body.offsetHeight)>=parseInt(window.innerHeight)-boy){	
			intoH=parseInt(document.body.offsetHeight)+boy;
			document.getElementById(divid).style.top=intoH+'px';
		} else {
			wH=parseInt(window.innerHeight)-boy;
			document.getElementById(divid).style.top=wH+'px';
		}
	}else{
			dist=boy;
		if (document.body.scrollHeight>document.body.clientHeight) {
			document.getElementById(divid).style.top=document.body.scrollHeight-dist;
		} else {
			document.getElementById(divid).style.top=document.body.clientHeight-dist;
		}
	}
}


/* GENEL FONKSİYONLAR */ 

/* POPUP */
		function openPopUp(src,w,h,name) {
			KopWin = window.open(src,name,"toolbar=0,width=" + w + ",height=" + h + ",location=0,directories=0,status=1,scrollbars=0,menubar=0,resizable=0,copyhistory=1");
			KopWin.focus();
		}
		function openPopUp2(src,w,h,name) {
			try {
				KopWin.close();
			}
			catch(e){
			}
			KopWin = window.open(src,name,"toolbar=0,width=" + w + ",height=" + h + ",location=0,directories=0,status=1,scrollbars=1,menubar=0,resizable=0,copyhistory=1");
			KopWin.focus();
		}
		function openPopUp3(src,w,h,name) {
			KopWin = window.open(src,name,"toolbar=0,width=" + w + ",height=" + h + ",location=0,directories=0,status=1,scrollbars=1,menubar=0,resizable=0,copyhistory=1");
			KopWin.focus();
		}
		function openPopUp4(src,w,h,name) {
			KopWin = window.open(src,name,"toolbar=0,width=" + w + ",height=" + h + ",location=0,directories=0,status=1,scrollbars=1,menubar=0,resizable=1,copyhistory=1");
			KopWin.focus();
		}
		function openPopUpRnd(src,w,h,name) {
			RndNumber = Math.random()
			KopWin = window.open(src+'?'+RndNumber,name,"toolbar=0,width=" + w + ",height=" + h + ",location=0,directories=0,status=1,scrollbars=1,menubar=0,resizable=0,copyhistory=1");
			KopWin.focus();
		}
		function openPopUpRndx(src,w,h,name) {
			RndNumber = Math.random()
			KopWin = window.open(src+'?'+RndNumber,"wnd","toolbar=0,width=" + w + ",height=" + h + ",location=0,directories=0,status=1,scrollbars=1,menubar=0,resizable=0,copyhistory=1");
			KopWin.focus();
		}
/* İNTERNET ŞUBELERİ */
		/*
		function bireysel_sube(){
			if(navigator.appName=="Netscape"){ 
				var popOneUpnn = window.open("https://www.disbank.com.tr/disbank/InternetSubesi/","isube","toolbar=0,width=760,height=483,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=0,copyhistory=1");
			}else{
				var popOneUpie = window.open("https://www.disbank.com.tr/disbank/InternetSubesi/","isube","toolbar=0,width=758,height=502,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=0,copyhistory=1");
			}
		}

		function bireysel_sube(){
			w = screen.availWidth - 8;
  			h = screen.availHeight -50;
			features = "width="+w+",height="+h;
			features += ",left=0,top=0,screenX=0,screenY=0,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,copyhistory=0,maximize=1";
			if(navigator.appName=="Netscape"){ 
				var popOneUpnn = window.open("https://isube.fortis.com.tr/webp/login.aspx",features);
			}else{
				var popOneUpie = window.open("https://isube.fortis.com.tr/webp/login.aspx","isube",features);
			}
		}
				*/
		function bireysel_sube(s){
			w = screen.availWidth - 8;
			h = screen.availHeight -50;
			features = "width="+w+",height="+h;
			features += ",left=0,top=0,screenX=0,screenY=0,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,copyhistory=0,maximize=1";
			if(navigator.appName=="Netscape") {
				var popOneUpnn = window.open("https://isube.fortis.com.tr/ESube/Login.aspx ",features);
			} else {
				var popOneUpie = window.open("https://isube.fortis.com.tr/ESube/Login.aspx ","isube",features);
			}
			_uacct = "UA-2410083-1";
			var t = setTimeout("urchinTracker('https://isube.fortis.com.tr/ESube/Login.aspx');",1000);
		}
		
	    function hidden_win(s) {
		var src = "https://isube.fortis.com.tr/WebP/Pages/KullaniciTanimlari/IBKullaniciYarat_On.aspx";
		var w = screen.availWidth - 8;
		var h = screen.availHeight -50;
		if(s) w=w+17;
	    var gizlilik = window.open(src,"hiddenwin","toolbar=0, location=0, directories=0, status=1, scrollbars="+s+", menubar=0, resizable=1, copyhistory=0,maximize=1");
		}
		
		function sirketler_sube(){
			w = screen.availWidth - 8;
			h = screen.availHeight -50;
			features = "width="+w+",height="+h;
			features += ",left=0,top=0,screenX=0,screenY=0,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,copyhistory=0,maximize=1";
			if(navigator.appName=="Netscape") {
				var popOneUpnn = window.open("https://isube.fortis.com.tr/ESube/Login_kurumsal.aspx",features);
			} else {
				var popOneUpie = window.open("https://isube.fortis.com.tr/ESube/Login_kurumsal.aspx","isube",features);
			}
			_uacct = "UA-2410083-1";
			var t = setTimeout("urchinTracker('https://isube.fortis.com.tr/ESube/Login_kurumsal.aspx');",1000);
		}
		
		function popsifre(){
			if(navigator.appName=="Netscape"){ 
			var popOneUpnn = window.open("https://esube.teb.com.tr/bireysel/Basvuru.do","sifreis","toolbar=0,width=768,height=483,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=0,copyhistory=1");
			}else{
			var popOneUpie = window.open("https://esube.teb.com.tr/bireysel/Basvuru.do","sifreis","toolbar=0,width=768,height=502,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=0,copyhistory=1");
			}
		}	
		
		var to;
		function hideNow() {
			document.getElementById('inetsubesi').style.visibility='hidden';
		}
		
		function hideSube() {
			if (document.getElementById('inetsubesi')) {
				to=setTimeout('hideNow()',1000);
			}
		}
		
		function showSube() {
			if (document.getElementById('inetsubesi')) {
				document.getElementById('inetsubesi').style.visibility='visible';
			}
			
			if (to) {
				clearTimeout(to);
			}
		}
		
function newwin(url){
		var popOneUpnn = window.open(url,"newwin");
}

	function openPopUp4(src) {
		//window.alert('aaa');
			window.open(src);
			//return false;
		}
		
function mailTo(m,e,t) {
	if (!e) {
		e='fortis.com.tr';
	}
	if (!t) {
		t=m+String.fromCharCode(64)+e;
	}
	
	document.write('<a href="mailto:'+m+String.fromCharCode(64)+e+'" class="contentlink">'+t+'</a>');
}



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 getWindowWidth(){
	var windowWidth = 0;
	if(typeof(window.innerWidth) == 'number'){
		windowWidth = window.innerWidth;
	}else{
		if(document.documentElement && document.documentElement.clientWidth){
			windowWidth = document.documentElement.clientWidth;
		}else{
			if(document.body && document.body.clientWidth){
				windowWidth = document.body.clientWidth;
			}
		}
	}
	return windowWidth;
}

