/****
* Extensible banner
**/

	    function shrinkHeaderFromWithDestination(currentValue,destHref) {
	        if (!useBigHeader) {
	            if (destHref != null && destHref != '') {
	                window.location = destHref;
	            }
             }

             else {
                 if (destHref == null) {
                     return;
                 }
	            if (currentValue <= 0) {
	                initialShrink = false;
	                window.location = destHref;
	                return;
                 }

	
		        if (currentGrwTimeout != 0) {
		            clearTimeout(currentGrwTimeout);
		            currentGrwTimeout = 0;
		        }
	
				var shrinkTimeout;
				var shrinkStep;
				if (initialShrink)
				{	
					shrinkStep = 25; //was2
					shrinkTimeout = 5; // was 100. leave at 10
				}
				else
				{
					shrinkStep = 25;
					shrinkTimeout = 5;
				}
					
				
				currentValue = currentValue - shrinkStep;
		        if (currentValue < 0)
		        { currentValue = 0; }
		        var i = kShrinkBy - currentValue;
	
				// en fmi-banner-bottompage se definen:  elMHBGCell, elBoton, elBotonGo, elMH.

		        newMhH = 370 - i;  /* 370 defined in CSS */
		        elMH.style.height = newMhH.toString() + 'px';
		        elMHBGCell.style.height = newMhH.toString() + 'px';
		        elMHBGCell.style.backgroundPosition = ('0px ' + (0 - i).toString() + 'px');
		        elBoton.style.top = (270 - i).toString() + 'px';
		        if ( (typeof(elBotonGo) != "undefined") && (elBotonGo != null)  )
			    {    elBotonGo.style.top = (334 - i).toString() + 'px';	}

                var comando = 'shrinkHeaderFromWithDestination(' + currentValue.toString() +',"'+ encodeURI(destHref) +'");';
		        currentShrTimeout = setTimeout(comando, shrinkTimeout);
		    }
	    }
	    
	    
	    
	    

	    function shrinkHeaderFromCurrentHeight(currentValue) {
	        if (currentValue < 0)
	        { return; }
	
			if (useBigHeader)
			{
	
		        if (currentGrwTimeout != 0) {
		            clearTimeout(currentGrwTimeout);
		            currentGrwTimeout = 0;
		        }
	
				var shrinkTimeout;
				var shrinkStep;
				if (initialShrink)
				{	
					shrinkStep = 7; //was2
					shrinkTimeout = 5; // was 100. leave at 10
				}
				else
				{
					shrinkStep = 7;
					shrinkTimeout = 5;
				}
					
				
				currentValue = currentValue - shrinkStep;
		        if (currentValue < 0)
		        { currentValue = 0; }
		        var i = kShrinkBy - currentValue;
	
		        newMhH = 370 - i;  /* 370 defined in CSS */
		        elMH.style.height = newMhH.toString() + 'px';
		        elMHBGCell.style.height = newMhH.toString() + 'px';
		        elMHBGCell.style.backgroundPosition = ('0px ' + (0 - i).toString() + 'px');
		        elBoton.style.top = (270 - i).toString() + 'px';
	
		        if (currentValue > 0)
		        { currentShrTimeout = setTimeout('shrinkHeaderFromCurrentHeight(' + currentValue.toString() + ')', shrinkTimeout); }
		        else { initialShrink = false; }
		    }
	    }
	    
	    

	    function growHeaderTo220From(currentValue) {
	        if (currentValue > kShrinkBy )
	        { return; }

	        if (currentShrTimeout != 0) {
	            clearTimeout(currentShrTimeout);
	            currentShrTimeout = 0;
	        }

	        currentValue += 5;
	        if (currentValue > kShrinkBy )
	        { currentValue = kShrinkBy ; }
	        var i = kShrinkBy - currentValue;

	        var elMHBGCell = document.getElementById("mastheadBackgroundCell");
	        var elBoton = document.getElementById("selloFlotante");
	        var elBotonGo = document.getElementById("selloFlotanteGo");
	        var elMH = document.getElementById("masthead");


	        var newMhH = 370 - i;  /* 370 defined in CSS */
	        elMH.style.height = newMhH.toString() + 'px';
	        elMHBGCell.style.height = newMhH.toString() + 'px';
	        elMHBGCell.style.backgroundPosition = ('0px ' + (0 - i).toString() + 'px');
	        elBoton.style.top = (270 - i).toString() + 'px';
	        if ( (typeof(elBotonGo) != "undefined") && (elBotonGo != null)  )
			{   elBotonGo.style.top = (334 - i).toString() + 'px';   }

	        if (currentValue < kShrinkBy)
	        { currentGrwTimeout = setTimeout('growHeaderTo220From(' + currentValue.toString() + ')', 10); }
	    }






	    function shrinkHeader(e) {
//	        alert ("achicando");
	        var sender = (e && e.target) || (window.event && window.event.srcElement);

	        if (sender.href != null) {
               shrinkHeaderFromWithDestination(220, sender.href);
	        }
	    }






	    function generateGalleryHtmlObjectTag() {
	        var dataFileLocation = location.pathname.substring(0, location.pathname.lastIndexOf('/') + 1) + 'data.xml';
	        var confFileLocation = location.pathname.substring(0, location.pathname.lastIndexOf('/') + 1) + '../jobsGalleryConf.xml';
	        var objHtml = '<object id="imagenes" type="application/x-silverlight-2" data="data:application/x-silverlight-2," '
							+ 'class="estiloObjGaleriaImgComercial estiloObjGaleriaImgComercialAlto estiloObjGaleriaImgComercialAncho" > '
							+ '<param name="background" value="#f1ede2" />'
							+ '<param name="minRuntimeVersion" value="3.0.40624" />'
							+ '<param name="autoUpgrade" value="true" />'
							+ '<param name="source" value="../../ClientBin/Vertigo.SlideShow.xap" />'
							+ '<param name="initParams" '
							+ 'value="ConfigurationProvider=XmlConfigurationProvider;Path='
							+ confFileLocation
							+ ',DataProvider=XmlDataProvider;Path='
							+ dataFileLocation
							+ ';Album=0;SlideIndex=0" />'
							+ '<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration: none;">'
							+ '<img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style: none" />'
							+ '</a>  </object>';
	        return (objHtml);
	    }

