function addCSS(doc, file) {
	var cssNode = doc.createElement('link');
	cssNode.setAttribute('rel', 'stylesheet');
	cssNode.setAttribute('type', 'text/css');
	cssNode.setAttribute('href', file);
	doc.getElementsByTagName('head')[0].appendChild(cssNode);
}

var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;

if ( plugin ) {

	plugin = parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >= 6;
	
} else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0)) {

	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5")))\n');
	document.write('if ( plugin <= 0 ) then plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6")))\n');
	document.write('<\/SCR' + 'IPT\> \n');
	
}

function insertFlash(url, width, height) {

	if ( plugin ) {
		document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" ID=flashad WIDTH=' + width + ' HEIGHT=' + height + '><PARAM NAME=movie VALUE="' + url + '">');
		document.write('<PARAM NAME=quality VALUE=high>');
		document.write('<param name="wmode" value="transparent">');
		document.write('<EMBED src="' + url + '" quality=high NAME=flashad swLiveConnect=TRUE WIDTH=' + width + ' HEIGHT=' + height + ' TYPE="application/x-shockwave-flash" wmode="transparent" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED></OBJECT>');
	}
	
}

function insertFlashVars(url, width, height, vars) {

	if ( plugin ) {
		document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" ID=flashad WIDTH=' + width + ' HEIGHT=' + height + '><PARAM NAME=movie VALUE="' + url + '">');
		document.write('<param name=quality VALUE=high>');
		document.write('<param name="wmode" value="transparent">');
		document.write('<param name="flashvars" VALUE="' + vars + '">');
		document.write('<EMBED src="' + url + '" quality=high NAME=flashad swLiveConnect=TRUE WIDTH=' + width + ' HEIGHT=' + height + ' TYPE="application/x-shockwave-flash" wmode="transparent" flashvars="' + vars + '" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED></OBJECT>');
	}
	
}

function getFlashVars(url, width, height, vars) {

	return '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" ID=flashad WIDTH=' + width + ' HEIGHT=' + height + '><PARAM NAME=movie VALUE="' + url + '">' +
		'<param name=quality VALUE=high>' +
		'<param name="wmode" value="transparent">' +
		'<param name="flashvars" VALUE="' + vars + '">' +
		'<EMBED src="' + url + '" quality=high NAME=flashad swLiveConnect=TRUE WIDTH=' + width + ' HEIGHT=' + height + ' TYPE="application/x-shockwave-flash" wmode="transparent" flashvars="' + vars + '" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED></OBJECT>';
	
}

function getFlash(url, width, height) {

	return '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" ID=flashad WIDTH=' + width + ' HEIGHT=' + height + '><PARAM NAME=movie VALUE="' + url + '">' +
		'<param name=quality VALUE=high>' +
		'<param name="wmode" value="transparent">' +
		'<EMBED src="' + url + '" quality=high NAME=flashad swLiveConnect=TRUE WIDTH=' + width + ' HEIGHT=' + height + ' TYPE="application/x-shockwave-flash" wmode="transparent" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED></OBJECT>';
	
}

function menu(item) {
	if (item == 1) {
		link ('home.php','conteudo');
		var txt = getFlashVars('swf/right_top.swf', 301, 340, 'arquivo=img/pizza.jpg');
		updatepage(txt, 'right_top_flash');
	} else if (item == 2) {
		link ('cardapio.html','conteudo');
		var txt = getFlashVars('swf/right_top.swf', 301, 340, 'arquivo=img/graca.jpg');
		updatepage(txt, 'right_top_flash');
	} else if (item == 3) {
		link ('restaurantes.php','conteudo');
		var txt = getFlashVars('swf/right_top.swf', 301, 340, 'arquivo=img/fachada.jpg');
		updatepage(txt, 'right_top_flash');
	} else if (item == 4) {
		link ('pedidoonline.html','conteudo');
		var txt = getFlashVars('swf/right_top.swf', 301, 340, 'arquivo=img/graca.jpg');
		updatepage(txt, 'right_top_flash');
	} else if (item == 5) {
		link ('eventos.php','conteudo');
		var txt = getFlashVars('swf/right_top.swf', 301, 340, 'arquivo=img/fachada.jpg');
		updatepage(txt, 'right_top_flash');
	} else if (item == 6) {
		link ('faleconosco.html','conteudo');
		var txt = getFlashVars('swf/right_top.swf', 301, 340, 'arquivo=img/pizza.jpg');
		updatepage(txt, 'right_top_flash');
	}
}

function menu_cardapio(item) {
	if (item == 1) {
		link ('entradas.php','cardapio');
	} else if (item == 2) {
		link ('saladas.php','cardapio');
	} else if (item == 3) {
		link ('pizzas.php','cardapio');
	} else if (item == 4) {
		link ('calzones.php','cardapio');
	} else if (item == 5) {
		link ('lasanhas.php','cardapio');
	} else if (item == 6) {
		link ('spaghetti.php','cardapio');
	}
	
}