/*Para hacer un popup*/
function isUndefined(v) {
    var undef;
    return v===undef;
}

var _POPUP_FEATURES = 'location=0,statusbar=no,scrollbars=no,menubar=no,width=620,height=473';

function popup(url, target, features) {
    if (isUndefined(features)) features = _POPUP_FEATURES;
    if (isUndefined(target  )) target = '_blank';
    var theWindow = window.open(url, target, features);
    theWindow.focus();
    return theWindow;
}

/* Funciones para las flechas del menú superior */
var right_acercade='370px',right_expo='219px',right_contacto='94px';
var div_flecha='opcs';

function colocarFlecha(opcion) {
	if(opcion=='tritoma')
		document.getElementById(div_flecha).style.right=right_acercade
	if(opcion=='expo')
		document.getElementById(div_flecha).style.right=right_expo
	if(opcion=='contacto')
		document.getElementById(div_flecha).style.right=right_contacto
	document.getElementById(div_flecha).style.visibility='visible'
}
function ocultarFlecha() {
	document.getElementById(div_flecha).style.visibility='hidden'
}

function AdjustSizeImage(imgName,mw,mh){
       //mw max width
       //mh max height
       var w = imgName.width;
       var h = imgName.height;
       if (w > mw || h > mh){
           if (w > h) {
    //            alert('1 height=' + h + '; width=' + w );
                imgName.width = mw;
                imgName.height = (h * mw)/w;
                
           }else {
    //           alert('2 height=' + h + '; width=' + w );
                imgName.height  = mh;
                imgName.width = (w * mh)/h;            
            }
        }
   }