﻿
function objx() {
    this.isReady = false;
    this.isCompleted = false;
}

objx.prototype =
{
    Ready : function(fn)
    {   
    	if ( this.isReady ) return;
	         this.isReady = true;
	         // If Mozilla/Opera is used
	    if (document.addEventListener)
	    {
	        document.addEventListener("DOMContentLoaded", fn, false);

		}
		// If Internet is used
		if ( this.Browser.IsIE())(function(){
		    if (this.isCompleted){
		         return ;}
		        try {
			            // If IE is used, use the trick by Diego Perini
			            // http://javascript.nwbox.com/IEContentLoaded/
			            document.documentElement.doScroll("left");
		        }
		     catch( error ) {
			        setTimeout( arguments.callee, 0 );
			        return;
		     }
		     
		    this.isCompleted = true;
		    fn.call(document);

		    
})();
    //aqui codigo para validacion con otros navegadores
if (!this.Browser.IsIE() && !document.addEventListener)
{
    document.addEventListener("load", fn, false);

}
    },
    Browser:
    {
         IsIE : function (){;

          if ((i = navigator.userAgent.indexOf("MSIE")) >= 0){ 
                return true; 
             }
          else{
                return false;
             }
         },
         IsMozilla : function(){
          if ((i = navigator.userAgent.indexOf("Gecko")) >= 0  )   
          {
            return true;
          }
          else
          {
            return false;
          }         
         },
         IsOpera:function(){
          if ((i = ua.indexOf("Opera")) >= 0)
          {
            return true;
          }
          else
          {
            return false;
          }
         }
    }
}
var  _objHome = new objx();
