/**
*	swffit v2.1 (01/18/2009) <http://swffit.millermedeiros.com/>
*	Copyright (c) 2008 Miller Medeiros <http://www.millermedeiros.com/>
*	This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/
function createDiv(){
        var divTag = document.createElement("div");
        divTag.id = "div1";
        divTag.setAttribute("align","left");
       	divTag.style.margin = "0px auto";
        divTag.className ="dynamicDiv";
       	divTag.innerHTML = "<p><a href='https://www.healthonnet.org/HONcode/Spanish/?HONConduct645146' onclick='window.open(this.href); return false;' > <img src='http://www.hon.ch/HONcode/Seal/HONConduct645146_s2.gif' hspace='2' vspace='2' align='left' width='69' height='31' style='border:0px' title='Nosotros subscribimos Los Principios del código HONcode de la Fundación Salud en la Red' alt='Nosotros subscribimos Los Principios del código HONcode de la Fundación Salud en la Red' /></a> Nosotros subscribimos los <a href='http://www.healthonnet.org/HONcode/Spanish/' onclick='window.open(this.href); return false;'> Principios del código HONcode</a>. <br /><a href='https://www.healthonnet.org/HONcode/Spanish/?HONConduct645146' onclick='window.open(this.href); return false;'>Compru&eacute;belo aquí</a>.</p>";
       	document.body.appendChild(divTag);
}

var swffit=function(){

	var NS=(navigator.appName=="Netscape")?true:false,WK=(navigator.userAgent.indexOf("WebKit")>0)?true:false,UNDEF="undefined",win=window,doc=document,html=doc.getElementsByTagName("html")[0],_ft,_re,_t,_mw,_mh,_xw,_xh,_hc,_vc;
	swfobject.createCSS("object","position:relative");
	
	function fit(t,mw,mh,xw,xh,hc,vc){
		var xw=(xw)?xw:null,xh=(xh)?xh:null,hc=(hc||hc==null)?true:false,vc=(vc||vc==null)?true:false;
	
		configure({target:t,minWid:mw,minHei:mh,maxWid:xw,maxHei:xh,hCenter:hc,vCenter:vc})
	}
	
	function configure(o){
		_mw=(o.minWid)?o.minWid:_mw;
		_mh=(o.minHei)?o.minHei:_mh;
		_xw=(typeof o.maxWid!=UNDEF)?o.maxWid:_xw;
		_xh=(typeof o.maxHei!=UNDEF)?o.maxHei:_xh;
		_hc=(o.hCenter||(_hc==true&&o.hCenter==null))?true:false;
		_vc=(o.vCenter||(_vc==true&&o.vCenter==null))?true:false;
		if(o.target&&(o.target!=_t)){
			_t=o.target;
			swfobject.addDomLoadEvent(initFit)
		}else{
			startFit();
		}
	}
	
	function initFit(){
		html.style.height=doc.body.style.height="100%";
		html.style.overflow="auto";
		doc.body.style.margin=doc.body.style.padding="0";
		swfobject.createCSS("#"+_t,"width:100%; height:100%");
			if(swfobject.getObjectById(_t)){
				_ft=swfobject.getObjectById(_t)
			}else{if(NS){
				_ft=doc.getElementById(_t).getElementsByTagName("object")[0]
			}else{_ft=doc.getElementById(_t)
			}
		}
		startFit();
	}
	
	function startFit(){
		setSize();
		if(!_re){
			addResizeEvent(setSize);
			_re=1
		}
	}
	
	function stopFit(w,h){
		if(_re){
			removeResizeEvent(setSize);
			_re=0;
			_ft.style.top=_ft.style.left="auto";
			_ft.style.marginTop=_ft.style.marginLeft="0";
			var w=(w==null)?"100%":w,h=(h==null)?"100%":h;
			setWidth(w);setHeight(h);
			if(WK){
				html.focus()
			}
		}
	}
	
	function addResizeEvent(fn){
		if(win.addEventListener){
			win.addEventListener("resize",fn,false)
		}else{
			if(win.attachEvent){
				win.attachEvent("onresize",fn)
			}
		}
	}
	
	function removeResizeEvent(fn){
		if(win.removeEventListener){
			win.removeEventListener("resize",fn,false)
		}else{
			if(win.detachEvent){
				win.detachEvent("onresize",fn)
			}
		}
	}
	
	function setWidth(w){
		_ft.style.width=(isNaN(w))?w:w+"px"
	}
	
	function setHeight(h){
		_ft.style.height=(isNaN(h))?h:h+"px"
	}
	
	function setSize(){
		var iw=(NS)?win.innerWidth:doc.body.clientWidth,ih=(NS)?win.innerHeight:doc.body.clientHeight;
		if(_xw&&iw>=_xw){
			setWidth(_xw);setPosition(0,1)
		}else{
			if(iw>_mw&&(iw<_xw||!_xw)){
				setWidth("100%")
			}else{
				setWidth(_mw)}setPosition(0,0)
			}
			if(_xh&&ih>=_xh){
				setHeight(_xh);setPosition(1,1)
			}else{
				if(ih>_mh&&(ih<_xh||!_xh)){
					setHeight("100%")
				}else{
					setHeight(_mh)}setPosition(1,0)
				}
			if(WK){
				html.focus()
			}
		}
	
	function setPosition(t,m){
		if(t){
			if(m&&_vc){
				_ft.style.top="50%";
				_ft.style.marginTop=-(_xh*0.5)+"px"
			}else{
				_ft.style.top="auto";
				_ft.style.marginTop="0"
			}
		}else{
			if(m&&_hc){
				_ft.style.left="50%";
				_ft.style.marginLeft=-(_xw*0.5)+"px"
			}else{
				_ft.style.left="auto";
				_ft.style.marginLeft="0"
			}
		}
	}
	
	function getValueOf(p){
		var o={target:_t,minWid:_mw,minHei:_mh,maxWid:_xw,maxHei:_xh,hCenter:_hc,vCenter:_vc};
		return o[p]
	}
	return{fit:fit,configure:configure,startFit:startFit,stopFit:stopFit,addResizeEvent:addResizeEvent,removeResizeEvent:removeResizeEvent,getValueOf:getValueOf}
	}();
	
	