function showWindow(newwin, type)
{
	switch(type){
	case 1:
		window.open(newwin, "BOCI", "");
		break;
	case 2:
		window.open(newwin, "BOCI", "width=640,height=480,directories=no,toolbar=no,resizable=no,menubar=no,scrollbars=yes");
		break;
	case 3:
		window.location=newwin;
		break;
	default:
	}
}

pictotal=3;
picnum=Math.round(Math.random()*pictotal+.5);

picloc1="../../images/eng/adv/adv01.gif";
urlloc1="../creditcard/boci_cc_ex_octopus.php";
picloc2="../../images/eng/adv/adv02.gif";
urlloc2="../creditcard/boci_cc_ex_internet.php";
picloc3="../../images/eng/adv/adv06.gif";
urlloc3="../../pdf/eng/card/EC_Instalment_Professional.pdf";
//picloc3="../../images/eng/adv/adv03.gif";
//urlloc3="../creditcard/boci_cc_ex_monthly.php";
var winloc= new Array(3,3,3,3);

function changePic() {
	document.images.show.src=eval("picloc"+picnum);
}
function changeUrl() {
	//parent.location=eval("urlloc"+picnum);
	showWindow( eval("urlloc"+picnum), winloc[picnum-1] );
}

spictotal=6;
spicnuma=Math.round(Math.random()*spictotal+.5);
spicnumb=Math.round(Math.random()*spictotal+.5);
while (spicnumb==spicnuma) spicnumb=Math.round(Math.random()*spictotal+.5);

spicloc1="../../images/eng/adv/s_adv01.gif";
surlloc1="../../pdf/eng/card/EC_Instalment_Professional.pdf";
spicloc2="../../images/eng/adv/s_adv02.gif";
surlloc2="../creditcard/boci_cc_loan2.php";
spicloc3="../../images/eng/adv/s_adv03a.gif";
surlloc3=webPath+"pdf/eng/BT&CBC.pdf";
spicloc4="../../images/eng/adv/s_adv03b.gif";
surlloc4=webPath+"pdf/eng/EC_BT&CBC.pdf";
spicloc5="../../images/eng/adv/s_adv04a.gif";
surlloc5=webPath+"pdf/eng/BT&CBC.pdf";
spicloc6="../../images/eng/adv/s_adv04b.gif";
surlloc6=webPath+"pdf/eng/EC_BT&CBC.pdf";
//spicloc3="../../images/eng/adv/s_adv03.gif";
//surlloc3=webPath+"pdf/eng/BT&CBC.pdf";
//spicloc4="../../images/eng/adv/s_adv04.gif";
//surlloc4=webPath+"pdf/eng/BT&CBC.pdf";
var swinloc= new Array(1,1,1,1,1,1);


function schangePica() {
	document.images.showa.src=eval("spicloc"+spicnuma);
}
function schangePicb() {
	document.images.showb.src=eval("spicloc"+spicnumb);
}
function schangeUrla() {
	newwina=eval("surlloc"+spicnuma);
	//window.open(newwina,"");
	showWindow(newwina, swinloc[spicnuma-1]);
}
function schangeUrlb() {
	newwinb=eval("surlloc"+spicnumb);
	//window.open(newwinb,"");
	showWindow(newwinb, swinloc[spicnumb-1]);
}
