function BrowserDetect() {
	var browser = navigator.appName
	if (browser=="Microsoft Internet Explorer") this.browser = "ie"
	else if (browser=="Netscape") this.browser = "ns"
	else this.browser = browser
	this.ie = (this.browser=="ie")
	this.ie4 = (navigator.userAgent.indexOf('MSIE 4')>0)
	this.ie5 = (navigator.userAgent.indexOf('MSIE 5')>0)
	this.ie6 = (navigator.userAgent.indexOf('MSIE 6')>0)
	this.ie7 = (navigator.userAgent.indexOf('MSIE 7')>0)
	this.ver = parseInt(navigator.appVersion)
//	this.ns = (this.browser=="ns")
//	this.ns4 = (this.browser=="ns" && this.ver==4)
//	this.ns5 = (this.browser=="ns" && this.ver==5)

//	this.min = (this.ns4||this.ns5||this.ie4|this.ie5)

        if ((!this.ie5) && (!this.ie6) && (!this.ie7))
                {
			var width=400;
			var height=250;
			var str = "height=" + height + ",innerHeight=" + height;
			str += ",width=" + width + ",innerWidth=" + width;


			if (window.screen) {
			    var ah = screen.availHeight - 40;
			    var aw = screen.availWidth;
			    var xc = (aw - width) / 2;
			    var yc = (ah - height) / 2;
			    str += ",left=" + xc + ",screenX=" + xc;
			    str += ",top=" + (yc) + ",screenY=" + (yc);
			}    
		      OpenWin1 = window.open('/onlineshop/browser.jsp', 'OnlineShop', str);
		      OpenWin1.focus();
                  return false;
                }
	else
		{
		return true;
		}
}
BrowserDetect();
function SubmitUserInfo(lang)
{	
    BodyURL = parent.document.location; 
    BodyURL = BodyURL + "";
	if (lang=="E"){
		//alert(lang);
    		iAssistURL = "http://i.assistant1.pccw.com/icc/main/content.asp?url1=";
    		if (BodyURL.indexOf("payonline.asp") != -1){
    			BodyURL = BodyURL + "\?lang=eng";
    		}
	} else {
		//iAssistURL = "http://www.pccw.com/NASApp/cs/ContentServer?pagename=PCCW/COMMON/linktrack&loc=http://i.assistant1.hkt.com/icc/main/content_c.asp?url1=";
		//alert(lang);
		iAssistURL = "http://i.assistant1.pccw.com/icc/main/content_c.asp?url1=";
		if (BodyURL.indexOf("payonline.asp") != -1){
    			BodyURL = BodyURL + "\?lang=chi";
    		}
	}
	
	goURL(iAssistURL, BodyURL);
}


function goURL(iURL,bURL)
{
  
  TargetURL = iURL + escape(bURL);
   
  //alert("TargetURL " + TargetURL);
   window.open(TargetURL);
   //document.location=bURL;
}


function SubmitUserInfo1(){
var loc;
loc = document.location;
b = GetCookie("bodyurl");
//alert(b);
SetCookie('bodyurl',loc);
window.open("http://i.assistant1.pccw.com/icc/teleweb/chi/main.asp","iassistant");
}

function SetCookie (name, value) {  
var argv = SetCookie.arguments;  
var argc = SetCookie.arguments.length;  
var expires = (argc > 2) ? argv[2] : null;  
var path = (argc > 3) ? argv[3] : null;  
var domain = (argc > 4) ? argv[4] : null;  
var secure = (argc > 5) ? argv[5] : false;  
domain = "pccw.com";
path = "/";
document.cookie = name + "=" + escape (value) + 
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
((path == null) ? "" : ("; path=" + path)) +  
((domain == null) ? "" : ("; domain=" + domain)) +    
((secure == true) ? "; secure" : "");
}
function GetCookie (name) {  
var arg = name + "=";  
var alen = arg.length;  
var clen = document.cookie.length;  
var i = 0;  
while (i < clen) {
var j = i + alen;    
if (document.cookie.substring(i, j) == arg)      
return getCookieVal (j);    
i = document.cookie.indexOf(" ", i) + 1;    
if (i == 0) break;   
}  
return null;
}

function getCookieVal(offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}