function setHomepage(urlText) {
	if (document.all) {
		document.body.style.behavior='url(#default#homepage)';
		document.body.setHomePage(urlText);
	} else if (window.sidebar) {
		if(window.netscape) {
			try {
				netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");  
			} catch(e) {  
				alert("Tu navegador no permite esta accion, entra en el panel de opciones y configuralo desde alli.");
				// this action was aviod by your browser,if you want to enable,please enter about:config in your address line,and change the value of signed.applets.codebase_principal_support to true
			}
		} 
		
		var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
		prefs.setCharPref('browser.startup.homepage',urlText);
	}
}
	
function getStyle(el,styleProp) {
	var x = document.getElementById(el);
	var y;
	//alert(document.defaultView.getComputedStyle(x, null).getPropertyValue("height"));
	
	if (x.currentStyle)
		y = x.currentStyle[styleProp];
	else if (window.getComputedStyle) {
		switch(styleProp) {
			case 'paddingTop':
				styleProp = 'padding-top';
				break;
			case 'paddingBottom':
				styleProp = 'padding-bottom';
				break;
		}
		y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);
	}
	
	return y;
}

function checkBanner(bannerID) {
	paddingHeight = parseInt(getStyle(bannerID, 'paddingTop')) + parseInt(getStyle(bannerID, 'paddingBottom'));
	//console.log(" -- %s: %s", bannerID, document.getElementById(bannerID).offsetHeight);
	if ( document.getElementById(bannerID).offsetHeight < 60 ) {
	// Era : if ( document.getElementById(bannerID).offsetHeight == paddingHeight ) {
		//console.log(" -- -- %s", 'Pa dentro');
		document.getElementById(bannerID).style.display = "none";
	}
}

function checkBanners() {
	bannersList = document.getElementsByTagName('div');
	
	for (i=0; i<bannersList.length; i++) {
		if (bannersList[i].id.indexOf('publicidad-') == 0) {
			//console.log("%s", bannersList[i].id);
			checkBanner(bannersList[i].id);
		}
	}
}

function checkBanners_sto() {
	setTimeout('checkBanners()', 2000);
}

//window.onload = checkBanners;

