// fun&ccedil;&otilde;es para facilitar a vida
function $obj(obj){ return document.getElementById(obj.id); }
function $id(id){ return document.getElementById(id); }
function $tag(id){ return document.getElementsByTagName(id); }

// exemplo para corrigir falhas ao suporte do css no IE
// verifica comportamento para executar alterações visuais no IE   

function contato_cores_trocar(){


if($id("produtos")){

ul = $id("produtos");
lis = ul.getElementsByTagName("li");
	for(i=0;i<lis.length;i++){
		

		lis[i].onmouseover = function(){ pro_cor(this,"b"); }
		lis[i].onmouseout = function(){ pro_cor(this,""); }
		/*
		lis[i].onfocus = function(){ pro_cor(this,"b"); }
		lis[i].onblur = function(){ pro_cor(this,""); }
*/

	}

	}

	// || document.getElementById("maisvendidos")
	if(document.getElementById("maisprocurados")){
	tooltip.init ();	
	}
	
	

	
	
	if(document.all){
	if(document.getElementById("cadastro")){

	ipts = document.getElementById("cadastro").getElementsByTagName("input");

	for(i=0;i<ipts.length;i++)
	{
		if(!/reset/.test(ipts[i].type) && !/submit/.test(ipts[i].type) && !/hidden/.test(ipts[i].type)){
			ipts[i].onfocus = function(){ this.className="border_red"; }
			ipts[i].onblur = function(){ this.className=""; }
		}
	}

	}
	
}
	
	
	}


function iframe_box(){document.write("<iframe name=\"box\" id=\"box\" height=\"0\" width=\"0\" frameborder=\"0\"></iframe>");}

//JavaScript Flash detection and deployment (c)2004 Adrian Rowbotham www.ajrdesign.net
/* -- 1. Player Version detection -- */
//set player version here
var MM_contentVersion = 9;
//set sub version here
var release = "6,0,67,0";
//check for flash player
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
var words = navigator.plugins["Shockwave Flash"].description.split(" ");
for (var i = 0; i < words.length; ++i)
{
if (isNaN(parseInt(words[i])))
continue;
var MM_PluginVersion = words[i];
}
var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
&& (navigator.appVersion.indexOf("Win") != -1)) {
document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
document.write('on error resume next \n');
document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
document.write('</SCR' + 'IPT\> \n');
}
/* -- 2. Deployment function -- */
function writeFlash(swf,flashVarString,w,h,bgcolor,menu,mode,q,id){
if ( MM_FlashCanPlay ) {
document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
+'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+release+'" '
+'width="'+w+'" height="'+h+'" id="'+id+'" align="" tabindex="-1">'
+'<param name="movie" value="'+swf+'">'
+'<param name="menu" value="'+menu+'"> '
+'<param name="quality" value="'+q+'"> '
+'<param name="wmode" value="'+mode+'"> '
+'<param name="bgcolor" value="'+bgcolor+'"> '
+'<param name="flashvars" value="'+flashVarString+'"> '
+'<embed src="'+swf+'" flashvars="'+flashVarString+'" menu="'+menu+'" quality="'+q+'" wmode="'+mode+'" '
+' bgcolor="'+bgcolor+'" width="'+w+'" height="'+h+'" name="'+swf+'" '
+' align="" type="application/x-shockwave-flash" '
+' pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object> ');
} else {
//behaviour for if there is no flash player
document.write('Você precisa instalar o Flash Player '+MM_contentVersion+' para ver este site corretamente.');
document.write('<em><a href="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" target="_blank">');
document.write('Clique aqui para instalar.</a></em>');
//this can be replaced by anything you want;e.g. document.location.replace("text.html");
}
}
//var flashvars = "";arguments ==> (url,flashVarString,width,height,bgcolor,show menu,window mode,quality,id);writeFlash('x.swf',flashvars,800,390,'#FFFFFF',false,'window','high','sp');

function ev(elemento){ 
	id_array = elemento.split("_");	
	document.location = "evento.php?id="+id_array[1]; 
}

window.onload =  function(){
//
//eve_base = document.getElementById("eventos");
if($id("eventos")){

	eve = $id("eventos");
	links = eve.getElementsByTagName("a");
	

			if($id("programacao")){
							
				divs = eve.getElementsByTagName("div");
								
					for(i=0;i<divs.length;i++){
									
						if(divs[i].className=="back"){
									divs[i].onclick = function(){ ev(this.id); };
						}
						
					}
	
			}
		
		else
			{// home
				
				lis = eve.getElementsByTagName("li");
		
					for(i=0;i<lis.length;i++){
				
						lis[i].onclick = function(){ ev(this.id); };
						
					}
			}
			
			
			
		

	
	
	
	}//	end: if $eventos

	if($id("eventos") || $id("evento") || $id("oteatro")){
				
				
					if($id("eventos"))
						eve = $id("eventos");
					else if ($id("oteatro"))
						eve = $id("oteatro");
					else
						eve = $id("evento");
	
				links = eve.getElementsByTagName("a");
	
				for(i=0;i<links.length;i++){
					
						if(links[i].rel == "ext"){
							links[i].target = "_blank";
							
								if(links[i].name=='comprar') links[i].innerHTML += "<span>Ao clicar neste link você será redirecionado para o site de um parceiro do Teatro Anhembi Morumbi.</span>";
							
						}
					
					};
	}

	
if($id("news")) form_news();
	
	

}

function form_news(){

	input_email = $id("news_email");
	
	input_email.onblur = function(){	if(input_email.value ==""){ input_email.value="digite o seu email"; } }
	input_email.onfocus = function(){	if(input_email.value =="digite o seu email"){  input_email.value = "" }  }
	
		
			/* document.getElementsByTagName("form")[0].target = "box";
				
				document.getElementById("javascript").value = "s";
				
				
				iframe_box();
				 */
	
}

function pop(url,wid,hei){
var windscr;
windscr=window.open(url,'Destaque','width='+wid+',height='+hei+',top=0,left=0,status=no,directories=no,toolbar=no,scrollbars=no');
windscr.focus();
}
