function redimensionaTaula(impresio){
	
	var taula=document.getElementById('template_taulaiframe');
	var celadreta=document.getElementById('template_tickerhold');
	var celaEsquerra=document.getElementById('template_celaEsquerra');

    var totallaterals=0;
    if (celaEsquerra!=null) totallaterals = celaEsquerra.width * 1;
    if (celadreta!=null) totallaterals = totallaterals + celadreta.width * 1;    
    if (taula!=null) {
        var altura = getDocumentHeight();
        var amplada = getDocumentWidth() - totallaterals - 40;
        taula.width = amplada;
        taula.height = altura;
    } 
    if (impresio=='True'){
		this.focus(); 
		this.print(); 
		this.close();
	} 
    return true;
}

function loadFlashOWA(){
	try {
		if (flashInstalled()){
			document.write('<OBJECT id="carrega" codeBase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" '+
							'height="150" width="150" align="middle" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" VIEWASTEXT>'+
							'<PARAM NAME="_cx" VALUE="3969">'+
							'<PARAM NAME="_cy" VALUE="3969">'+
							'<PARAM NAME="FlashVars" VALUE="">'+
							'<PARAM NAME="Movie" VALUE="/img/extranet/animaciones/carregantOWA.swf">'+
							'<PARAM NAME="Src" VALUE="/img/extranet/animaciones/carregantOWA.swf">'+
							'<PARAM NAME="WMode" VALUE="Transparent">'+
							'<PARAM NAME="Play" VALUE="0">'+
							'<PARAM NAME="Loop" VALUE="-1">'+
							'<PARAM NAME="Quality" VALUE="High">'+
							'<PARAM NAME="SAlign" VALUE="">'+
							'<PARAM NAME="Menu" VALUE="-1">'+
							'<PARAM NAME="Base" VALUE="">'+
							'<PARAM NAME="AllowScriptAccess" VALUE="sameDomain">'+
							'<PARAM NAME="Scale" VALUE="ShowAll">'+
							'<PARAM NAME="DeviceFont" VALUE="0">'+
							'<PARAM NAME="EmbedMovie" VALUE="0">'+
							'<PARAM NAME="BGColor" VALUE="5A8A94">'+
							'<PARAM NAME="SWRemote" VALUE="">'+
							'<PARAM NAME="MovieData" VALUE="">'+
							'<PARAM NAME="SeamlessTabbing" VALUE="1">'+
							'<PARAM NAME="Profile" VALUE="0">'+
							'<PARAM NAME="ProfileAddress" VALUE="">'+
							'<PARAM NAME="ProfilePort" VALUE="0">'+
							'<embed src="/img/extranet/animaciones/carregantOWA.swf" quality="high" bgcolor="#5a8a94"'+
							'	width="131" height="111" name="apropteu" align="middle" allowScriptAccess="sameDomain"'+
							'	type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"'+
							'	wmode="transparent" />'+
						'</OBJECT>');
		}else{
			document.write('<img src="/img/webmail/obrintcorreu.jpg" border="0">');
		}
	} catch(e) {
		document.write('<img src="/img/webmail/obrintcorreu.jpg" border="0">');
	}
}

function captureEnter(e, source, baseurl) 
{
    if (e.keyCode == 13)
	{
	    if (source == 'login')
        {      
			document.forms[0].action = baseurl + '/secure/login.aspx';
			document.forms[0].__VIEWSTATE.name = 'NOVIEWSTATE';
			frm_submit();
        }
        else
		{
		    if (source == 'cercador') 
		    {
		        ValidarTextoCercador("__doPostBack('template$btnCercador','')");
		    }
		    else
			{
			    if (source == 'bbiblio')
			    {
				    VFFiltresBiblio("__doPostBack('template$btnCercarFiltres','')");
				}
				else
				{
				    if (source == 'abiblio')
				    {
					   VFParaulaBiblio("__doPostBack('template$btnCercaParaula','')");
					}
				}
			}
        }
     }
}

function activarBustia(fire_postback_code){	
    var vlab = document.getElementById('capaima');
    var vtrans = document.getElementById('capatransparent');
	omplirCapaPantalla('basecapa');
	window.onresize=function capaPantalla(){ omplirCapaPantalla('basecapa'); };
	window.onscroll=function capaPantalla(){ omplirCapaPantalla('basecapa'); };
    if (!flashInstalled()){
		document.getElementById('objflash').innerHTML = '<img src="/img/webmail/activantbustia.jpg" border="0">';
    }
    vlab.style.display = 'block';
    vlab.style.visibility = 'visible';
    vtrans.style.visibility = 'visible';

    vlab.style.top = Number((getDocumentWidth() / 2) - 75) + "px";
    vlab.style.left = Number((getDocumentHeight() / 2) - 75) + "px";
    
    if (fire_postback_code != undefined){
		eval(fire_postback_code);
	}
    /*if (document.wciform.template_BA.checked){
		str = "activarbustiaDB.aspx?conn=0"
    }else{
		str = "activarbustiaDB.aspx?conn=1"
    }
    window.frames['juan'].location = str;*/
}