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();




function init(){
	
	if (!document.getElementsByTagName) return;
	imgArray = document.getElementsByTagName("img");
		for (i=0;i<imgArray.length;i++){
			if(imgArray[i].alt!=-1) imgArray[i].title=imgArray[i].alt;
		}
		if(document.getElementById("menuArea"))
		{			
			aArray = document.getElementById("menuArea").getElementsByTagName("a");
			//alert(aArray.length)
			for (i=0;i<aArray.length;i++){
				/*if(aArray[i] && aArray[i].href && !aArray[i].title && aArray[i].childNodes[0])*/	aArray[i].title = "";
			}
		}
}

function externalLinks() {
	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";
		}
	}
}

function extWin(src){
	ExtWin = window.open(src);
	ExtWin.focus();
	return false;
}

function externalLinks() {
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i]
		if (anchor.href && anchor.rel == "external" ){
			anchor.target="_blank";
		}
	}
}

function getCenter(pwidth,pheight){
	wwidth=screen.width;
	wheigth=screen.height;
	lpos= (wwidth - pwidth)/2;
	tpos= (wheigth - pheight)/2;
	return lpos, tpos;sd/'';
}


function PopItUp(src,w,h,s) {
	if(s) w=w+17;
	getCenter(w,h);
	Popwin = window.open(src,"pop_up","toolbar=0,width=" + w + ", height=" + h + ", left="+ lpos +", top="+ tpos +"; location=0, directories=0, status=1, scrollbars="+s+", menubar=0, resizable=1, copyhistory=0");
	Popwin.focus();
	//return false;
}

function PopItUpReturn(src,w,h,s) {
	getCenter(w,h);
	Popwin = window.open(src,"pop_up","toolbar=0,width=" + w + ", height=" + h + ", left="+ lpos +", top="+ tpos +"; location=0, directories=0, status=1, scrollbars="+s+", menubar=0, resizable=0, copyhistory=0");
	
	Popwin.focus();
	return false;
}


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 setFooter(){
	if (document.getElementById){
		var windowHeight = getWindowHeight();
		if (windowHeight>0){
			var wrapperHeight = document.getElementById('wrapper').offsetHeight;
			var footerElement = document.getElementById('footer');
			var footerHeight  = footerElement.offsetHeight;
			if (windowHeight - (wrapperHeight + footerHeight)>= 0) {
				footerElement.style.marginTop = (windowHeight - (wrapperHeight+footerHeight)) + 'px';
			}else{
				footerElement.style.marginTop = '0';
			}
		}
	}
} */



function setSearchTxt(mytxtObj,statu){	
	if(!mytxtObj._defaultValue) {
			mytxtObj._defaultValue = mytxtObj.value;
	}	
	if (statu==1){
		if (mytxtObj.value==''){
			mytxtObj.value=mytxtObj._defaultValue;
		}
	}
	else{
		if (mytxtObj.value == mytxtObj._defaultValue){
			mytxtObj.value = '';
		}
	}
	
}

function Arama()
{
	if (document.getElementById("searchTxt").value=='Arama')
	{
		alert("Lütfen bir arama sözcüğü giriniz.")
		return false;
	}
	else if(document.getElementById("searchTxt").value.length < 3)
			{
				alert("Aradığınız terim en az 3 karakterden oluşmalıdır.");
				return false;
			}
			  else 
            {
                //window.location.href='Arama Sonuç Sayfası yapılınca';
				alert("Tamamdır. Arama Sonuç Sayfasına gidicek");
            }
			
			
}

function searchwrite(){
	document.getElementById('searchTxt').style.color = '#576f83';
}

function mailTo(m,e) {
	if (!e) {
		e='asyacard.com.tr';
	}
	document.write('<a href="mailto:'+m+String.fromCharCode(64)+e+'">'+m+String.fromCharCode(64)+e+'</a>');
}




function orientation(tit,_lk){
	root = "http://" + window.location.hostname + "";
	myStr ="";
	myWinTitle = "";
	myWinTitle += "Asya Card"+" > "+tit;
	myStr += "<a href=\"" + root + _lk + "\">"+tit+"</a>";
	
	for (i=0;i<myOrientArr.length;i++){

		if (i==myOrientArr.length-1){
			myStr += "<img src=\"\/_i\/root_ok.gif\"  \/>";
			myStr +=  myOrientArr[i][1];
			myWinTitle += " > "+myOrientArr[i][1];
		}
		else{
			myStr += "<img src=\"\/_i\/root_ok.gif\" \/>";
			myStr += "<a href=\""+ myOrientArr[i][0] +"\">" + myOrientArr[i][1] + "</a>";	
			
			myWinTitle +=  " > "+myOrientArr[i][1];
		}

	}
	
	if($("#content_root")){
		$("#content_root").html(myStr);
	}
	document.title = myWinTitle;
}






var exObj="";
var exClickObj="";
var selecterFlag=0;
function showHideElement(_elm, clickObj){
	var myElement = $(_elm);
	var windowHeight = getWindowHeight();
	if (myElement){
		if (myElement.style.display == ""){
			myElement.style.display = "none";
		}
		else{
			myElement.style.display = "";
		}
	}
	
	if(exObj!="" && exObj != _elm){
		$(exObj).style.display = "none";
	}
	
	if(exObj != _elm){
		exObj = _elm;
	}
	
	if (exClickObj != ""){					
		exClickObj.className = "";
	}
	if (clickObj){
		if (clickObj != exClickObj){
			selecterFlag=1;
		}
		else{
			if (selecterFlag==1){selecterFlag=0;}
			else{selecterFlag=1;}
		}
					
		if (selecterFlag==1){
			clickObj.className += " selected";
		}
		
		exClickObj = clickObj;
	}
	
}

function loadHideElement(_link){
	mydiv = _link.split("#");
	if (mydiv.length > 1){
		showHideElement(mydiv[1],$(mydiv[1]));
	}
}  



function uyeIsyeriOl(){
	PopItUp('/uye-isyeri/kayit/index_1.html',760,500,1)
}

function uyeIsyeriOner(){
	PopItUp('/uye-isyeri/oner/index_1.html',760,500,1)
}

function arkadasiniGetir(){
	PopItUp('/forms/arkadasini-getirene-asya-puan.html',760,500,1)
}

function eEkstre(){
	PopItUp('/e-ekstre/index_2.html',760,500,1)
}

function eSube(){
	PopItUp('https://bankasya.com.tr/pls/asya/login_kart_sube.shtml',760,500,1)
}

function hemenBasvur(){
	PopItUp('https://bankasya.com.tr/pls/asya/SANAL_POS_KART_BASVURU.shtml?p_referer=ditcard.AsyaCardKredikartlari',500,300,1)
}


function int_sb_popup(url,isim,genislik,yukseklik,lpos,tpos) {
	window.open (url,isim,"menubar=0,resizable=0,scrollbars=1,status=1,width="+genislik+",height="+yukseklik+",left="+lpos+",top="+tpos);
	
}
function hemenBasvurSanal(){
	PopItUp('https://esube.bankasya.com.tr/BenimAsyamWeb/Login.jsf',1024,768,1)
}

function tiklayiniz(){
	PopItUp('/odullerimiz/interactive_03_12_09.html',760,500,1)
}
function tiklayiniz1(){
	PopItUp('/odullerimiz/asyacard_19_06_09.html',760,500,1)
}
function tiklayiniz2(){
	PopItUp('/odullerimiz/asyacard_29_04_09.html',760,500,1)
}
function tiklayiniz3(){
	PopItUp('/odullerimiz/asyacard_13_11_08.html',760,500,1)
}

function tiklayiniz4(){
	PopItUp('/odullerimiz/tuketici_odulu_17_03_2010.html',760,500,1)
}

function M(_id){return document.getElementById(_id);} 

/* window.onload = function() {
	init();
	setFooter();

	
} */





