function valida(form){
	if(form.msg.value==""){
		window.alert("Por favor preencha o campo com uma frase válida.");
		form.nome.focus();
		return false;
	}else{
		return true;
	}
}

function GerarSWF(arquivo,largura,altura,cor,id){
    document.writeln('    <object id="globalnav-object" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + largura + '" height="' + altura + '" id="' + id + '" name="' + id + '">');
    document.writeln('        <param name="movie" value="' + arquivo + '" />');
    document.writeln('        <param name="FlashVars" value="loc=en_US&htmlApp=false&gatewayURL=gwurl" />');
    document.writeln('        <param name="menu" value="false" />');
	document.writeln('        <param name="BGCOLOR" value="' + cor + '" />');
	document.writeln('        <param name="quality" value="high" />');
	document.writeln('        <param name="wmode" value="transparent" />');
    document.writeln('        <embed id="globalnav-embed" src="' + arquivo + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="loc=en_US&htmlApp=false&gatewayURL=gwurl" menu="false" quality="high" wmode="transparent" bgcolor="' + cor + '" id="' + id + '" width="' + largura + '" height="' + altura + '"></embed>');
    document.writeln('    </object>');
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

/*pop*/
function abrePop(param,param2,s,w,h){
	var novaJanela = window.open(param,param2,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+s+',resizable=no,top=50,left=50,width='+w+',height='+h);
	if (novaJanela) return false;
	return true;
}

function jumpMenu(targ,selObj,restore){
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
}

// Adiciona aos Favoritos
function addBookmark(title, url){
if (document.all) window.external.AddFavorite(url, title); 
else if (window.sidebar) window.sidebar.addPanel(title, url, "") 
}

function CompartilheTwitter(url,msg){

	texto = msg.substr(0, (137));
	
	if(msg.length >140){
		texto = texto+'...';
	}

//window.open("http://twitthis.com/twit?url="+encodeURIComponent(url)+"&title="+encodeURIComponent(texto),"sharer","toolbar=0,status=0,width=626,height=436");
	window.open("http://twitter.com/intent/tweet?source=webclient&text="+encodeURIComponent(msg)+" "+encodeURIComponent(url),"sharer","toolbar=0,status=0,width=626,height=436");

}
function CompartilheFacebook(url,msg){
	window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(url)+"&t="+encodeURIComponent(msg),"sharer","toolbar=0,status=0,width=626,height=436");
}
function CompartilheOrkut(url,msg){
	window.open("http://promote.orkut.com/preview?nt=orkut.com&du="+encodeURIComponent(url)+"&ctx=share&tt="+encodeURIComponent(msg),"sharer","toolbar=0,status=0,width=626,height=436");
}


