//window.onerror  = null;
//window.onerror = errorHandler;

//function errorHandler() { return true;}



mDebugging=1 

var headURL =top.location.href
var origURL = headURL
var first_split = headURL.split("//");
var without_resource = first_split[1];
var second_split = without_resource.split("/");
var domain = first_split[0]+"/";
for (i=0; i < second_split.length; i++) {
	if (second_split[i] !="singapore"){
		domain = domain + "/" + second_split[i];
	}else{
		i = second_split.length;
	}
}

headURL = domain + '/singapore/'
imgURL = domain + '/singapore/'

//alert(headURL);


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.ie7=(this.ver.indexOf("MSIE 7")>-1 && this.dom)?1:0;
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
	this.ie5=(this.ver.indexOf("MSIE 5")>-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.ns7=(this.dom && parseInt(this.ver) >= 7) ?1:0;
	this.ns6=(this.dom && parseInt(this.ver) >= 6) ?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.bw=(this.ie7 || this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns5 || this.ns6 || this.ns7 || this.opera5 || this.dom);
	return this;
}

var bw=new checkBrowser();
      NS4 = (bw.ns4 || bw.ns5 || bw.ns6 || bw.ns7);
     IE4 = (bw.ie4 || bw.ie5 || bw.ie6 || bw.ie7);
     IE6 = (bw.ie5 || bw.ie6 || bw.ie7);
     IE7 = (bw.ie6 || bw.ie7);
    ver4 = (bw.ie4 || bw.ie5 || bw.ie6 || bw.ns4 || bw.ns5 || bw.ns6 || bw.ns7);
   	 IE5 = (IE4 && IE6 && IE7 && bw.ie5);
   isMac = (bw.mac);
  isMenu = (NS4 || (IE4 && !isMac) || (IE5 && isMac) || (IE6 && isMac) || (IE7 && isMac));



function popUp(){return};
function popDown(){return};
//if (!ver4) event=null;

//Ie var
var explorerev=''


if (bw.ie4==1 || bw.ie5==1 || bw.ie6==1 || bw.ie7==1)

    {document.write('<link rel=stylesheet type="text/css" href="'+headURL+'css/genfont.css">');}
else if (bw.ns4)
    {document.write('<link rel=stylesheet type="text/css" href="'+headURL+'css/genfnet.css">');}
else
    {document.write('<link rel=stylesheet type="text/css" href="'+headURL+'css/genfnet_ns567.css">');}	
	

function errorHandler() { return true;}

var winstat="Welcome to KCDAT Singapore";

if (isMenu) {

var headURL = document.location.href;
var first_split = headURL.split("/singapore/");
headURL = first_split[0];


LinkURL=headURL+"/singapore/";
}
//------------------------------------------- (pop-up window) ------------------------------------------------>
function bmark(){
url = "http://www.kcdat.com.sg";
title = "Asian Tiger K.C.DAT Singapore";
if (bw.ie4==1 || bw.ie5==1 || bw.ie6==1) {
window.external.AddFavorite(url,title)
}
else {
        window.open(headURL+"singapore/bookmark.htm","Bookmark","width=740,height=500,menubar=no,scrollbars=yes,resizable=no");
}
}

function gotopath(PATH) {window.top.location=PATH;}

function asian(TheLink) {
        window.open(TheLink,"","width=760,height=540,menubar=0,scrollbars=yes,resizable=no");
}

function contact(TheLink) {
        window.open(TheLink,"","width=615,height=500,menubar=0,scrollbars=yes,resizable=no");
}

function terms() {
redURL=headURL+"tnc/tnc.htm";
	window.open(redURL,"tnc","width=500,height=500,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,menubar=no,top=5,left=5");
}

function refer() {
redURL=headURL+"refer/recommend.asp";
	window.open(redURL,"refer","width=575,height=310,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,menubar=no");
}

