// JavaScript Document
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

// writeObj : embed,object ±â¼ú
function CompilaFlash(arq,largura,altura) {
    document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+largura+"' height='"+ altura +"' id='flash' align='middle' VIEWASTEXT>"+
	 "<param name='allowScriptAccess' value='always' />"+
	 "<param name='movie' value='"+ arq +"' />"+
	 "<param name='quality' value='high' />"+
	 //"<param name='wmode' value='transparent' />"+
	 "<param name='menu' value='false' />"+
	 "<embed src='"+ arq +"' quality='high' wmode='transparent' menu='false' width='"+largura+"' height='"+ altura +"' name='flash' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	"</object>");
}
function CompilaFlash2(arq,largura,altura) {
    document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+largura+"' height='"+ altura +"' id='flash' align='middle' VIEWASTEXT>"+
	 "<param name='allowScriptAccess' value='always' />"+
	 "<param name='movie' value='"+ arq +"' />"+
	 "<param name='quality' value='high' />"+
	 //"<param name='wmode' value='transparent' />"+
	 "<param name='menu' value='false' />"+
	 "<embed src='"+ arq +"' quality='high' wmode='transparent' menu='false' width='"+largura+"' height='"+ altura +"' name='flash' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	"</object>");
}

var bustcachevar=1 //bust potential caching of external pages after initial request? (1=yes, 0=no)
var loadedobjects=""
var rootdomain="http://"+window.location.hostname


function ajaxpage(url, containerid){
	var page_request = false
	if (window.XMLHttpRequest){ // if Mozilla, Safari etc
		page_request = new XMLHttpRequest()
	}else if (window.ActiveXObject){ // if IE
		try {
			page_request = new ActiveXObject("Msxml2.XMLHTTP")
		} 
		catch (e){
			try{
				page_request = new ActiveXObject("Microsoft.XMLHTTP")
			}
			catch (e){}
			}
		}
	else{
	return false
	}
	page_request.onreadystatechange=function(){
		loadpage(page_request, containerid)
	}
	if (bustcachevar){ //if bust caching of external page
		var bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
		page_request.open('GET', url+bustcacheparameter, true)
		page_request.send(null)
	}
}

function loadpage(page_request, containerid){
	if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
		var texto = page_request.responseText;
		texto = texto.replace(/\+/g," ");
		texto = unescape(texto);
		document.getElementById(containerid).innerHTML = texto;
	}
}

// tempo relogio
function fechaBanner(){
	setTimeout("document.getElementById('banner_natal_se_fome').style.display='none';", 10000);
}
