function alteraClasse(alteraClasseDiv,alteraClasseType){
	document.getElementById(alteraClasseDiv).setAttribute("class",alteraClasseType);
	document.getElementById(alteraClasseDiv).setAttribute("className",alteraClasseType);
}
function insertFlash(flashDiv,flashURL,flashWidth,flashHeight,flashTransparent){
	if(flashTransparent==1){
		var newParam = "<param name='wmode' value='transparent' />";
		var newWmode = "wmode='transparent'";
	}else{
		var newParam = "";
		var newWmode = "";
	}
	document.getElementById(flashDiv).innerHTML = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='"+flashWidth+"' height='"+flashHeight+"' title='Padaria dois Cora&ccedil;&otilde;es'><param name='movie' value='"+flashURL+"' /><param name='quality' value='high' />"+newParam+"<embed src='"+flashURL+"' "+newWmode+" quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+flashWidth+"' height='"+flashHeight+"'></embed></object>";
}
function contato(){
	self.location = globalURL;
}
function insertTitle(insertTitleId,insertTitleValue){
	var $id = document.getElementById(insertTitleId);
	$id.innerHTML = insertTitleValue;
}
function openImage(openImageURL){
	window.open("imagens/"+openImageURL+".jpg","Image","width=640,height=480");
}
function popup(nome,largura,altura){
 window.open(nome,'popup','width='+largura+',height='+altura+',scrolling=auto,top=150,left=70');}

//Função expansora
function expand(expandName,expandAction){
	var $total = 25;
	//	CLOSE ALL TOPICS
	var $globalTopic = "";
	var $globalItem = "";
	var $globalLink = "";
	var $globalTxt = "";
	var $globalNewLink = "";
	for(var $i=1;$i<=$total;$i++){
		$globalTopic = document.getElementById("topic"+$i);
		$globalItem = document.getElementById("item"+$i);
		$globalLink = document.getElementById("link"+$i);
		$globalTxt = document.createTextNode($globalLink.childNodes[0].nodeValue);
		$globalNewLink = document.createElement("a");
		$globalNewLink.appendChild($globalTxt);
		$globalNewLink.setAttribute("id","link"+$i);
		$globalNewLink.setAttribute("title","Expandir");
		$globalNewLink.setAttribute("name","l"+$i);
		updateClass($globalTopic,"topicUp");
		updateClass($globalItem,"hide");
		$globalNewLink.href = "JavaScript: expand("+$i+",1);";
		$globalTopic.removeChild($globalTopic.firstChild);
		$globalTopic.appendChild($globalNewLink);
	}
	var $name = expandName;
	var $action = expandAction;
	var $topic = document.getElementById("topic"+$name);
	var $item = document.getElementById("item"+$name);
	var $link = document.getElementById("link"+$name);
	var $txt = document.createTextNode($link.childNodes[0].nodeValue);
	var $newLink = document.createElement("a");
	$newLink.appendChild($txt);
	$newLink.setAttribute("id","link"+$name);
	$newLink.setAttribute("title","Expandir");
	$newLink.setAttribute("name","l"+$name);
	if($action==1){
		updateClass($topic,"topicDown");
		updateClass($item,"show");
		$newLink.href = "JavaScript: expand("+$name+",0);";
	}else{
		updateClass($topic,"topicUp");
		updateClass($item,"hide");
		$newLink.href = "JavaScript: expand("+$name+",1);";
	}
	$topic.removeChild($topic.firstChild);
	$topic.appendChild($newLink);
	location.href = "#l"+$name;
}
function updateClass(updateClassId,updateClassType){
	var $id = updateClassId;
	var $type = updateClassType;
	$id.setAttribute("class",$type);
	$id.setAttribute("className",$type);
}
function setLink(setLinkName,setLinkAction){
	var $name = setLinkName;
	var $action = setLinkAction;
	var $link = document.getElementById("link"+$name);
	//$link.setAttribute("onclick","expand("+$name+","+$action+");");
	$link.href = "JavaScript: alert(1);";
	
}