function change(cal){ var url = document.getElementById(cal).src; // alert(url); if(url.indexOf("off")>=0){ url = url.replace('off','on'); document.getElementById(cal).src = url; }else{ url = url.replace('on','off'); document.getElementById(cal).src = url; } }// JavaScript Document function video(archi,id) { flashembed("playerContent"+id, {src:'swf/FlowPlayerDark.swf',width: 350,height: 300, wmode: 'transparent'}, { config: { hideControls: false, controlsOverVideo:'yes', usePlayOverlay:true, autoPlay:false, showPlayButton:true, initialScale:'scale', videoFile: '/'+archi } } ); } function dobleClickOrden(idEntidad, parametros){ jQuery("#bannerFormId_"+idEntidad).hide() jQuery("#outBannerFormId_"+idEntidad).show().load("_ordenPersonalizedForm.php", parametros); } // Funcion que devuelve el tamaƱo de una imagen, se le pasa el id como parametro function getImgSize(imgSrc) { var img = document.getElementById(imgSrc); var height = img.height; var width = img.width; return [width, height]; } function tamanoAutomatico( imgSrc, contenedor ){ //Extraigo la relacion del contenedor (ancho/alto) altoContenedor = document.getElementById(contenedor).getAttribute('height') - 5; anchoContenedor = document.getElementById(contenedor).getAttribute('width') - 5; ratioContenedor = altoContenedor/anchoContenedor; //Extraigo la relacion de la imagen (ancho/alto) imgSize = getImgSize(imgSrc); ratioImg = imgSize[0] / imgSize[1] //Si la relacion de la imagen es mayor a la del contenedor //Limitar en ancho if (ratioImg > ratioContenedor) { return ["width", anchoContenedor]; } //Sino limitar en alto else { return ["height", altoContenedor]; } }