String.prototype.trim=function() { return this.replace(/^\s+|\s+$/g,'') ; } ; String.prototype.setChar=function(pos,c) { return this.substring(0,pos)+c+this.substr(pos+1) ; } ; Array.prototype.find=function(element) { for(var i=0 ; i=0) return 'sp2' ; if(navigator.appMinorVersion.indexOf('SP3')>=0) return 'sp3' ; return navigator.userAgent.substr(pos+5,3) ; }catch(e){return false} })() ; function hasPropertySet(objId,propertySet) { var obj=gebid(objId), propVal ; mainFor: for(var i in propertySet) { propVal=propertySet[i] ; if((attrVal=obj[i])==undefined || attrVal==null) if(obj.getAttribute) attrVal=obj.getAttribute(i) ; if(propVal instanceof RegExp) { if(!propVal.test(attrVal/*?attrVal:''*/)) return false ; } else if(propVal!=attrVal) return false ; //if(!valueMatch(propertySet[i],attrVal)) // return false ; } return true ; } function getAncestor(propertySet,objId) { var obj=gebid(objId) ; do { if(hasPropertySet(obj,propertySet)) return obj ; } while(obj=obj.parentNode) ; return null ; } function getFirstElementChild(obj){ var child=obj.firstChild ; if(child && child.nodeType!=1) child=getNextElementSibling(child) ; return child ; } function getNextElementSibling(obj){ do obj=obj.nextSibling ; while(obj && obj.nodeType!=1); return obj ; } function setPropertySet(objId,propertySet){ var obj=gebid(objId) ; for(var i in propertySet){ var valType=typeof propertySet[i] ; if(i=='style') obj.style.cssText=propertySet[i] ; else if(obj[i]==undefined && (valType=='string' || valType=='integer' || valType=='boolean')) obj.setAttribute(i,propertySet[i]) ; else obj[i]=propertySet[i] ; } } function setPropertySetToCollection(collection,propertySet){ for(var i=0 ; icerrar x" ; innerHtml += "" ; // codigo del formulario propiamente tal: lo mejor sería sacarlo de aqui innerHtml += "" ; popUp.innerHTML = innerHtml ; } var mousePos = getMousePos(E) ; popUp.style.top = mousePos.y ; popUp.style.left = mousePos.x ; popUp.style.display = 'block' ; } function adjustInnerWindowSize(){ frameElement.height=document.body.scrollHeight+10 ; frameElement.height=document.body.offsetHeight+10 ; } function replaceTagsForText(tagName,text){ var elemList = document.getElementsByTagName(tagName) ; while(elemList.length){ var textNode = document.createTextNode(text) ; elemList[0].parentNode.replaceChild(textNode,elemList[0]) ; } } function addBookmark(title,url){ if(window.sidebar){ window.sidebar.addPanel(title, url,""); }else if( document.all ){ window.external.AddFavorite( url, title); }else if( window.opera && window.print ){ return true; } } function URLObject(url,makeItAbsolute){ if(!(this instanceof arguments.callee)) return new URLObject(url) ; if(!url) url = '' ; if(makeItAbsolute){ var aElem = document.createElement('A') ; aElem.href=url ; if(!aElem.protocol) aElem.protocol = location.protocol ; var urlComps = { protocol: aElem.protocol.replace(/:$/,'') , host: aElem.hostname , port: aElem.port , path: '/'+aElem.pathname.replace(/^\//,'') , query: parseQueryString(aElem.search.replace(/^\?/,'')) , anchor: aElem.hash.replace(/^#/,'') } ; }else var urlComps = parseUrl(url) ; for(var prop in urlComps) this[prop] = urlComps[prop] ; this.getUrl = function(){ if(makeItAbsolute){ aElem.protocol = this.protocol ; aElem.hostname = this.host ; aElem.port = this.port ; aElem.pathname = this.path ; aElem.search = '?'+makeQueryString(this.query) ; aElem.hash = this.anchor ; return aElem.href ; }else return makeUrl(this) ; } ; this.addQueryParams = function(newParams){ for(var parName in newParams) addQueryParam(this.query,parName,newParams[parName]) ; return this ; } ; this.getQueryString = function(){ return makeQueryString(this.query) ; } ; this.toString = function(){ return 'protocol: '+this.protocol + '\nusername: '+this.username + '\npassword: '+this.password+'\nhost: ' + this.host+'\nport: '+this.port+'\npath: '+this.path+'\nquery: '+JSON.stringify(this.query)+'\nanchor: '+this.anchor ; } ; function parseUrl(url){ var urlObj = {}, comps2=['','','','',''] ; var comps = url.match(/^(?:(\w+):\/\/)?([^/?#]*)([^?#]*)(?:\?([^#]*))?(.*)$/) ; if(comps[2]) comps2 = comps[2].match(/^(?:([^:@]+)(?:\:([^@]*))?@)?([^:]+)(?:\:(\d+))?$/) ; if(!comps || !comps2) return {} ; return { protocol: comps[1] , username: comps2[1] , password: comps2[2] , host: comps2[3] , port: comps2[4] , path: comps[3] , query: parseQueryString(comps[4]) , anchor: comps[5].substr(1) } ; } function makeUrl(urlObj){ return function(obj){ var url='' ; if(typeof(obj)=='string') url=obj ; else if(obj instanceof Object){ for(var elemName in obj){ var elem = urlObj[elemName] if(elemName=='query') elem=makeQueryString(elem) ; if(elem) url+=arguments.callee(obj[elemName][0])+elem+arguments.callee(obj[elemName][1]) ; url+=arguments.callee(obj[elemName][2]) ; } } return url ; }({protocol:[,'://'],username:[,{password:[':',,'@']}],host:[],port:[':'],path:[],query:['?'],anchor:['#']}) ; } function addQueryParam(obj,parName,parValue){ if(obj[parName]){ if( !(obj[parName] instanceof Array) ) obj[parName] = [ obj[parName] ] ; obj[parName] = obj[parName].concat(parValue) ; }else obj[parName] = parValue ; } function parseQueryString(str){ var ret = {}, comps, varsArray = str?str.split('&'):[] ; for(var i=0 ; i