function change(obj){
if (obj.selectedIndex>0) {
document.img.src=obj.options[obj.selectedIndex].value;
} 
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
myURL = window.location.href;
myTitle = document.title;

function bookFav() {
  var ua=navigator.userAgent.toLowerCase();
  var isSafari=(ua.indexOf('webkit')!=-1);
  var isMac=(ua.indexOf('mac')!=-1);
  var buttonStr=isMac?'Command/Cmd':'CTRL';
  if(window.opera) {
    // Opera
    void(0);
  } else if(window.home || isSafari) {
    // Firefox, Netscape, Safari, iCab
    alert('You need to press '+buttonStr+' + D to bookmark our site.');
  } else {
    addFav(myURL,myTitle);
  }
}

function addFav(aURL,aTitle){
  if (document.all) {
    window.external.AddFavorite(aURL,aTitle);
  } else if(window.sidebar) {
     window.sidebar.addPanel(aURL,aTitle,"");
  }
  return false;
}
function popup() {
	var tmpObj=MM_findObj("onlineselect");
if (tmpObj.selectedIndex==1) {window.open("https://ibank.standardchartered.com.my","","toolbar=no,location=no,menubar=no,resizable=yes,status=yes,scrollbars=yes");}
if (tmpObj.selectedIndex==2) {window.open("https://www.scb2bex.com","","toolbar=no,location=no,menubar=no,resizable=yes,status=yes"); }
if (tmpObj.selectedIndex==3) {window.open("http://globalmarkets.standardchartered.com/gvswse/site/treasury/content/content_items/files/online_treasury.jsp","","toolbar=no,location=no,menubar=no,resizable=yes,status=yes"); }
}

function popup2() {
	var tmpObj=MM_findObj("onlineselect");
if (tmpObj.selectedIndex==1) {window.open('https://online-banking.standardchartered.co.th/th_ibnk_redirect.html','SCBT','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,top=0,left=0,width='+screen.width+',height='+screen.height+',screenX=0,screenY=0');}
if (tmpObj.selectedIndex==2) {window.open('http://www.standardchartered.co.th/thai/cib/olt/index.html','SCBT','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,top=0,left=0,width='+screen.width+',height='+screen.height+',screenX=0,screenY=0'); }
if (tmpObj.selectedIndex==3) {window.open('https://s2b.standardchartered.com','SCBT','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,top=0,left=0,width='+screen.width+',height='+screen.height+',screenX=0,screenY=0'); }

}

function searchReset() {
	var tmpObj=MM_findObj("q");
	if (tmpObj.value=="Search") {
	tmpObj.value="";	
	}
}

function searchReset2() {
	var tmpObj=MM_findObj("q");
	if (tmpObj.value=="ค้นหา") {
	tmpObj.value="";	
	}
}

