// JavaScript Document

function Busca(string_busca){
	 document.location.href="http://www.medicalservices.com.br/atualizacao/medicalSearch/index.php?ori=dr&enviosrc=http://www.endoclub.com.br/materias/busca_script_novo.php&busca="+string_busca+"&cat_id=0";
}

function addFav(){
    var url      = "http://www.doutorandoseresidentes.com.br";
    var title    = "Doutorandos e Residentes";
    if (window.sidebar) window.sidebar.addPanel(title, url,"");
    else if(window.opera && window.print){
        var mbm = document.createElement('a');
        mbm.setAttribute('rel','sidebar');
        mbm.setAttribute('href',url);
        mbm.setAttribute('title',title);
        mbm.click();
    }
    else if(document.all){window.external.AddFavorite(url, title);}
}


	function selecturl(s, restore){
		gourl = s.selectedIndex;
		if(restore){
			s.selectedIndex = 0;
			window.top.location.href = s.options[gourl].value;
		}
	}


	function targetBlank (s, restore) {
	gourl = s.selectedIndex;
	url = s.options[gourl].value;
	  blankWin = window.open(url,'_blank','menubar=yes,toolbar=yes,location=yes,directories=yes,fullscreen=no,titlebar=yes,hotkeys=yes,status=yes,scrollbars=yes,resizable=yes');
	}

	function MostraDiv(div){
		document.getElementById(div).style.display = 'inline-block';
	}
	
	function EscondeDiv(div){
		document.getElementById(div).style.display = 'none';
	}

	function criarCookie() {
    var d = new Date();
    d.setTime(d.getTime()+(30*24*60*60*1000));
    var cookie_expire = "; expires="+d.toGMTString();

	//alert(document.getElementById('senha').value);
    var usuario = document.getElementById('usuario').value;
	var senha = hex_md5(document.getElementById('senha').value);

    document.cookie = 'usuario' + "=" + usuario + cookie_expire;
	document.cookie = 'senha' + "=" + senha + cookie_expire;

	}

	function retornarCookie(){
		if ( document.cookie.match(eval("/" + 'usuario' + "=/")) ) {
		var valorUsuario = document.cookie.replace(eval("/^.*?" + 'usuario' + "=([^\\s;]*).*$/"), "$1");
		var valorSenha = document.cookie.replace(eval("/^.*?" + 'senha' + "=([^\\s;]*).*$/"), "$1");

		
		document.getElementById('usuario').value = valorUsuario;
		document.getElementById('senha').value = valorSenha;
		}
	}
	
	
	function xmlMicoxLoader(url){
	  //by Micox: micoxjcg@yahoo.com.br.
		if(window.XMLHttpRequest){
			var Loader = new XMLHttpRequest();
			Loader.open("GET", url ,false);
			Loader.send(null);
			return Loader.responseXML;
		}else if(window.ActiveXObject){
			var Loader = new ActiveXObject("Msxml2.DOMDocument.3.0");
			Loader.async = false;
			Loader.load(url);
			return Loader;
		}
	}
	
	function xmlMicoxRSS(xmlNode){
 //by Micox: http://elmicox.blogspot.com
 var retorno = "";
 var objNodeList = xmlNode.getElementsByTagName("banner")
 
  var intFim = objNodeList.length;
	var num_rand = parseInt(Math.random()*intFim);
   var strTitulo = ""
  var strURL = ""
  var strDescr = ""
  var objNode = objNodeList[num_rand];
  if(objNode.nodeType == 1){//ignorar espaços em branco
   for(var j=0;j<objNode.childNodes.length;j++){
    var objNode2 = objNode.childNodes[j];
    if(objNode2.nodeType == 1){//ignorar espaços em branco
     switch (objNode2.nodeName) {
      case "titulo": 
       //alert(objNode.childNodes[j].firstChild.nodevalue);
       strTitulo = objNode2.firstChild.nodeValue; 
       break;
      case "src": 
       strURL = objNode2.firstChild.nodeValue; 
       break;
      case "url": 
       strDescr = objNode2.firstChild.nodeValue; 
       break;
     }
    }
   }
   //alert(strURL);
   retorno = '<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="468" height="60"><param name="movie" value="http://www.medicalservices.com.br/'+strURL+'" /><param name="quality" value="high" /><embed src="http://www.medicalservices.com.br/'+strURL+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="468" height="60"></embed></object>';
 }
 retorno = "<ul>\n" + retorno + "</ul>";
 return retorno;
}


var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-17815221-1']);
  _gaq.push(['_trackPageview']);
 
  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();



