var mondomedia = mondomedia || {};

mondomedia = {

  clog: function(myDesc, myVar){
    try{console.log(myDesc, myVar);}catch(e){};
  },
  cdir: function(myObj){
    try{console.dir(myObj);}catch(e){};
  },
  
  maybeDomElement: function(obj){
    return ('tagName' in obj) && ('nodeType' in obj) && (obj.nodeType === 1);
  },
  
  navigate: function(target){
    // this.clog('typeof', typeof target);
    switch(typeof target){
      case "string":
        url = target;
        break;
      case "object":
        if(this.maybeDomElement(target)){
          switch(target.tagName){
            case "SELECT":
              if(target.options && (target.options.selectedIndex > -1)){
                val = target.options[target.options.selectedIndex].value;
                if(val) url = val;
              }
            default:
              break;
          }
        }
        break;
      default:
        url = target;
        break;
    }
    if(url) document.location.href = url;
    return false;
  }
};
