function CallPopup()
{
	window.open('/hk/pages/security_alert.htm','hksecurityalert','scrolling=no,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=0,height=290,width=410,screenx=1, screeny=1,top=1,left=1');
}


var VISITFLASH;
var bw;
function checkBrowser() {
	this.bname=navigator.appName;
	this.ver=navigator.appVersion;
	this.agent=navigator.userAgent;
	this.dom=document.getElementById?1:0;
	this.parsedVer = parseInt(this.ver);
	this.ie5=(this.ver.indexOf("MSIE 5.0")>-1 && this.dom)?1:0;
	this.ie55=(this.ver.indexOf("MSIE 5.5")>-1 && this.dom)?1:0;
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6;
	this.mac=this.agent.indexOf("Mac")>-1;
	this.opera5=this.agent.indexOf("Opera 5")>-1;
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.ns3=(this.bname=="Netscape" && this.parsedVer <= 3)?1:0;
	this.others=(this.opera5);
	this.bw=(this.opera5 || this.ie6 || this.ie5 || this.ie4 || this.ns3 || this.ns4 || this.ns6 || this.others);
	return this;
}
bw=new checkBrowser();

//---------saveCookie
function saveCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

//---------readCookie
function readCookie(name) {

	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i<ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

//---------deleteCookie
function deleteCookies(name) {
	saveCookie(name,"",-1);
}


//deleteCookie(name,'YES',360);
//saveCookie(name,'YES',360);
//readCookie(name);

//saveCookie('Xmas','0',360);
function CheckPopup(){
//clear card flash
VISITFLASH = readCookie('uobgroup02');

	if (VISITFLASH==null) {
		//saveCookie('uobgroup02','1',360);
		CallPopup();
	} else {
	//	VISITFLASH=VISITFLASH*1+1;
	//	saveCookie('uobgroup02',VISITFLASH,360);
		//CallPopup();
	}
	// if (VISITFLASH<=1) {
	//	CallPopup();
	// }
}

CheckPopup();
