function extension(what) {
var ext = what.value.substr(what.value.length - 3,3).toLowerCase();
switch (ext) {
case 'jpg':
case 'peg':
case 'png':
case 'gif':
case 'bmp':
document.getElementById('tamano').style.display='';
document.getElementById('extensionerror').style.display='none';
document.getElementById('boton').disabled=false;
document.getElementById('boton').value='ENVIAR ARCHIVO';
break;
case '':
default:
document.getElementById('tamano').style.display='none';
document.getElementById('extensionerror').style.display='';
document.getElementById('boton').disabled=true;
document.getElementById('boton').value='formato no valido';
break;
}
}
function desactivar (what) {
	what = document.getElementById(what);
	what.disabled = true;
	what.value="subiendo archivo...";
}


function Mostrar(id) 
{
	var res = expMenu(id);
}

function expMenu(id) 
{
	var itm = null;
	if (document.getElementById) 
	{
		itm = document.getElementById(id);
	}
	else if (document.all)
	{
		itm = document.all[id];
	} 
	else if (document.layers)
	{
		itm = document.layers[id];
	}
	if (!itm) 
	{
		// do nothing
	}
	else if (itm.style) 
	{
		if (itm.style.display == "none")
		{ 
			itm.style.display = ""; 
			return 1;
		}
		else
		{
			itm.style.display = "none"; 
			return 2;
		}
	}
	else 
	{
		itm.visibility = "show"; 
		return 1;
	}
}

var saveWidth = 0;
function aEscala(what){
what = document.getElementById(what);
if (navigator.appName=="Netscape")
winW = window.innerWidth;
if (navigator.appName.indexOf("Microsoft")!=-1)
winW = document.body.offsetWidth;
if (what.width>(winW-100) || saveWidth>(winW-100)) {
if (what.width==(winW-100))
what.width=saveWidth;

else
{
saveWidth = what.width;
what.style.cursor = "pointer";
what.width=(winW-100);
escala("block");
}

}
}

function escala(how) {
document.getElementById('escalainfo').style.display=how;
}

function postear(formulario)
{
	window.open("","vota","width=400,height=100,scrollbars=no,toolbar=no,status=no");
	formulario.submit();
}

function zoom(dim1, dim2){
	if(dim1){
		if(document.images["imagen"].width < oW){
			document.images["imagen"].width   = oW;
		} else {
			document.images["imagen"].width  += dim1;
		}
		if(dim1 < 0){
			if(document.images["imagen"].width < oW){
				document.images["imagen"].width   = oW;
			}
		}
	} else {
		document.images["imagen"].width   = oW;
	}
}

var copytoclip=1
function Copiartxt(theField) {
var tempval=eval("document."+theField)
tempval.focus()
tempval.select()
if (document.all&&copytoclip==1){
therange=tempval.createTextRange()
therange.execCommand("Copy")
window.status="Se ha conseguido copiar todo el contenido a tu portapapeles"
setTimeout("window.status=''",3800)
} else { alert('Cierra esta ventana y pulsa \'CONTROL+C\' para copiar el texto seleccionado'); }
}
function resaltar(field) {
	field.focus();
  	field.select();
}
function zoomimg(obj) {
	var zoom=parseInt(obj.style.zoom,10) || 100;
	zoom += event.wheelDelta / 24;
	imgW = obj.clientWidth*zoom/100;
	if (zoom>15 && imgW<1200) obj.style.zoom = zoom + "%";
	return false;
}