
// Inicializar varios script INICIO *********************************************************************************************
function Inicializar(){	
//	ShowHora()			//Pone la hora y actualiza a cada segundo
	ShowFecha()			//Pone la fecha
//	window.moveTo(0,0);
//	window.resizeTo(screen.width,screen.height);
//	window.defaultStatus = 'www.mirtaaudubert.com.ar'; 
//	window.status = 'www.mirtaaudubert.com.ar'
//	StatusScroll()		//Pone mensaje en el window status
}

//Disable right click script III- By Renigade (renigade@mediaone.net) For full source code, visit http://www.dynamicdrive.com
//START
var message="";
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if (document.layers||(document.getElementById&&!document.all)){if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
document.oncontextmenu=new Function("return false")
//END

//Disable select-text script (IE4+, NS6+)- By Andy Scott Exclusive permission granted to Dynamic Drive to feature script Visit http://www.dynamicdrive.com for this script
//START
function disableselect(e){return false}
function reEnable(){return true}
document.onselectstart=new Function ("return false")//if IE4+
if (window.sidebar){document.onmousedown=disableselect; document.onclick=reEnable }//if NS6
//END
// Inicializar varios script FIN ************************************************************************************************

// Documento JavaScript
function nospam(name,domain){ 
	window.location = 'mailto:' + name + '@' + domain+'?subject=Contacto desde MIA Arte '; 
} 

// Mover body INICIO ************************************************************************************************************
function mover(y) {
	Speed=10
	if (y > 0) { var total_scroll = (y   )/Speed; for(i = 0; i <total_scroll; i += 1){ window.scrollBy( (Speed   ),0) }
	}   else   { var total_scroll = (y*-1)/Speed; for(i = 0; i <total_scroll; i += 1){ window.scrollBy( (Speed*-1),0) } }
}
// Mover body FIN ***************************************************************************************************************

// funcion para ocultar o mostrar el arbol de navegacion INICIO *****************************************************************
function MostrarNota(id) {
	if (!id) { //id=false alert(id)
		var trObj = (document.getElementById) ? document.getElementById('menu') : eval("document.all['menu']"); //alert(trObj.id)
		var ul=trObj.getElementsByTagName('ul')[0];//alert(ul.nodeName)
		ul.style.display='none'
	}else{
		var trObj = (document.getElementById) ? document.getElementById(id) : eval("document.all[id]");
		var ul=trObj.getElementsByTagName('ul')[0];//alert(ul.nodeName)
		if (ul.style.display=='none') {ul.style.display='block'} else {ul.style.display='none'}
	}
}
function ExservOC(id) {
	var trObj = (document.getElementById) ? document.getElementById(id) : eval("document.all[id]");
	if (trObj != null) { if (trObj.style.visibility=="hidden") { trObj.style.visibility="visible" } else { trObj.style.visibility="hidden" } }
}

// funcion para ocultar o mostrar el arbol de navegacion FIN ********************************************************************

// Funcion de contraseña INICIO *************************************************************************************************
function codificar(){ //Esta es la seccion que codifica la contraseña
	var alfabeto = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" // Abecedario para codificar
	var numeros = "0123456789" //Numeros para codificar
	var codificado=""; //Guarda el valor que se codificara
	// Funciones como codificar, comparar, restriciones
	for (var i=0;i<numeros.length;i++) {
		texto=document.PasswordText.texto1.value.substring(i,i+1) //.toUpperCase();
		tex  =alfabeto.indexOf(texto,0);
		tex +=(numeros.substring(i,i+1)*1);
		if (tex<0) tex+=5; { codificado += alfabeto.substring(tex,tex+1) };
	}
	if (document.PasswordText.texto1.value=="") {//Verifica que halla datos en el campo
		eDIV = document.getElementById('capaContenedora');
		eTXT = document.createTextNode("Obligatorio rellenar este campo. Introduce la contraseña"); //Si no hay datos mensaje
		eDIV.removeChild(eDIV.lastChild);
		eDIV.appendChild(eTXT);
	} else {
		eDIV = document.getElementById('capaContenedora');
		eTXT = document.createTextNode("La contraseña fue aceptada...."); //Si hay datos mensaje 
		eDIV.removeChild(eDIV.lastChild);
		eDIV.appendChild(eTXT);
		document.PasswordText.texto2.value = codificado
		ir()
	}
}

function ir() {//Esta es la seccion que compara la contraseña
	var contra = "PsKyEiUHIJ" //esta es la contraseña
	var probar = document.PasswordText.texto2.value //Aqui se guarda el valor codificado
	if (probar==contra) { //Compara si son iguales contraseña codificada introducida con la ya codificada
		locationhref = document.PasswordText.texto1.value + ".html" //Si son iguales concatena y carga la pagina
		loadAJAX('Espanol/'+locationhref,'contenidos','get',false,'null')// loadAJAX('usuarios.html','contenidos','get',false,'null')
	} else {//Mensaje de error que muestra la contraseña introducida
		eDIV = document.getElementById('capaContenedora');
		eTXT = document.createTextNode("Acceso no permitido. Esta contraseña es incorrecta, verifique que halla escrito correctamente:\n"  + document.PasswordText.texto1.value);
		eDIV.removeChild(eDIV.lastChild);
		eDIV.appendChild(eTXT);
	}
}
// Funcion de contraseña FIN ****************************************************************************************************

// Función Preload Standard INICIO **********************************************************************************************
function MM_preloadImages() { //v3.0
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
// Función Preload Standard FIN *************************************************************************************************

// Este Script sirve para otener el parámetro que se le pasó
// Limpiamos la direccion URL dado que el navegador cambia los caracteres de espacio por los signos '%'
// aparte de otras modificacion, entonces debemos asegurarnos de 'descodificar' la URL para ello nesecitamo estas linea de codigo
// var remplaza = /\+/gi; 
// var url = window.location.href;
// url = unescape(url);
// url = url.replace(remplaza, " ");
// url = url.toUpperCase(); //toLowerCase()
// Con estas 5 lineas de codigo ya tenemos la URL descodificada y almacenada en la variable 'url', lo que le mostraremos a 
// continuacion es la funcion que nos devolvera el valor del parametro que queremos obtener...

function obtener_valor(variable) {
	var variable_may = variable.toUpperCase();
	var variable_pos = url.indexOf(variable_may);
	if (variable_pos != -1)	{
		var pos_separador = url.indexOf("&", variable_pos);
		if (pos_separador != -1) { 
			return url.substring(variable_pos + variable_may.length + 1, pos_separador);
		} else {
			return url.substring(variable_pos + variable_may.length + 1, url.length);
		}
	} else {
		return "NO_ENCONTRADO";
	}
}

// Centrar verticalmente u horizontalmente el sitio INICIO **********************************************************************
function CenterSite(){ //No sirve para todos los navegadores, hay que hacerle ajustes
	// Se lo llama al final del index.html para que todos los componentes estén iniciados y corregirlos.
	var WinWidth  = 0, MyWidth   = 0 // Not apply in this site
	var WinHeight = 0, MyHeight  = 0 
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE 
		WinWidth  = window.innerWidth;
		WinHeight = window.innerHeight;
		MyHeight  = parseInt(document.getElementById("IdHeader").style.height)+
					parseInt(document.getElementById("Principal").height)+
					parseInt(document.getElementById("IdFooter").style.height)
		if (!isNS) document.getElementById("IdHeader").style.marginTop=
		( parseInt( (parseInt(WinHeight)-parseInt(MyHeight) )/2 ))+'px'
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		WinWidth  = document.documentElement.clientWidth;
		WinHeight = document.documentElement.clientHeight;
		MyHeight  = parseInt(IdHeader.style.height)+
					parseInt(window.document.getElementById("Principal").height)+
					parseInt(IdFooter.style.height);
		window.IdHeader.style.marginTop = ( parseInt( (parseInt(WinHeight)-parseInt(MyHeight) )/2 ))
	}//	window.alert('WinHeight:'+WinHeight+' MyHeight:'+MyHeight) 
}
// Centrar verticalmente u horizontalmente el sitio FIN *************************************************************************

// Pone la fecha INICIO *********************************************************************************************************
function ShowFecha(){
	var now = new Date();
	thisYear = now.getYear();
	if(thisYear < 1900) {thisYear += 1900}; // corrections if Y2K display problem
	
	if (IDIOMA=="es"){
		var monthNames = new Array( "Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Setiembre","Octubre","Noviembre","Diciembre");
		var dayNames = new Array( "Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado");
		document.write('<span id="Fecha" style="float:right">'+dayNames[now.getDay()]+", "+now.getDate()+" de "+monthNames[now.getMonth()]+" de "+thisYear+'</span>');}
	else if (IDIOMA=="it") {
		var monthNames = new Array( "Gennaio", "Febbraio", "Marzo", "Aprile", "Può", "Giugno", "Julio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre");
		var dayNames = new Array( "Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato");
		document.write('<span id="Fecha" style="float:right">'+dayNames[now.getDay()]+" "+now.getDate()+" "+monthNames[now.getMonth()]+" "+thisYear+'</span>');}
	else if (IDIOMA=="en") {
		var monthNames = new Array( "January", "February", "March", "April", "May", "June", "Julio", "August", "September", "October", "November", "December");
		var dayNames = new Array( "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
		document.write('<span id="Fecha" style="float:right">'+dayNames[now.getDay()]+", "+monthNames[now.getMonth()]+" "+now.getDate()+", "+thisYear+'</span>');}
	else if (IDIOMA=="pt") {
		var monthNames = new Array( "Janeiro", "Fevereiro", "Março", "Abril", "Pode", "Junho", "Julio", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro");
		var dayNames = new Array( "Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado");
		document.write('<span id="Fecha" style="float:right">'+dayNames[now.getDay()]+" "+now.getDate()+" "+monthNames[now.getMonth()]+" "+thisYear+'</span>');}
}
// Pone la fecha INICIO *********************************************************************************************************
// Pone la fecha INICIO *********************************************************************************************************
//function ShowIdiomas(){ //Ingles:language - Italiano:lingua - Portugues:língua  
//	Tbl='idiomas'
//	Par='null'
//	eDIV    = document.getElementById('footer');
//	eSPAN1  = document.createElement('DIV'); eSPAN1.id='Idiom'; //style is defined in CSS
//	eAnchor = document.createElement('A')  ; eAnchor.setAttribute('href','javascript:servOC(Tbl,null)');
//	eSPAN2  = document.createElement('DIV'); eSPAN2.className='SelI';
//	eTEXTO  = document.createTextNode(' Idioma ');
//	eDIV.appendChild(eSPAN1);
//	eSPAN1.appendChild(eAnchor);
//	eAnchor.appendChild(eSPAN2);
//	eSPAN2.appendChild(eTEXTO);
//	IdiomasRotator()
//}

// Cambia el idioma INICIO ******************************************************************************************************
function IdiomasRotator(){
	var eDIV = (document.getElementById) ? document.getElementById('SelI') : eval("document.all['SelI']");
	var how_many_Idiomas = 4 ;
	var now = new Date( );
	var sec = now.getSeconds() ;
	var ad = sec % how_many_Idiomas ;
	ad +=1 ;
	if (ad==1) { eDIV.innerHTML=' Idioma ' }
	if (ad==2) { eDIV.innerHTML='Language' }
	if (ad==3) { eDIV.innerHTML=' Lingua ' }
	if (ad==4) { eDIV.innerHTML=' Língua ' }
	window.setTimeout("IdiomasRotator()",5000);
}
function servOC(id,OnOff) {
	var trObj = (document.getElementById) ? document.getElementById(id) : eval("document.all[id]");
	if (OnOff){
		if (OnOff=="On") { trObj.style.visibility="visible" } else { trObj.style.visibility="hidden" };
	}else{
		if (trObj.style.visibility=="hidden") {	trObj.style.visibility="visible" } else { trObj.style.visibility="hidden" };
	}
}
// Cambia el idioma FIN *********************************************************************************************************

// Pone la Hora INICIO **********************************************************************************************************
function hora(){
	var fecha = new Date()
	var hora = fecha.getHours()
	var minuto = fecha.getMinutes()
	var segundo = fecha.getSeconds()
	if (hora < 10) {hora = "0" + hora}
	if (minuto < 10) {minuto = "0" + minuto}
	if (segundo < 10) {segundo = "0" + segundo}
	var horita = hora + ":" + minuto + ":" + segundo
	document.getElementById('Hora').firstChild.nodeValue = horita
	tiempo = setTimeout('hora()',1000)
}

function ShowHora(){
	document.write('<span id="Hora" style="float:right">')
	document.write ('000000</span>')
	hora()
}
// Pone la hora FIN *************************************************************************************************************

// Scroll en la barra de estado INICIO ******************************************************************************************
var StatusTXT="Bienvenidos a la web de Mirta Irene Audubert                                                                      "
function StatusScroll(){
	window.status = StatusTXT;
	StatusTXT = StatusTXT.substring(1, StatusTXT.length) + StatusTXT.charAt(0);
	window.setTimeout("StatusScroll()",150);
} 
// Scroll en la barra de estado FIN *********************************************************************************************

// Arrow onMouseover INICIO *****************************************************************************************************
//By Clarence Eldefors (http://www.freebox.com/cereweb) Visit http://javascriptkit.com for this and over 400+ other scripts
function imgover(imgname){ imgname.src = "images/on.gif" }
function  imgout(imgname){ imgname.src = "images/bullet-1.gif" }
// Arrow onMouseover FIN ********************************************************************************************************

// Efecto Slide left to right INICIO ********************************************************************************************
this.bTranState= (0);
function fnToggle(){
	if (pngAlpha){
		oTransContainer.filters[0].Apply();
		if  ( bTranState=='0' )
			{ bTranState = 1; oDIV2.style.visibility="visible"; oDIV1.style.visibility="hidden" ;}
		else
			{ bTranState = 0; oDIV2.style.visibility="hidden" ; oDIV1.style.visibility="visible";}
			{ oTransContainer.filters[0].Play(duration=2);}
	} else {
		if  ( bTranState=='0' )
			{ bTranState = 1; oDIV2.style.visibility="visible"; oDIV1.style.visibility="hidden" ;}
		else
			{ bTranState = 0; oDIV2.style.visibility="hidden" ; oDIV1.style.visibility="visible";}
	}
}
// Efecto Slide left to right FIN ***********************************************************************************************

// Boton Derecho Disable INICIO *************************************************************************************************
function disableRightClick(e){
  var message = "Boton derecho no soportado";
  
  if(!document.rightClickDisabled){ // initialize
    if(document.layers){
      document.captureEvents(Event.MOUSEDOWN);
      document.onmousedown = disableRightClick;
    }
    else document.oncontextmenu = disableRightClick;
    return document.rightClickDisabled = true;
  }
  if(document.layers || (document.getElementById && !document.all)){
    if (e.which==2||e.which==3){
      alert(message);
      return false;
    }
  } else {
    alert(message);
    return false;
  }
}//disableRightClick()
// Boton Derecho Disable FIN ****************************************************************************************************

// AdRotator INICIO *************************************************************************************************************
function AdRotator(){
	var how_many_ads = 3 ;
	var now = new Date( );
	var sec = now.getSeconds() ;
	var ad = sec % how_many_ads ;
	ad +=1 ;
	if (ad==1) {
		txt="Leviatan21 - Webmaster - Diseños web";
		url="http://www.leviatan21.com.ar";
		alt="Leviatan21 - Webmaster - Diseños web";
		banner="images/BannerLeviatan21.gif"; //"http://leviatan21.orgfree.com/BannerLeviatan21.gif";
		width="450";
		height="60";
	}
	
	if (ad==2) {
		txt="Titina's";
		url="http://www.titinas.com.ar";
		alt="Titina's";
		banner="http://www.titinas.com.ar/images/logo.gif";
		width="450";
		height="60";
	}
	
	if (ad==3) {
		txt="Nuestro Hosting Gratuito"; 
		url="http://www.orgfree.com/";
		alt="Nuestro Hosting Gratuito";
		banner="http://www.orgfree.com/images/header.gif";
		width="450";
		height="60";
	}
	adrhtml = '<center>';
	adrhtml += '<a href=\"' + url + '\" target=\"_blank\">';
	adrhtml += '<small>' + txt + '</small><br>';
	adrhtml += '<img src=\"' + banner + '\" width=';
	adrhtml += width + ' height=' + height + ' ';
	adrhtml += 'alt=\"' + alt + '\" border=0></a>';
	adrhtml += '</center>';
	document.getElementById("AdRotator").innerHTML = adrhtml;
	window.setTimeout("AdRotator()",5000);
}
// AdRotator FIN *****************************************************************************************************************


