// JavaScript Document

function encode(str){ // Netscape fix thanks to Cyanide_7

return escape(str.replace(/ /g,'+'));

}



function pop_adaptable(pic){

var height = screen.height;

var width = screen.width;

var leftpos = width / 2 - 200;

var toppos = height / 2 - 150;

var url = 'viewer.php?foto='+encode(pic);

window.open(url,'WIN','scrollbars=yes,status=no,toolbar=no,resizable=no,location=no,menu=no,width=600,height=350,left=' 

+ leftpos + ',top=' + toppos);

}



function pop_alquiler(pic){

var height = screen.height;

var width = screen.width;

var leftpos = width / 2 - 200;

var toppos = height / 2 - 150;

var url = 'viewerAlquiler.php?foto='+encode(pic);

window.open(url,'WIN','scrollbars=yes,status=no,toolbar=no,resizable=no,location=no,menu=no,width=600,height=350,left=' 

+ leftpos + ',top=' + toppos);

}



function pop_oferta(pic){

var height = screen.height;

var width = screen.width;

var leftpos = width / 2 - 200;

var toppos = height / 2 - 150;

var url = 'vieweroferta.php?foto='+encode(pic);

window.open(url,'WIN','scrollbars=yes,status=no,toolbar=no,resizable=no,location=no,menu=no,width=600,height=350,left=' 

+ leftpos + ',top=' + toppos);

}



function puntos(pic){

var height = screen.height;

var width = screen.width;

var leftpos = width / 2 - 200;

var toppos = height / 2 - 150;

var url = 'viewerpuntos.php?foto='+encode(pic);

window.open(url,'WIN','scrollbars=yes,status=no,toolbar=no,resizable=no,location=no,menu=no,width=600,height=350,left=' 

+ leftpos + ',top=' + toppos);

}



function redireccionar_marcas(){

	url=document.form_maestro.marcas.value;

	document.location.href=url;

}



function redireccionar_animales(){

	url=document.form_maestro.animales.value;

	document.location.href=url;

}





function Item(){

this.length = Item.arguments.length 

for (var i = 0; i < this.length; i++)

  this[i] = Item.arguments[i]

}



function Fecha() {

var ndia = new Item("Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado")

var nmes = new Item("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre")

var ahora

var fecha = new Date()

var ano = fecha.getYear()

var mes = fecha.getMonth()

var dia = fecha.getDay()

var aux = "" + fecha



if (ano<10) {

 ano2 = "200" + eval(ano)

}

else if (ano<80) {// ano tiene 2 dígitos 19xx (más de 80)

 ano2 = "20" + ano

} 

else if (ano<=99) {// ano tiene 2 dígitos 20xx (menor de 80)

 ano2 = "19" + ano

}

else if (ano<1000) {// ano tiene 3 dígitos (100 es 2000)

 ano2 = eval(ano) + eval(1900)

}

else {// ano tiene 4 dígitos

 ano2 = ano

}

ahora = ndia[dia] + " " + eval(aux.substring(7, 10)) + " de " + nmes[mes] + " " + ano2

return ahora

}





function click() {

if (event.button==2) {

alert('Copyright by TOPMASCOTA.COM');

}

}

document.onmousedown=click





function form_annadir(){

	document.annadir.submit();

}
