function goFullscreen(page) {
	var URLen=page;
	var windowNamen="mainflashwindow";
	var browserName=navigator.appName;
	var operatingSystem=navigator.platform;
	var version = parseFloat(navigator.appVersion);

	// Netscape check version 4.0+ on Win
	if (browserName.indexOf("Netscape")!=-1 && version>=4.0 && operatingSystem.indexOf("Mac")!=-1)
	 {
	 window.open(URLen,windowNamen,'titlebar=no,top=0,left=0,width=' + window.screen.availWidth+',height='+window.screen.availWidth+',screenX=0,screenY=0,top=0,left=0')
	 }

	// MSIE Mac check
	else if (browserName.indexOf("Microsoft Internet Explorer")!=-1 && operatingSystem.indexOf("Mac")!=-1)
	 {
	 window.open(URLen,windowNamen,'titlebar=no,top=0,left=0,width=' + window.screen.availWidth+',height='+window.screen.availWidth+',screenX=0,screenY=0,top=0,left=0')
	 }

	// Netscape Mac check
	else if (browserName.indexOf("Netscape")!=-1 && operatingSystem.indexOf("Mac")!=-1)
	 {
	 window.open(URLen,windowNamen,'width='+screen.width+',height='+screen.height+',top=0,left=0');
	 }

	// MSIE Windows
	else if (browserName.indexOf("Microsoft Internet Explorer")!=-1 && operatingSystem.indexOf("Win")!=-1)
	 {
	 //window.open(URLen,windowNamen,'fullscreen=yes')
	var win = window.open(URLen,windowNamen,'titlebar=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,top=0,left=0,width=' + window.screen.availWidth+',height='+window.screen.availHeight+',screenX=0,screenY=0,top=0,left=0')
		win.resizeTo(screen.width, screen.height);
		 //win.moveTo(1, 1);
		 //win.moveTo(0, 0);
		 //win.resizeTo(screen.width, screen.height);
	 }

	// Netscape Windows
	else if (browserName.indexOf("Netscape")!=-1 && operatingSystem.indexOf("Win")!=-1)
	 {
	 window.open(URLen,windowNamen,'width='+screen.width+',height='+screen.height+',top=0,left=0');
	 }

	else
	 {
	 window.open(URLen,windowNamen);
	 }

}


function popit(url, w, h) {
	npop = window.open(url,'popwin','width='+w+',height='+h+',menubar=no,status=no,scrollbars=no,resizable=no,toolbar=no,location=no,directories=no')
}

function popit_scroll(url, w, h) {
	npop = window.open(url,'popwin','width='+w+',height='+h+',menubar=no,status=no,scrollbars=auto,resizable=yes,toolbar=no,location=no,directories=no')
}

function popit_scroll_yes(url, w, h) {
	npop = window.open(url,'popwin','width='+w+',height='+h+',menubar=no,status=no,scrollbars=yes,resizable=yes,toolbar=no,location=no,directories=no')
}

function popDownload() {
	npop2 = window.open('mccafe/download.asp','popwin2','width=700,height=550,menubar=no,status=no,scrollbars=yes,resizable=no,toolbar=no,location=no,directories=no')
	npop2.resizeTo(700,550)
	document.location.href="mccafe/index.asp";
}

// function to change version
function changever(){
	address = document.location.href;
	if (address.indexOf("chinese")>=0){
		newurl = address.replace("chinese","english");
	}
	if (address.indexOf("english")>=0){
		newurl = address.replace("english","chinese");
	}
	if (newurl.indexOf("#")>=0){
		//newurl = newurl.replace("/#","");
		newurl = newurl.substring(0,newurl.indexOf("#"))
	}
	document.location.href=newurl;
}

/**************
new function for revamped site
***************/

// function to draw footer
function drawfooter(clrcode) {
	var htmlstr = '';
	htmlstr += '<div class="copyright" style="color:#' + clrcode + ';"><span>&copy;</span>McDonald\'s Corporation. All rights reserved</div>';
	htmlstr += '<div class="privacy" style="color:#' + clrcode + ';"><a href="/english/privacy/disclaimer.htm" class="plink" style="color:#' + clrcode + ';">McDonald\'s Privacy Policy</a></div>';
	document.write(htmlstr);
}

// function to change images when mouse over
function ChangeImageOver(img) {
	if (document.images)
		document.getElementById(img).src = eval(img + "_on.src")
}

// function to change images when mouse out
function ChangeImageOut(img) {
	if (document.images)
		document.getElementById(img).src = eval(img + "_off.src")
}

/*
----------------------------------------------------------------------------------------------
Script Library
Author:   Tribal DDB HK (Garfield Chan)
Created:  21 August 2007

History:

---------------------------------------------------------------------------------------------- */

// create Class
var Class = {
	create: function() {return function() {this.initialize.apply(this, arguments);}}
}

function addEvent(elm, evType, fn, useCapture) {
	if (elm.addEventListener) {
		elm.addEventListener(evType, fn, useCapture);
		return true;
	} else if (elm.attachEvent) {
		var r = elm.attachEvent('on' + evType, fn);
		return r;
	} else {
		elm['on' + evType] = fn;
	}
}

function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if (node == null)
		node = document;
	if (tag == null)
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\s)"+searchClass+"(\s|$)");
	for (i=0, j=0; i<elsLen; i++) {
		if (pattern.test(els[i].className)) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}

function toggle(obj) {
	var el = document.getElementById(obj);
	if (el.style.display != 'none') {
		el.style.display = 'none';
	} else {
		el.style.display = '';
	}
}

Array.prototype.inArray = function (value) {
	var i;
	for (i=0; i < this.length; i++) {
		if (this[i] === value) {
			return true;
		}
	}
	return false;
};