function url(uri) {
  location.href = uri;
}

function url_new(uri) {
  window.open(uri); return false;
}

var form1=new Array()
form1[0]=new Image()
form1[0].src="img/btn_1.jpg"
form1[1]=new Image()
form1[1].src="img/btn_1_over.jpg"
form1[2]=new Image()
form1[2].src="img/btn_2.jpg"
form1[3]=new Image()
form1[3].src="img/btn_2_over.jpg"
form1[4]=new Image()
form1[4].src="img/btn_3.jpg"
form1[5]=new Image()
form1[5].src="img/btn_3_over.jpg"
form1[6]=new Image()
form1[6].src="img/btn_4.jpg"
form1[7]=new Image()
form1[7].src="img/btn_4_over.jpg"
form1[8]=new Image()
form1[8].src="img/btn_5.jpg"
form1[9]=new Image()
form1[9].src="img/btn_5_over.jpg"
form1[10]=new Image()
form1[10].src="img/btn_6.jpg"
form1[11]=new Image()
form1[11].src="img/btn_6_over.jpg"

function imgChange(name,img) { 
    document.images[name].src = form1[img].src;
    document[name].src = form1[img].src;
}

function imgView(view) {
  window.open(view,'img','width=100, height=100, left=0, top=0, scrollbars=1, resize=1');
}

function filter(id,value,value1) {
 document.getElementById(id).style.filter='Alpha(opacity='+value+')';
 document.getElementById(id).style.opacity=value1;
}

function validar(){
	var oForm = document.forms['contacto'];
	if(oForm.nombre.value == '') {
  		alert('Debe ingresar el nombre de quien realiza la consulta.');
    	return false
  	}
	
	if(oForm.email.value != '' && !BuscaEmail(oForm.email.value)) {
  		alert('El mail ingresdo no es valido, recuerde que debe tener este formato "mimail@empresa.com". Compruebe que los datos son correctos');
    	return false
  	}
	
	if(oForm.email.value == '' && oForm.tel.value == '') {
  		alert('Debe ingresar un numero telefonico o un mail para poder contactarnos con usted.');
    	return false
  	}
	
	if(oForm.coment.value == '') {
  		alert('No ha escrito ninguna consulta y por lo tanto no se podra enviar la consulta. rellene el campo y vuelva a intentarlo.');
    	return false
  	}
	
	//Si esta todo OK entonces recien ahi ejecuto el submit
  	document.forms['contacto'].submit()
} 



function muestra_imagen(ancho,alto){
	xWidth ('ampliacion',ancho + 6)
	xHeight ('ampliacion',alto + 6 + 20 + 18)
	xWidth ('c1',ancho)
	xHeight ('c1',alto)
	xWidth ('cerrarampliacion',ancho)
	
	
	//xInnerHtml('c1','<img src="' + archivo + '" width="' + ancho + '" height="' + alto + '" border="0">')	
		
	pos_left = parseInt((xClientWidth()-ancho+3)/2)
	pos_top = xScrollTop() + parseInt((xClientHeight()-alto-300)/2)
	//if (pos_top>150) pos_top = 150
	if (pos_top<10) pos_top=10
	xMoveTo('ampliacion',pos_left,pos_top)
	
	
	setTimeout("xShow('ampliacion')",50)
}

function cerrar_ampliacion(){
	xHide('ampliacion');
	
}

