////////////////////////////////////////////////////////////////////////////////////////////
/*Selo tempo*/
function fnSeloCampinas(){document.write('<iframe src="http://selos.climatempo.com.br/selos/MostraSelo.php?CODCIDADE=418&SKIN=padrao" scrolling="no" frameborder="0" width="150" height="170" marginheight="0" marginwidth="0"></iframe>');}
function fnSeloAmericana(){document.write('<iframe src="http://selos.climatempo.com.br/selos/MostraSelo.php?CODCIDADE=391&SKIN=padrao" scrolling="no" frameborder="0" width="150" height="170" marginheight="0" marginwidth="0"></iframe>');}
function fnSeloHortolandia(){document.write('<iframe src="http://selos.climatempo.com.br/selos/MostraSelo.php?CODCIDADE=2186&SKIN=padrao" scrolling="no" frameborder="0" width="150" height="170" marginheight="0" marginwidth="0"></iframe>');}
function fnSeloCampinasNovaOdessa(){document.write('<iframe src="http://selos.climatempo.com.br/selos/MostraSelo.php?CODCIDADE=2188&SKIN=padrao" scrolling="no" frameborder="0" width="150" height="170" marginheight="0" marginwidth="0"></iframe>');}
function fnSeloPaulinia(){document.write('<iframe src="http://selos.climatempo.com.br/selos/MostraSelo.php?CODCIDADE=504&SKIN=padrao" scrolling="no" frameborder="0" width="150" height="170" marginheight="0" marginwidth="0"></iframe>');}
function fnSeloStaBarbaraDoeste(){document.write('<iframe src="http://selos.climatempo.com.br/selos/MostraSelo.php?CODCIDADE=535&SKIN=padrao" scrolling="no" frameborder="0" width="150" height="170" marginheight="0" marginwidth="0"></iframe>');}
function fnSeloSumare(){document.write('<iframe src="http://selos.climatempo.com.br/selos/MostraSelo.php?CODCIDADE=545&SKIN=padrao" scrolling="no" frameborder="0" width="150" height="170" marginheight="0" marginwidth="0"></iframe>');}
function fnSeloValinhos(){document.write('<iframe src="http://selos.climatempo.com.br/selos/MostraSelo.php?CODCIDADE=572&SKIN=padrao" scrolling="no" frameborder="0" width="150" height="170" marginheight="0" marginwidth="0"></iframe>');}
function fnSeloVinhedo(){document.write('<iframe src="http://selos.climatempo.com.br/selos/MostraSelo.php?CODCIDADE=575&SKIN=padrao" scrolling="no" frameborder="0" width="150" height="170" marginheight="0" marginwidth="0"></iframe>');}
////////////////////////////////////////////////////////////////////////////////////////////
//Funcao de popup
function MM_openBrWindow(theURL,winName,features) 
{
	var myWin =  window.open(theURL,winName,features);
	myWin.focus();
}
////////////////////////////////////////////////////////////////////////////////////////////
/*Funcao para target*/
function fnTarget(str_target) 
{
	//declaracao de variaveis
	var ch_tag_A, vet_A, int_i;
	var str_titulo;	
	//pega todos os <a> da pagina e percorre um por um para achar o rel="external"
    ch_tag_A = document.getElementsByTagName('a');
    for(int_i=0; int_i<ch_tag_A.length; int_i++) 
	{
		vet_A = ch_tag_A[int_i];
		if(vet_A.getAttribute("href") && vet_A.getAttribute('rel') != null) 
		{
			if (vet_A.getAttribute('rel').substring(0,8) == 'external')
			{
				vet_A.target = str_target;
				str_titulo = ch_tag_A.title;
				ch_tag_A.title = str_titulo;
			}
		}
	}
}
////////////////////////////////////////////////////////////////////////////////////////////
/*Funcao Adiciona a Favoritos*/
function fnAdicionaFavoritos(){
	str_titulo = ":: AKINFORMA - Guia de Campinas ::";
	str_url = "http://www.akinforma.com.br";
	try{
		if(window.external){window.external.AddFavorite(str_url,str_titulo); }
	}
	catch(e)
	{
		try{
			if(window.sidebar){ window.sidebar.addPanel(str_titulo,str_url,""); }
		}
		catch(ee)
		{
			if(window.opera && window.print){ return true; }
		}
	}	
}
///////////////////////////////////////////////////////////////////////////////////////////
//Funcao para flash
function fnFlash(str_url, int_largura, int_altura)
{
	document.writeln('<object type="application/x-shockwave-flash" data="' + str_url + '" width="' + int_largura + '" height="' + int_altura + '">');
	document.writeln('<param name="movie" value="' + str_url + '">');
	document.writeln('<param name="quality" value="high">');
	document.writeln('<param name="wmode" value="transparent">');
	document.writeln('</object>');
}
////////////////////////////////////////////////////////////////////////////////////////////
//Validacao da Newsletter
function ValidaNews(form,evento){
	if (form.news.value.search(/^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/) == -1){
		alert("Atenção!\nDigite corretamente o seu e-mail.");
		form.news.focus();
		return false;
	}
}
///////////////////////////////////////////////////////////////////////////////////////////
//Validacao Descadastrar
function verificaEmail(){
	if(document.getElementById('news').value.search(/^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/) == -1){
		alert("Atenção!\nColoque seu EMAIL corretamente para descadastrar!");
		document.getElementById('news').focus();
		return false;
	}
	return true;
}