//CSS_ONTHEFLY_BH
var CSS_OTF;
function createCss(){
	try{
		CSS_OTF = document.createStyleSheet();
	}catch(e){
		var css = document.createElement("style");
		document.getElementsByTagName("head")[0].appendChild(css)
		CSS_OTF = document.styleSheets[document.styleSheets.length -1]
	}
}
createCss();


//AP_BH
LOAD_STATUS_TEXT = "<div id=\"cargando\" class=\"preload\"><img src=\"/im/loading.gif\" alt=\"cargando\"><p>Cargando...</p></div>";

function behaviour_apply() {
   Behaviour.apply();
}

function isExplorer(){
   if ((navigator.appName=="Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>=4)) return true;
   else if(navigator.appName == "Netscape") return false;   
   else return false;   
}

var rules_home = {
  'a.sethome' : function(cli){
    cli.onclick = function(){
        if (isExplorer()){
            this.style.behavior='url(#default#homepage)'; 
            this.setHomePage('http://www.wradio.com.mx');
        }
         return false;
    }
  },
  'a.AbrirCorreo' : function(cli){
		cli.onclick = function(){
		var para = this.href.split("?")[1];
		var smail= para.split("&")[0];
		var sasunto= para.split("&")[1];

		 return false;
    }
  },

  'a.setfav' : function(cli){
    cli.onclick = function(){
        if (window.sidebar&&window.sidebar.addPanel)
            window.sidebar.addPanel("wradio.com.mx - Portada","http://www.wradio.com.mx","");
        else
            window.external.AddFavorite("http://www.wradio.com.mx", "wradio.com.mx - Portada");
        return false;
    }
  }

};

Behaviour.register(rules_home);


var rules_publi= {
	'a.PuBl' : function(el){
		el.onclick = function(){
			var url = this.href;
			var esDeCod = url.match(/\?/g);
			var argsDec = url.split("?")[1];		
			var aP      = argsDec.split("ap=")[1];
			ajaxpage('pubx.asp?id='+aP,'lector');
			return false;
			event.returnValue=false;
		}
	}

};
Behaviour.register(rules_publi);


function prevModule(node){
    while(node.id.indexOf("ale_")==-1){
        node = node.parentNode
    }
    node.style.display="none";

    var sibling=node;
    do {
        sibling = sibling.previousSibling;
        if (!sibling) sibling=node.parentNode.lastChild;
    } while (sibling.nodeType!=1)

    sibling.style.display="block";
    //modShow(sibling.id);
    return false;
}

function nextModule(node){
    while(node.id.indexOf("ale_")==-1){
        node = node.parentNode;
    }
    node.style.display="none";

    var sibling=node;
    do {
        sibling = sibling.nextSibling;
        if (!sibling) sibling=node.parentNode.firstChild;
    } while (sibling.nodeType!=1)

    sibling.style.display="block";
    //modShow(sibling.id);
    return false;
}