/** © menosdiez.com
 **/

function Abre(page) {
OpenWin = this.open(page, "Ventana", "toolbar=no,menubar=no,location=no,status=yes,scrollbars=yes,resizable=yes,width=400px,height=300px");
}

function Activacapa(nombrecapa) {
	if (document.getElementById(nombrecapa).style.display == "none") {
      document.getElementById(nombrecapa).style.display = "";
      document.getElementById(nombrecapa+'txt').innerHTML="Ocultar";
     } else {
       document.getElementById(nombrecapa).style.display = "none";
       document.getElementById(nombrecapa+'txt').innerHTML="Mostrar";
       }
}

function Enviar() {
	setTimeout(	document.formulario.submit(),2000);
}


// MENU DESPLEGABLE

startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("menuprincipal");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}
window.onload=startList;

function vaciacampo(control){
	if(!control.texto_predeterminado){
		control.texto_predeterminado=control.value;
	}
	
	if(control.value==control.texto_predeterminado){
		control.value='';
	}
}

/*
 * Restaurar el contenido de un control de formulario, pero sólo si no se ha modificado
 * Nota: el control debe tener parámetro value
 */


function campooriginal(control){
	if(control.texto_predeterminado){
	}
	
	if(control.texto_predeterminado && control.value==''){
		control.value=control.texto_predeterminado;
	}
}

function Compartir(type)

{

	var title = encodeURIComponent(window.document.title);
	var href = encodeURIComponent(window.document.location.href);
	var compos = window.document.location.href.split('/');
	var tags = '';

	if(compos[7] != '')

	{
		tags += compos[7]+' ';
	}

	if(compos[8] != '')

	{
		tags += compos[8]+' ';
	}

	if(compos[9] != '')

	{
		tags += compos[9]+' ';
	}		

	

	tags = encodeURIComponent(tags);

	

	switch(type)

	{

		case 'meneame' :
		url = 'http://meneame.net/submit.php?url='+href;

			break;

			

		case 'digg' :
		url = 'http://digg.com/submit?phase=2&url='+href+'&title='+title;

			break;

			

		case 'delicious' :
		url = 'http://del.icio.us/post?url='+href+'&title='+title;

			break;

			

		case 'technorati' :
		url = 'http://www.technorati.com/search/'+tags+'?sub=postcosm';

			break;

			

		case 'yahoo' :
		url = 'http://myweb2.search.yahoo.com/myresults/bookmarklet?u='+href+'&t='+title+'&ei=UTF-8';

			break;

					

		case 'fresqui' :
		url = 'http://tec.fresqui.com/post?url='+href+'&title='+title;

			break;	
			
		case 'facebook' :
		
		url= 'http://www.facebook.com/share.php?u='+href
			break;		

	}

	

	window.open(url);

}
