document.write('<div id="AdsDiv" style="text-align: center; margin: 0px; padding: 0px;" align="center"></div>');
ExecFlag = "hand-made-copy";
AdsUrl = "http://hosting.miarroba.com/ads.php";
function GetAdsIframe(src, width)
{
	return '<iframe id="AdsIframe" name="AdsIframe" src="'+src+'" height="100" width="'+width+'" frameborder="0" marginwidth="0" marginheight="0" allowtransparency="true"></iframe>';
}

PosControlArray = new Array();

function ObjRepos(ParseObj, ObjProperty) 
{
	AuxString = new String(ObjProperty);
	ObjPropertyValue = AuxString.substr(0,AuxString.indexOf('px')) * 1 + 100;
	if (ParseObj.style.top == "" && !ParseObj.style.marginTop) 
	{
	ParseObj.style.marginTop = "0px";
	ParseObj.style.paddingTop = "0px";
	}
	if ((AuxString.substr(0,AuxString.indexOf('px')) * 1 < 100) || (!PosControlArray[ParseObj]) ) 
	{
	ObjPropertyValue = (ObjPropertyValue<100) ? 100 : ObjPropertyValue ;
	ParseObj.style.top = ObjPropertyValue+"px" ;
	PosControlArray[ParseObj] = 1 ;
	}	
}

function CheckAdsDisplayed(width) 
{
	if (!document.getElementById('AdsIframe') || document.getElementById("AdsIframe").src != AdsUrl) 
	{
	window.location.href="http://www.miarroba.com"
	}
	PropertyName = new Array();
	PropertyValue = new Array();
	PropertyName["AdsDiv"] = new Array();
	PropertyValue["AdsDiv"] = new Array();
	PropertyName["AdsIframe"] = new Array();
	PropertyValue["AdsIframe"] = new Array();
	PropertyName["AdsDiv"][0] = "style.display" ;
	PropertyValue["AdsDiv"][0] = "block" ;
	PropertyName["AdsDiv"][1] = "style.height";
	PropertyValue["AdsDiv"][1] = "100px";
	PropertyName["AdsDiv"][2] = "style.width";
	PropertyValue["AdsDiv"][2] = width+"px";
	PropertyName["AdsDiv"][3] = "style.visibility";
	PropertyValue["AdsDiv"][3] = "visible";
	PropertyName["AdsDiv"][4] = "style.margin";
	PropertyValue["AdsDiv"][4] = "0px";
	PropertyName["AdsIframe"][0] = "style.display" ;
	PropertyValue["AdsIframe"][0] = "block" ;
	PropertyName["AdsIframe"][1] = "style.height";
	PropertyValue["AdsIframe"][1] = "100px";
	PropertyName["AdsIframe"][2] = "style.width";
	PropertyValue["AdsIframe"][2] = width+"px";
	PropertyName["AdsIframe"][3] = "style.visibility";
	PropertyValue["AdsIframe"][3] = "visible";
	PropertyName["AdsIframe"][4] = "style.margin";
	PropertyValue["AdsIframe"][4] = "0px";
	
	for (var j in PropertyName) 
	{
		for (var i = 0 ; i < PropertyName[j].length ; i++) 
		{
			if (!eval('document.getElementById("'+j+'")')) {break;}
			if (eval('document.getElementById("'+j+'").'+PropertyName[j][i]+' != "'+PropertyValue[j][i]+'"')) 
			{
				eval('document.getElementById("'+j+'").'+PropertyName[j][i]+' = "'+PropertyValue[j][i]+'"');
			}
		}
	}
	PropertyName2 = new Array();
	PropertyValue2 = new Array();
	PropertyName2["body"] = new Array();
	PropertyValue2["body"] = new Array();
	PropertyName2["body"][0] = "style.marginTop";
	PropertyValue2["body"][0] = "0px" ;
	PropertyName2["body"][1] = "style.paddingTop";
	PropertyValue2["body"][1] = "0px" ;
	for (var j in PropertyName2) 
	{
		eval ('ObjectColection = document.getElementsByTagName("'+j+'");');
		for (var k = 0 ; k < ObjectColection.length ; k++) 
		{
			for (var i = 0 ; i < PropertyName2[j].length ; i++) 
			{
				if (!eval('document.getElementsByTagName("'+j+'")')) {break;}
				if (eval('document.getElementsByTagName("'+j+'")['+k+'].'+PropertyName2[j][i]+' != "'+PropertyValue2[j][i]+'"')) 
				{
					eval('document.getElementsByTagName("'+j+'")['+k+'].'+PropertyName2[j][i]+' = "'+PropertyValue2[j][i]+'"');
				}
			}
		}
	}
	ObjectColection = document.getElementsByTagName("div");
	for (var i = 0 ; i < ObjectColection.length ; i++) 
	{
		if (document.all) 
		{
			if ( ((ObjectColection[i].currentStyle.position == "absolute") || (ObjectColection[i].currentStyle.position == "fixed")) &&  ( ObjectColection[i].parentNode.currentStyle.position != "relative" && ObjectColection[i].parentNode.currentStyle.position != "absolute" ) ) 
			{
				ObjRepos(ObjectColection[i], ObjectColection[i].offsetTop + "px");
			}
		}else 
		{
			if ( ((document.defaultView.getComputedStyle(ObjectColection[i], '').getPropertyValue("position") == "absolute") || (document.defaultView.getComputedStyle(ObjectColection[i], '').getPropertyValue("position") == "fixed")) && ( document.defaultView.getComputedStyle(ObjectColection[i].parentNode, '').getPropertyValue("position") != "relative" && document.defaultView.getComputedStyle(ObjectColection[i].parentNode, '').getPropertyValue("position") != "absolute") ) 
			{
				ObjRepos(ObjectColection[i], document.defaultView.getComputedStyle(ObjectColection[i],'').getPropertyValue("top"));
			}
		}
	}
	
	setTimeout("CheckAdsDisplayed("+width+")", 500);
}

function DisplayAdds() 
{
	width = (document.body.clientWidth > 770) ? document.body.clientWidth : 770 ;
	width -= 20;
	AdsContent = GetAdsIframe(AdsUrl, width);
	if (!this.document.getElementsByTagName("frameset")[0]) 
	{
		document.getElementById("AdsDiv").innerHTML = AdsContent;
		CheckAdsDisplayed(width);
	}
}

function AD_clientWindowSize() {
	var sfMax=0;
	var sf,frameMax;
	var ad=1;
		
	if (self.innerWidth) {
		AD_windowWidth=self.innerWidth;
		AD_windowHeight=self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientWidth) {
		AD_windowWidth=document.documentElement.clientWidth;
		AD_windowHeight=document.documentElement.clientHeight;
	} else if (document.body) {
		AD_windowWidth=document.body.clientWidth;
		AD_windowHeight=document.body.clientHeight;
	}
	if (document.layers||navigator.userAgent.toLowerCase().indexOf("gecko")>=0) AD_windowWidth-=16;

	if ( top !=self || (top.frames.length !=0 && (top.frames.length>self.document.getElementsByTagName('iframe').length) ) ) {
		ad=0;
		if (document.all) {
			sf=(top.document.body.clientWidth * top.document.body.clientHeight) / (self.document.body.clientWidth * self.document.body.clientHeight);
			if (sf<3) {
				ad=1;
			}
		} else {
			function getSurface(w) 
			{
				
					if (!w.sf) {
						w.sf=w.innerWidth * w.innerHeight;
					}
					if ( w.sf && (w.sf >=sfMax) ) {
						sfMax=w.sf; 
						frameMax=w;
					}

			}
			function findFrameMax(w) {
				var i;				
				if (w.frames.length==0) {
					getSurface(w);
				} else {
					for (i=0; i < w.frames.length; i++) {
						try
						{
							if (w.frames[i].frames.length > 0 && w.frames[i].document.getElementsByTagName('iframe').length==0) {						
									findFrameMax(w.frames[i]);
							} else {	
								getSurface(w.frames[i]);
							}
						}catch(e){}
					}
				}
			}
			if ((top !=self) || (top.frames.length==0)) {
				findFrameMax(top);
				if (frameMax==self) ad=1;
			}
		}
	}
	if (AD_windowWidth<480){ ad=0;}
	if (AD_windowHeight<80){ ad=0;}
	return ad;
}
function checkBodyLoad()
{
	if(document.getElementsByTagName('body').length>0)
	{
		clearInterval(LoadAdsInterval);
		if(ExecFlag != 'ExecStopValue')
		{
			ExecFlag = 'ExecStopValue';
			if(AD_clientWindowSize()>0)
			{
				DisplayAdds();
			}
		}
	}
}
var LoadAdsInterval = setInterval('checkBodyLoad()',10);
document.getElementById('miarrobacompactads').parentNode.removeChild(document.getElementById('miarrobacompactads'));
