window.onerror  = null;
window.onerror = errorHandler;

function errorHandler() { return true;}


mDebugging=1 

var headURL = document.location.href;
var first_split = headURL.split("/malaysia/");
headURL = first_split[0];

headURL = headURL + '/malaysia/'
imgURL = headURL + '/malaysia/'
csspath = first_split[0]+ '/';

//alert(csspath);



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")>-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.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5 || this.dom);
	return this;
}
var bw=new checkBrowser();

	 NS6=(document.getElementsByTagName) ? true : false;
     NS4 = (bw.ns4 || bw.ns5 || bw.ns6);
     IE4 = (bw.ie4 || bw.ie5 || bw.ie6);
    ver4 = (bw.ie4 || bw.ie5 || bw.ie6 || bw.ns4 || bw.ns5 || bw.ns6);
    IE5 = (IE4 && bw.ie5);
   isMac = (bw.mac);
  isMenu = (NS4 || (IE4 && !isMac) || (IE5 && isMac) || (IE6 && !isMac));



function popUp(){return};
function popDown(){return};
if (!ver4) event=null;

//Ie var
var explorerev=''


//-> (pop-up window)
function feature(TheLink) {
        window.open(TheLink,"ftr","width=750,height=500,menubar=0,scrollbars=yes,resizable=no");
}
function gloss() {
        window.open("glossary.asp?AP=A","gloss","width=600,height=450,menubar=0,scrollbars=yes,resizable=no");
}

function recipespop(CODEID) {
//alert('detail.asp?CODEID'+CODEID);
        window.open('detail.asp?CODEID='+CODEID,"recipes","width=600,height=450,menubar=0,scrollbars=yes,resizable=no");
}

function goDate(){
if (document.form1.Dmonth.value != ""){
document.location.href=document.form1.Dmonth.value;
}
}
//
function lang(path) {
if (path == "english"){document.location.href=csspath+'english/index.htm';}
if (path == "japanese"){document.location.href=csspath+'japanese/index.htm';}
if (path == "malay"){document.location.href=csspath+'bahasa/index.htm';}
if (path == "chinese"){document.location.href=csspath+'chinese/index.htm';}
}
//
function popEmail(URL,ADDON) {
	window.open('email_page.asp?URL='+URL+'&'+ADDON,"refer","width=470,height=350,menubar=0,scrollbars=no,resizable=no");
}
//
function popEmail2(URL,ADDON) {
	window.open('../email_page.asp?URL='+URL+'&'+ADDON,"refer","width=470,height=350,menubar=0,scrollbars=no,resizable=no");
}
//
function tvc(URL) {
	window.open(URL,"TVC","width=450,height=450,menubar=0,scrollbars=no,resizable=no");
}

function outlets(URL) {
	window.open(URL,"outlets","width=600,height=400,menubar=0,scrollbars=no,resizable=no");
}

function pop_promo(URL) {
	window.open(URL,"promo","width=800,height=600,menubar=0,scrollbars=yes,resizable=yes");
}
function pop_sponsorship(URL) {
	window.open(URL,"sponsorship","width=800,height=600,menubar=0,scrollbars=yes,resizable=yes");
}
function pop_recipe(URL) {
	window.open(URL,"recipe","width=800,height=600,menubar=0,scrollbars=yes,resizable=yes");
}
function countryselector(country){
	document.location.href=country;
}

function showmap() {
	window.open("map.asp","recipe","width=800,height=600,menubar=0,scrollbars=yes,resizable=yes");
}


function bookmarksite(title, url){
if (document.all) {
window.external.AddFavorite(url, title);
} else if (window.sidebar) {
window.sidebar.addPanel(title, url, "")
}
}