var myOrientArr = new Array();

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

function setSearchTxt(inputObj,title,defaultValue){	
	if(inputObj.value==title){
		inputObj.value='';
	}
}
function searchWrite(e,inputObj,url,title,nullobject){
			
			btnAra=inputObj.form.id+":btnAra";
			 if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)){
				 submitHeader(inputObj,url,title,nullobject)
		            return false;
		    }
			 return true;

	
}

function submitHeader(inputObj,url,title,nullobject){
	searchTxtName=inputObj.form.id+':searchTxt';
	if(document.getElementById(searchTxtName).value!=title){
		if( document.getElementById(searchTxtName).value!=''){
			document.getElementById("searchTxt").value=document.getElementById(searchTxtName).value;
			inputObj.form.action=url;
			formId = inputObj.form.id;
			document.getElementById(formId).submit();
		}else{
			alert(nullobject);
		}
	}else{
		alert(nullobject);
	}
}
function PopItUp(src,w,h,s) {
	if(s) w=w+17;
	getCenter(w,h);
	Popwin = window.open(src,"pop_up","toolbar=1,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 newWindow(url,width,height) //Yeni pencere a�ar.
{
	day = new Date();
	id = day.getTime();
	PageName="Page"+id
	PageName = window.open(url,id,"toolbar=0,top=0,left=0,width="+width+",height="+height+",location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,copyhistory=0"); 
}
var DWin 
function bireysel_int(url,name){	
	DWin = window.open(url,name,"toolbar=0,top=0,left=0,width=790,height=640,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,copyhistory=1"); 
}


var DWin 
function kurumsal_int(url,name){	
	DWin = window.open(url,name,"toolbar=0,top=0,left=0,width=790,height=640,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,copyhistory=1"); 
}	

	
function otherSiteHSBC(_link){
	popPath="/tr/yatirim/jsp/pages/mainpages/otherwindowpage.faces"
	PopItUp(popPath,500,400,1);
	return false;
}
var yonlendirilecekSite;

function yonlendir(){
	window.opener.window.open("http://www.hsbcnet.com");
	self.close();
}
	

function closeWindow(){
	window.close();
}
function setFooter(){
	if (document.getElementById){
		var windowHeight = getWindowHeight();
		if (windowHeight>0){
			var contentHeight = document.getElementById('wrapper').offsetHeight;
			var footerElement = document.getElementById('footer');
			var footerHeight  = footerElement.offsetHeight;
			if (windowHeight - (contentHeight + footerHeight)>= 0) {
				footerElement.style.marginTop = (windowHeight - (contentHeight+footerHeight)) + 'px';
			}else{
				footerElement.style.marginTop = '0';
			}
		}
	}
}

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;
}


