
function fnAdicionaFavoritos(){
	str_titulo = "Hospmed";
	str_url = "http://www.hospmedcirurgica.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; }
		}
	}	
}

function verificaNews(form){
	var email = form.email.value;
    if((email.search(/^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/) == -1)||(email == 'E-mail:')){
    	alert("O campo Email deve ser preenchido corretamente");
    	form.email.focus();
    	return false;
	}
}

//Funcao de popup indique amigo
function MM_openBrWindow(theURL,winName,features){
	var myWin =  window.open(theURL,winName,features);
	myWin.focus();
}

//mostra e oculta (menu)
function mostra(campo){
    document.getElementById(campo).style.display='' ;
}

function oculta(campo){
    document.getElementById(campo).style.display='none' ;
}


function verificaBusca(form){
	if((form.produto.value.length<=1) && (form.fabricante.value.length<=1)){
		alert("Preencha a Busca corretamente para obter suas informações.");		
		return false;
	}
	
}

//funcao para o (mostrar e ocultar)
function onOff(id){
	esconder = (document.getElementById(id).style.display == 'block');
	/*if ( visivel == "" || visivel == "none" ) { document.getElementById(id).style.display = "block" }
	else{ document.getElementById(id).style.display = "none"; }*/
	divs = document.getElementsByTagName('DIV');
	for(d=0; d<divs.length; d++){
		_div = divs[d];
		if (_div.className == 'dicas'){
			id_link = 'dicas_'+(_div.id);
			_link = document.getElementById(id_link);
			if(_div.id != id){ _div.style.display = 'none'; }
			else{ _div.style.display = esconder ? 'none' : 'block'; }
		}
	}
}

function ValidaForm_senha(form){	
	var str_email = form.emailsenha.value ;
    if (( str_email.search(/^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/) == -1 ) || ( str_email == 'Email:' )){
    	alert("O campo E-mail deve ser preenchido corretamente");
    	form.emailsenha.focus();
    	return false;
	}
	
}
function verificaLogin(form){
	var str_email = form.loginemail.value ;
    if (( str_email.search(/^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/) == -1 ) || ( str_email == 'Email:' )){
    	alert("O campo E-mail deve ser preenchido corretamente");
    	form.loginemail.focus();
    	return false;
	}
	if((form.senha.value.length <= 5)||(form.senha.value == "Senha:")){
		alert("Preencha a Senha corretamente para obter suas informações.");
		form.senha.focus();
		return false;
	}
}

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>');
}



