
function mailTo(m,e) {
	if (!e) {
		e='tekstilbank.com.tr';
	}
	
	
	document.write('<a href="mailto:'+m+String.fromCharCode(64)+e+'">'+m+String.fromCharCode(64)+e+'</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 setFooter(){
	var bottomMarg = 16;
	if (document.getElementById){
		var windowHeight = getWindowHeight();
		
		if (windowHeight>0){
			var wrapperHeight = document.getElementById('popwrapper').offsetHeight;
			var footerElement = document.getElementById('popFootTop');
			var footerHeight  = footerElement.offsetHeight;
			var footer = document.getElementById('popFoot').offsetHeight;
			if (windowHeight - (wrapperHeight + footerHeight)>= 0) {
				footerElement.style.marginTop = (windowHeight - (wrapperHeight+footerHeight+bottomMarg))  + 'px';
			}else{
				footerElement.style.marginTop = '0';
			}
		}
	}
}
function getCenter(pwidth,pheight){
	wwidth=screen.width;
	wheigth=screen.height;
	lpos= (wwidth - pwidth)/2;
	tpos= (wheigth - pheight)/2;
	return lpos, tpos;
}


function PopItUp(src,w,h,s) {

	//if(s) w=w+17;
	getCenter(w,h);
	Popwin = window.open(src,"","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();
}



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

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]))
	}
}

