function get_css(rule_name,stylesheet,delete_flag){if(!document.styleSheets)return false;rule_name=rule_name.toLowerCase();stylesheet=stylesheet||0;for(var i=stylesheet;i<document.styleSheets.length;i++){var styleSheet=document.styleSheets[i];css_rules=document.styleSheets[i].cssRules||document.styleSheets[i].rules;if(!css_rules)continue;var j=0;do{if(css_rules[j].selectorText.toLowerCase()==rule_name){if(delete_flag==true){if(document.styleSheets[i].removeRule)document.styleSheets[i].removeRule(j);if(document.styleSheets[i].deleteRule)document.styleSheets[i].deleteRule(j);return true;}
else return css_rules[j];}}
while(css_rules[++j]);}
return false;}
function add_css(rule_name,stylesheet){if(!document.styleSheets||get_css(rule_name))return false;rule_name=rule_name.toLowerCase();stylesheet=stylesheet||0;(document.styleSheets[stylesheet].addRule)?document.styleSheets[stylesheet].addRule(rule_name,null,0):document.styleSheets[stylesheet].insertRule(rule_name+' { }',0);return get_css(rule_name);}
function get_sheet_num(href_name){if(!document.styleSheets)return false;for(var i=0;i<document.styleSheets.length;i++){if(document.styleSheets[i].href&&document.styleSheets[i].href.toString().match(href_name))return i;}
return false;}
function remove_css(rule_name,stylesheet){return get_css(rule_name,stylesheet,true);}
function Sarissa(){}
Sarissa.VERSION="0.9.9.4";Sarissa.PARSED_OK="Document contains no parsing errors";Sarissa.PARSED_EMPTY="Document is empty";Sarissa.PARSED_UNKNOWN_ERROR="Not well-formed or other error";Sarissa.IS_ENABLED_TRANSFORM_NODE=false;Sarissa.REMOTE_CALL_FLAG="gr.abiss.sarissa.REMOTE_CALL_FLAG";Sarissa._lastUniqueSuffix=0;Sarissa._getUniqueSuffix=function(){return Sarissa._lastUniqueSuffix++;};Sarissa._SARISSA_IEPREFIX4XSLPARAM="";Sarissa._SARISSA_HAS_DOM_IMPLEMENTATION=document.implementation&&true;Sarissa._SARISSA_HAS_DOM_CREATE_DOCUMENT=Sarissa._SARISSA_HAS_DOM_IMPLEMENTATION&&document.implementation.createDocument;Sarissa._SARISSA_HAS_DOM_FEATURE=Sarissa._SARISSA_HAS_DOM_IMPLEMENTATION&&document.implementation.hasFeature;Sarissa._SARISSA_IS_MOZ=Sarissa._SARISSA_HAS_DOM_CREATE_DOCUMENT&&Sarissa._SARISSA_HAS_DOM_FEATURE;Sarissa._SARISSA_IS_SAFARI=navigator.userAgent.toLowerCase().indexOf("safari")!=-1||navigator.userAgent.toLowerCase().indexOf("konqueror")!=-1;Sarissa._SARISSA_IS_SAFARI_OLD=Sarissa._SARISSA_IS_SAFARI&&(parseInt((navigator.userAgent.match(/AppleWebKit\/(\d+)/)||{})[1],10)<420);Sarissa._SARISSA_IS_IE=document.all&&window.ActiveXObject&&navigator.userAgent.toLowerCase().indexOf("msie")>-1&&navigator.userAgent.toLowerCase().indexOf("opera")==-1;Sarissa._SARISSA_IS_OPERA=navigator.userAgent.toLowerCase().indexOf("opera")!=-1;if(!window.Node||!Node.ELEMENT_NODE){Node={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12};}
if(Sarissa._SARISSA_IS_SAFARI_OLD){HTMLHtmlElement=document.createElement("html").constructor;Node=HTMLElement={};HTMLElement.prototype=HTMLHtmlElement.__proto__.__proto__;HTMLDocument=Document=document.constructor;var x=new DOMParser();XMLDocument=x.constructor;Element=x.parseFromString("<Single />","text/xml").documentElement.constructor;x=null;}
if(typeof XMLDocument=="undefined"&&typeof Document!="undefined"){XMLDocument=Document;}
if(Sarissa._SARISSA_IS_IE){Sarissa._SARISSA_IEPREFIX4XSLPARAM="xsl:";var _SARISSA_DOM_PROGID="";var _SARISSA_XMLHTTP_PROGID="";var _SARISSA_DOM_XMLWRITER="";Sarissa.pickRecentProgID=function(idList){var bFound=false,e;var o2Store;for(var i=0;i<idList.length&&!bFound;i++){try{var oDoc=new ActiveXObject(idList[i]);o2Store=idList[i];bFound=true;}catch(objException){e=objException;}}
if(!bFound){throw"Could not retrieve a valid progID of Class: "+idList[idList.length-1]+". (original exception: "+e+")";}
idList=null;return o2Store;};_SARISSA_DOM_PROGID=null;_SARISSA_THREADEDDOM_PROGID=null;_SARISSA_XSLTEMPLATE_PROGID=null;_SARISSA_XMLHTTP_PROGID=null;XMLHttpRequest=function(){if(!_SARISSA_XMLHTTP_PROGID){_SARISSA_XMLHTTP_PROGID=Sarissa.pickRecentProgID(["Msxml2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"]);}
return new ActiveXObject(_SARISSA_XMLHTTP_PROGID);};Sarissa.getDomDocument=function(sUri,sName){if(!_SARISSA_DOM_PROGID){_SARISSA_DOM_PROGID=Sarissa.pickRecentProgID(["Msxml2.DOMDocument.6.0","Msxml2.DOMDocument.3.0","MSXML2.DOMDocument","MSXML.DOMDocument","Microsoft.XMLDOM"]);}
var oDoc=new ActiveXObject(_SARISSA_DOM_PROGID);if(sName){var prefix="";if(sUri){if(sName.indexOf(":")>1){prefix=sName.substring(0,sName.indexOf(":"));sName=sName.substring(sName.indexOf(":")+1);}else{prefix="a"+Sarissa._getUniqueSuffix();}}
if(sUri){oDoc.loadXML('<'+prefix+':'+sName+" xmlns:"+prefix+"=\""+sUri+"\""+" />");}else{oDoc.loadXML('<'+sName+" />");}}
return oDoc;};Sarissa.getParseErrorText=function(oDoc){var parseErrorText=Sarissa.PARSED_OK;if(oDoc&&oDoc.parseError&&oDoc.parseError.errorCode&&oDoc.parseError.errorCode!=0){parseErrorText="XML Parsing Error: "+oDoc.parseError.reason+"\nLocation: "+oDoc.parseError.url+"\nLine Number "+oDoc.parseError.line+", Column "+
oDoc.parseError.linepos+":\n"+oDoc.parseError.srcText+"\n";for(var i=0;i<oDoc.parseError.linepos;i++){parseErrorText+="-";}
parseErrorText+="^\n";}
else if(oDoc.documentElement===null){parseErrorText=Sarissa.PARSED_EMPTY;}
return parseErrorText;};Sarissa.setXpathNamespaces=function(oDoc,sNsSet){oDoc.setProperty("SelectionLanguage","XPath");oDoc.setProperty("SelectionNamespaces",sNsSet);};XSLTProcessor=function(){if(!_SARISSA_XSLTEMPLATE_PROGID){_SARISSA_XSLTEMPLATE_PROGID=Sarissa.pickRecentProgID(["Msxml2.XSLTemplate.6.0","MSXML2.XSLTemplate.3.0"]);}
this.template=new ActiveXObject(_SARISSA_XSLTEMPLATE_PROGID);this.processor=null;};XSLTProcessor.prototype.importStylesheet=function(xslDoc){if(!_SARISSA_THREADEDDOM_PROGID){_SARISSA_THREADEDDOM_PROGID=Sarissa.pickRecentProgID(["MSXML2.FreeThreadedDOMDocument.6.0","MSXML2.FreeThreadedDOMDocument.3.0"]);}
xslDoc.setProperty("SelectionLanguage","XPath");xslDoc.setProperty("SelectionNamespaces","xmlns:xsl='http://www.w3.org/1999/XSL/Transform'");var converted=new ActiveXObject(_SARISSA_THREADEDDOM_PROGID);try{converted.resolveExternals=true;converted.setProperty("AllowDocumentFunction",true);}
catch(e){}
if(xslDoc.url&&xslDoc.selectSingleNode("//xsl:*[local-name() = 'import' or local-name() = 'include']")!=null){converted.async=false;converted.load(xslDoc.url);}
else{converted.loadXML(xslDoc.xml);}
converted.setProperty("SelectionNamespaces","xmlns:xsl='http://www.w3.org/1999/XSL/Transform'");var output=converted.selectSingleNode("//xsl:output");if(output){this.outputMethod=output.getAttribute("method");}
else{delete this.outputMethod;}
this.template.stylesheet=converted;this.processor=this.template.createProcessor();this.paramsSet=[];};XSLTProcessor.prototype.transformToDocument=function(sourceDoc){var outDoc;if(_SARISSA_THREADEDDOM_PROGID){this.processor.input=sourceDoc;outDoc=new ActiveXObject(_SARISSA_DOM_PROGID);this.processor.output=outDoc;this.processor.transform();return outDoc;}
else{if(!_SARISSA_DOM_XMLWRITER){_SARISSA_DOM_XMLWRITER=Sarissa.pickRecentProgID(["Msxml2.MXXMLWriter.6.0","Msxml2.MXXMLWriter.3.0","MSXML2.MXXMLWriter","MSXML.MXXMLWriter","Microsoft.XMLDOM"]);}
this.processor.input=sourceDoc;outDoc=new ActiveXObject(_SARISSA_DOM_XMLWRITER);this.processor.output=outDoc;this.processor.transform();var oDoc=new ActiveXObject(_SARISSA_DOM_PROGID);oDoc.loadXML(outDoc.output+"");return oDoc;}};XSLTProcessor.prototype.transformToFragment=function(sourceDoc,ownerDoc){this.processor.input=sourceDoc;this.processor.transform();var s=this.processor.output;var f=ownerDoc.createDocumentFragment();var container;if(this.outputMethod=='text'){f.appendChild(ownerDoc.createTextNode(s));}else if(ownerDoc.body&&ownerDoc.body.innerHTML){container=ownerDoc.createElement('div');container.innerHTML=s;while(container.hasChildNodes()){f.appendChild(container.firstChild);}}
else{var oDoc=new ActiveXObject(_SARISSA_DOM_PROGID);if(s.substring(0,5)=='<?xml'){s=s.substring(s.indexOf('?>')+2);}
var xml=''.concat('<my>',s,'</my>');oDoc.loadXML(xml);container=oDoc.documentElement;while(container.hasChildNodes()){f.appendChild(container.firstChild);}}
return f;};XSLTProcessor.prototype.setParameter=function(nsURI,name,value){value=value?value:"";if(nsURI){this.processor.addParameter(name,value,nsURI);}else{this.processor.addParameter(name,value);}
nsURI=""+(nsURI||"");if(!this.paramsSet[nsURI]){this.paramsSet[nsURI]=[];}
this.paramsSet[nsURI][name]=value;};XSLTProcessor.prototype.getParameter=function(nsURI,name){nsURI=""+(nsURI||"");if(this.paramsSet[nsURI]&&this.paramsSet[nsURI][name]){return this.paramsSet[nsURI][name];}else{return null;}};XSLTProcessor.prototype.clearParameters=function(){for(var nsURI in this.paramsSet){for(var name in this.paramsSet[nsURI]){if(nsURI!=""){this.processor.addParameter(name,"",nsURI);}else{this.processor.addParameter(name,"");}}}
this.paramsSet=[];};}else{if(Sarissa._SARISSA_HAS_DOM_CREATE_DOCUMENT){Sarissa.__handleLoad__=function(oDoc){Sarissa.__setReadyState__(oDoc,4);};_sarissa_XMLDocument_onload=function(){Sarissa.__handleLoad__(this);};Sarissa.__setReadyState__=function(oDoc,iReadyState){oDoc.readyState=iReadyState;oDoc.readystate=iReadyState;if(oDoc.onreadystatechange!=null&&typeof oDoc.onreadystatechange=="function"){oDoc.onreadystatechange();}};Sarissa.getDomDocument=function(sUri,sName){var oDoc=document.implementation.createDocument(sUri?sUri:null,sName?sName:null,null);if(!oDoc.onreadystatechange){oDoc.onreadystatechange=null;}
if(!oDoc.readyState){oDoc.readyState=0;}
oDoc.addEventListener("load",_sarissa_XMLDocument_onload,false);return oDoc;};if(window.XMLDocument){}
else if(Sarissa._SARISSA_HAS_DOM_FEATURE&&window.Document&&!Document.prototype.load&&document.implementation.hasFeature('LS','3.0')){Sarissa.getDomDocument=function(sUri,sName){var oDoc=document.implementation.createDocument(sUri?sUri:null,sName?sName:null,null);return oDoc;};}
else{Sarissa.getDomDocument=function(sUri,sName){var oDoc=document.implementation.createDocument(sUri?sUri:null,sName?sName:null,null);if(oDoc&&(sUri||sName)&&!oDoc.documentElement){oDoc.appendChild(oDoc.createElementNS(sUri,sName));}
return oDoc;};}}}
if(!window.DOMParser){if(Sarissa._SARISSA_IS_SAFARI){DOMParser=function(){};DOMParser.prototype.parseFromString=function(sXml,contentType){var xmlhttp=new XMLHttpRequest();xmlhttp.open("GET","data:text/xml;charset=utf-8,"+encodeURIComponent(sXml),false);xmlhttp.send(null);return xmlhttp.responseXML;};}else if(Sarissa.getDomDocument&&Sarissa.getDomDocument()&&Sarissa.getDomDocument(null,"bar").xml){DOMParser=function(){};DOMParser.prototype.parseFromString=function(sXml,contentType){var doc=Sarissa.getDomDocument();doc.loadXML(sXml);return doc;};}}
if((typeof(document.importNode)=="undefined")&&Sarissa._SARISSA_IS_IE){try{document.importNode=function(oNode,bChildren){var tmp;if(oNode.nodeName=='#text'){return document.createTextNode(oNode.data);}
else{if(oNode.nodeName=="tbody"||oNode.nodeName=="tr"){tmp=document.createElement("table");}
else if(oNode.nodeName=="td"){tmp=document.createElement("tr");}
else if(oNode.nodeName=="option"){tmp=document.createElement("select");}
else{tmp=document.createElement("div");}
if(bChildren){tmp.innerHTML=oNode.xml?oNode.xml:oNode.outerHTML;}else{tmp.innerHTML=oNode.xml?oNode.cloneNode(false).xml:oNode.cloneNode(false).outerHTML;}
return tmp.getElementsByTagName("*")[0];}};}catch(e){}}
if(!Sarissa.getParseErrorText){Sarissa.getParseErrorText=function(oDoc){var parseErrorText=Sarissa.PARSED_OK;if((!oDoc)||(!oDoc.documentElement)){parseErrorText=Sarissa.PARSED_EMPTY;}else if(oDoc.documentElement.tagName=="parsererror"){parseErrorText=oDoc.documentElement.firstChild.data;parseErrorText+="\n"+oDoc.documentElement.firstChild.nextSibling.firstChild.data;}else if(oDoc.getElementsByTagName("parsererror").length>0){var parsererror=oDoc.getElementsByTagName("parsererror")[0];parseErrorText=Sarissa.getText(parsererror,true)+"\n";}else if(oDoc.parseError&&oDoc.parseError.errorCode!=0){parseErrorText=Sarissa.PARSED_UNKNOWN_ERROR;}
return parseErrorText;};}
Sarissa.getText=function(oNode,deep){var s="";var nodes=oNode.childNodes;for(var i=0;i<nodes.length;i++){var node=nodes[i];var nodeType=node.nodeType;if(nodeType==Node.TEXT_NODE||nodeType==Node.CDATA_SECTION_NODE){s+=node.data;}else if(deep===true&&(nodeType==Node.ELEMENT_NODE||nodeType==Node.DOCUMENT_NODE||nodeType==Node.DOCUMENT_FRAGMENT_NODE)){s+=Sarissa.getText(node,true);}}
return s;};if(!window.XMLSerializer&&Sarissa.getDomDocument&&Sarissa.getDomDocument("","foo",null).xml){XMLSerializer=function(){};XMLSerializer.prototype.serializeToString=function(oNode){return oNode.xml;};}
Sarissa.stripTags=function(s){return s?s.replace(/<[^>]+>/g,""):s;};Sarissa.clearChildNodes=function(oNode){while(oNode.firstChild){oNode.removeChild(oNode.firstChild);}};Sarissa.copyChildNodes=function(nodeFrom,nodeTo,bPreserveExisting){if(Sarissa._SARISSA_IS_SAFARI&&nodeTo.nodeType==Node.DOCUMENT_NODE){nodeTo=nodeTo.documentElement;}
if((!nodeFrom)||(!nodeTo)){throw"Both source and destination nodes must be provided";}
if(!bPreserveExisting){Sarissa.clearChildNodes(nodeTo);}
var ownerDoc=nodeTo.nodeType==Node.DOCUMENT_NODE?nodeTo:nodeTo.ownerDocument;var nodes=nodeFrom.childNodes;var i;if(typeof(ownerDoc.importNode)!="undefined"){for(i=0;i<nodes.length;i++){nodeTo.appendChild(ownerDoc.importNode(nodes[i],true));}}else{for(i=0;i<nodes.length;i++){nodeTo.appendChild(nodes[i].cloneNode(true));}}};Sarissa.moveChildNodes=function(nodeFrom,nodeTo,bPreserveExisting){if((!nodeFrom)||(!nodeTo)){throw"Both source and destination nodes must be provided";}
if(!bPreserveExisting){Sarissa.clearChildNodes(nodeTo);}
var nodes=nodeFrom.childNodes;if(nodeFrom.ownerDocument==nodeTo.ownerDocument){while(nodeFrom.firstChild){nodeTo.appendChild(nodeFrom.firstChild);}}else{var ownerDoc=nodeTo.nodeType==Node.DOCUMENT_NODE?nodeTo:nodeTo.ownerDocument;var i;if(typeof(ownerDoc.importNode)!="undefined"){for(i=0;i<nodes.length;i++){nodeTo.appendChild(ownerDoc.importNode(nodes[i],true));}}else{for(i=0;i<nodes.length;i++){nodeTo.appendChild(nodes[i].cloneNode(true));}}
Sarissa.clearChildNodes(nodeFrom);}};Sarissa.xmlize=function(anyObject,objectName,indentSpace){indentSpace=indentSpace?indentSpace:'';var s=indentSpace+'<'+objectName+'>';var isLeaf=false;if(!(anyObject instanceof Object)||anyObject instanceof Number||anyObject instanceof String||anyObject instanceof Boolean||anyObject instanceof Date){s+=Sarissa.escape(""+anyObject);isLeaf=true;}else{s+="\n";var isArrayItem=anyObject instanceof Array;for(var name in anyObject){s+=Sarissa.xmlize(anyObject[name],(isArrayItem?"array-item key=\""+name+"\"":name),indentSpace+"   ");}
s+=indentSpace;}
return(s+=(objectName.indexOf(' ')!=-1?"</array-item>\n":"</"+objectName+">\n"));};Sarissa.escape=function(sXml){return sXml.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;");};Sarissa.unescape=function(sXml){return sXml.replace(/&apos;/g,"'").replace(/&quot;/g,"\"").replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&amp;/g,"&");};Sarissa.updateCursor=function(oTargetElement,sValue){if(oTargetElement&&oTargetElement.style&&oTargetElement.style.cursor!=undefined){oTargetElement.style.cursor=sValue;}};Sarissa.updateContentFromURI=function(sFromUrl,oTargetElement,xsltproc,callback,skipCache){try{Sarissa.updateCursor(oTargetElement,"wait");var xmlhttp=new XMLHttpRequest();xmlhttp.open("GET",sFromUrl,true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){try{var oDomDoc=xmlhttp.responseXML;if(oDomDoc&&Sarissa.getParseErrorText(oDomDoc)==Sarissa.PARSED_OK){Sarissa.updateContentFromNode(xmlhttp.responseXML,oTargetElement,xsltproc);if(callback){callback(sFromUrl,oTargetElement);}}
else{throw Sarissa.getParseErrorText(oDomDoc);}}
catch(e){if(callback){callback(sFromUrl,oTargetElement,e);}
else{throw e;}}}};if(skipCache){var oldage="Sat, 1 Jan 2000 00:00:00 GMT";xmlhttp.setRequestHeader("If-Modified-Since",oldage);}
xmlhttp.send("");}
catch(e){Sarissa.updateCursor(oTargetElement,"auto");if(callback){callback(sFromUrl,oTargetElement,e);}
else{throw e;}}};Sarissa.updateContentFromNode=function(oNode,oTargetElement,xsltproc){try{Sarissa.updateCursor(oTargetElement,"wait");Sarissa.clearChildNodes(oTargetElement);var ownerDoc=oNode.nodeType==Node.DOCUMENT_NODE?oNode:oNode.ownerDocument;if(ownerDoc.parseError&&ownerDoc.parseError.errorCode!=0){var pre=document.createElement("pre");pre.appendChild(document.createTextNode(Sarissa.getParseErrorText(ownerDoc)));oTargetElement.appendChild(pre);}
else{if(xsltproc){oNode=xsltproc.transformToDocument(oNode);}
if(oTargetElement.tagName.toLowerCase()=="textarea"||oTargetElement.tagName.toLowerCase()=="input"){oTargetElement.value=new XMLSerializer().serializeToString(oNode);}
else{try{oTargetElement.appendChild(oTargetElement.ownerDocument.importNode(oNode,true));}
catch(e){oTargetElement.innerHTML=new XMLSerializer().serializeToString(oNode);}}}}
catch(e){throw e;}
finally{Sarissa.updateCursor(oTargetElement,"auto");}};Sarissa.formToQueryString=function(oForm){var qs="";for(var i=0;i<oForm.elements.length;i++){var oField=oForm.elements[i];var sFieldName=oField.getAttribute("name")?oField.getAttribute("name"):oField.getAttribute("id");if(sFieldName&&((!oField.disabled)||oField.type=="hidden")){switch(oField.type){case"hidden":case"text":case"textarea":case"password":qs+=sFieldName+"="+encodeURIComponent(oField.value)+"&";break;case"select-one":qs+=sFieldName+"="+encodeURIComponent(oField.options[oField.selectedIndex].value)+"&";break;case"select-multiple":for(var j=0;j<oField.length;j++){var optElem=oField.options[j];if(optElem.selected===true){qs+=sFieldName+"[]"+"="+encodeURIComponent(optElem.value)+"&";}}
break;case"checkbox":case"radio":if(oField.checked){qs+=sFieldName+"="+encodeURIComponent(oField.value)+"&";}
break;}}}
return qs.substr(0,qs.length-1);};Sarissa.updateContentFromForm=function(oForm,oTargetElement,xsltproc,callback){try{Sarissa.updateCursor(oTargetElement,"wait");var params=Sarissa.formToQueryString(oForm)+"&"+Sarissa.REMOTE_CALL_FLAG+"=true";var xmlhttp=new XMLHttpRequest();var bUseGet=oForm.getAttribute("method")&&oForm.getAttribute("method").toLowerCase()=="get";if(bUseGet){xmlhttp.open("GET",oForm.getAttribute("action")+"?"+params,true);}
else{xmlhttp.open('POST',oForm.getAttribute("action"),true);xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");xmlhttp.setRequestHeader("Content-length",params.length);xmlhttp.setRequestHeader("Connection","close");}
xmlhttp.onreadystatechange=function(){try{if(xmlhttp.readyState==4){var oDomDoc=xmlhttp.responseXML;if(oDomDoc&&Sarissa.getParseErrorText(oDomDoc)==Sarissa.PARSED_OK){Sarissa.updateContentFromNode(xmlhttp.responseXML,oTargetElement,xsltproc);if(callback){callback(oForm,oTargetElement);}}
else{throw Sarissa.getParseErrorText(oDomDoc);}}}
catch(e){if(callback){callback(oForm,oTargetElement,e);}
else{throw e;}}};xmlhttp.send(bUseGet?"":params);}
catch(e){Sarissa.updateCursor(oTargetElement,"auto");if(callback){callback(oForm,oTargetElement,e);}
else{throw e;}}
return false;};Sarissa.FUNCTION_NAME_REGEXP=new RegExp("");Sarissa.getFunctionName=function(oFunc,bForce){var name;if(!name){if(bForce){name="SarissaAnonymous"+Sarissa._getUniqueSuffix();window[name]=oFunc;}
else{name=null;}}
if(name){window[name]=oFunc;}
return name;};Sarissa.setRemoteJsonCallback=function(url,callback,callbackParam){if(!callbackParam){callbackParam="callback";}
var callbackFunctionName=Sarissa.getFunctionName(callback,true);var id="sarissa_json_script_id_"+Sarissa._getUniqueSuffix();var oHead=document.getElementsByTagName("head")[0];var scriptTag=document.createElement('script');scriptTag.type='text/javascript';scriptTag.id=id;scriptTag.onload=function(){};if(url.indexOf("?")!=-1){url+=("&"+callbackParam+"="+callbackFunctionName);}
else{url+=("?"+callbackParam+"="+callbackFunctionName);}
scriptTag.src=url;oHead.appendChild(scriptTag);return id;};if(Sarissa._SARISSA_HAS_DOM_FEATURE&&document.implementation.hasFeature("XPath","3.0")){SarissaNodeList=function(i){this.length=i;};SarissaNodeList.prototype=[];SarissaNodeList.prototype.constructor=Array;SarissaNodeList.prototype.item=function(i){return(i<0||i>=this.length)?null:this[i];};SarissaNodeList.prototype.expr="";if(window.XMLDocument&&(!XMLDocument.prototype.setProperty)){XMLDocument.prototype.setProperty=function(x,y){};}
Sarissa.setXpathNamespaces=function(oDoc,sNsSet){oDoc._sarissa_useCustomResolver=true;var namespaces=sNsSet.indexOf(" ")>-1?sNsSet.split(" "):[sNsSet];oDoc._sarissa_xpathNamespaces=[];for(var i=0;i<namespaces.length;i++){var ns=namespaces[i];var colonPos=ns.indexOf(":");var assignPos=ns.indexOf("=");if(colonPos>0&&assignPos>colonPos+1){var prefix=ns.substring(colonPos+1,assignPos);var uri=ns.substring(assignPos+2,ns.length-1);oDoc._sarissa_xpathNamespaces[prefix]=uri;}else{throw"Bad format on namespace declaration(s) given";}}};XMLDocument.prototype._sarissa_useCustomResolver=false;XMLDocument.prototype._sarissa_xpathNamespaces=[];XMLDocument.prototype.selectNodes=function(sExpr,contextNode,returnSingle){var nsDoc=this;var nsresolver;if(this._sarissa_useCustomResolver){nsresolver=function(prefix){var s=nsDoc._sarissa_xpathNamespaces[prefix];if(s){return s;}
else{throw"No namespace URI found for prefix: '"+prefix+"'";}};}
else{nsresolver=this.createNSResolver(this.documentElement);}
var result=null;if(!returnSingle){var oResult=this.evaluate(sExpr,(contextNode?contextNode:this),nsresolver,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);var nodeList=new SarissaNodeList(oResult.snapshotLength);nodeList.expr=sExpr;for(var i=0;i<nodeList.length;i++){nodeList[i]=oResult.snapshotItem(i);}
result=nodeList;}
else{result=this.evaluate(sExpr,(contextNode?contextNode:this),nsresolver,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;}
return result;};Element.prototype.selectNodes=function(sExpr){var doc=this.ownerDocument;if(doc.selectNodes){return doc.selectNodes(sExpr,this);}
else{throw"Method selectNodes is only supported by XML Elements";}};XMLDocument.prototype.selectSingleNode=function(sExpr,contextNode){var ctx=contextNode?contextNode:null;return this.selectNodes(sExpr,ctx,true);};Element.prototype.selectSingleNode=function(sExpr){var doc=this.ownerDocument;if(doc.selectSingleNode){return doc.selectSingleNode(sExpr,this);}
else{throw"Method selectNodes is only supported by XML Elements";}};Sarissa.IS_ENABLED_SELECT_NODES=true;}
(function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3])return jQuery().find(selector);return jQuery(elem);}selector=[];}}else
return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(jQuery.makeArray(selector));},jquery:"1.2.6",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value===undefined)return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else
return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else
selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=='string'?jQuery(selector):jQuery.makeArray(selector))));},is:function(selector){return!!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery.browser.msie&&!option.attributes.value.specified?option.text:option.value;if(one)return value;values.push(value);}}return values;}else
return(this[0].value||"").replace(/\r/g,"");}return undefined;}if(value.constructor==Number)value+='';return this.each(function(){if(this.nodeType!=1)return;if(value.constructor==Array&&/radio|checkbox/.test(this.type))this.checked=(jQuery.inArray(this.value,value)>=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)this.selectedIndex=-1;}else
this.value=value;});},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length)data=jQuery.data(this[0],key);return data===undefined&&parts[1]?this.data(parts[0]):data;}else
return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script"))scripts=scripts.add(elem);else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else
jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}function now(){return+new Date;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==i){target=this;--i;}for(;i<length;i++)if((options=arguments[i])!=null)for(var name in options){var src=target[name],copy=options[name];if(target===copy)continue;if(deep&&copy&&typeof copy=="object"&&!copy.nodeType)target[name]=jQuery.extend(deep,src||(copy.length!=null?[]:{}),copy);else if(copy!==undefined)target[name]=copy;}return target;};var expando="jQuery"+now(),uuid=0,windowData={},exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)window.jQuery=_jQuery;return jQuery;},isFunction:function(fn){return!!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/^[\s[]?function/.test(fn+"");},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;},globalEval:function(data){data=jQuery.trim(data);if(data){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.browser.msie)script.text=data;else
script.appendChild(document.createTextNode(data));head.insertBefore(script,head.firstChild);head.removeChild(script);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem;var id=elem[expando];if(!id)id=elem[expando]=++uuid;if(name&&!jQuery.cache[id])jQuery.cache[id]={};if(data!==undefined)jQuery.cache[id][name]=data;return name?jQuery.cache[id][name]:id;},removeData:function(elem,name){elem=elem==window?windowData:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id])break;if(!name)jQuery.removeData(elem);}}else{try{delete elem[expando];}catch(e){if(elem.removeAttribute)elem.removeAttribute(expando);}delete jQuery.cache[id];}},each:function(object,callback,args){var name,i=0,length=object.length;if(args){if(length==undefined){for(name in object)if(callback.apply(object[name],args)===false)break;}else
for(;i<length;)if(callback.apply(object[i++],args)===false)break;}else{if(length==undefined){for(name in object)if(callback.call(object[name],name,object[name])===false)break;}else
for(var value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}return object;},prop:function(elem,value,type,i,name){if(jQuery.isFunction(value))value=value.call(elem,i);return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(name)?value+"px":value;},className:{add:function(elem,classNames){jQuery.each((classNames||"").split(/\s+/),function(i,className){if(elem.nodeType==1&&!jQuery.className.has(elem.className,className))elem.className+=(elem.className?" ":"")+className;});},remove:function(elem,classNames){if(elem.nodeType==1)elem.className=classNames!=undefined?jQuery.grep(elem.className.split(/\s+/),function(className){return!jQuery.className.has(classNames,className);}).join(" "):"";},has:function(elem,className){return jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options)elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else
jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style;function color(elem){if(!jQuery.browser.safari)return false;var ret=defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=style.outline;style.outline="0 solid black";style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&style&&style[name])ret=style[name];else if(defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle&&!color(elem))ret=computedStyle.getPropertyValue(name);else{var swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode)stack.unshift(a);for(;i<stack.length;i++)if(color(stack[i])){swap[i]=stack[i].style.display;stack[i].style.display="block";}ret=name=="display"&&swap[stack.length-1]!=null?"none":(computedStyle&&computedStyle.getPropertyValue(name))||"";for(i=0;i<swap.length;i++)if(swap[i]!=null)stack[i].style.display=swap[i];}if(name=="opacity"&&ret=="")ret="1";}else if(elem.currentStyle){var camelCase=name.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase();});ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;style.left=ret||0;ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft;}}return ret;},clean:function(elems,context){var ret=[];context=context||document;if(typeof context.createElement=='undefined')context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;jQuery.each(elems,function(i,elem){if(!elem)return;if(elem.constructor==Number)elem+='';if(typeof elem=="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||jQuery.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf("<table")&&tags.indexOf("<tbody")<0?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&tags.indexOf("<tbody")<0?div.childNodes:[];for(var j=tbody.length-1;j>=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else
ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(name in elem&&notxml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem[name]=value;}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))return elem.getAttributeNode(name).nodeValue;return elem[name];}if(msie&&notxml&&name=="style")return jQuery.attr(elem.style,"cssText",value);if(set)elem.setAttribute(name,""+value);var attr=msie&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+'':"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set)elem[name]=value;return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||array.split||array.setInterval||array.call)ret[0]=array;else
while(i)ret[--i]=array[i];}return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i<length;i++)if(array[i]===elem)return i;return-1;},merge:function(first,second){var i=0,elem,pos=first.length;if(jQuery.browser.msie){while(elem=second[i++])if(elem.nodeType!=8)first[pos++]=elem;}else
while(elem=second[i++])first[pos++]=elem;return first;},unique:function(array){var ret=[],done={};try{for(var i=0,length=array.length;i<length;i++){var id=jQuery.data(array[i]);if(!done[id]){done[id]=true;ret.push(array[i]);}}}catch(e){ret=array;}return ret;},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++)if(!inv!=!callback(elems[i],i))ret.push(elems[i]);return ret;},map:function(elems,callback){var ret=[];for(var i=0,length=elems.length;i<length;i++){var value=callback(elems[i],i);if(value!=null)ret[ret.length]=value;}return ret.concat.apply([],ret);}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing"}});jQuery.each({parent:function(elem){return elem.parentNode;},parents:function(elem){return jQuery.dir(elem,"parentNode");},next:function(elem){return jQuery.nth(elem,2,"nextSibling");},prev:function(elem){return jQuery.nth(elem,2,"previousSibling");},nextAll:function(elem){return jQuery.dir(elem,"nextSibling");},prevAll:function(elem){return jQuery.dir(elem,"previousSibling");},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},children:function(elem){return jQuery.sibling(elem.firstChild);},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(selector){var ret=jQuery.map(this,fn);if(selector&&typeof selector=="string")ret=jQuery.multiFilter(selector,ret);return this.pushStack(jQuery.unique(ret));};});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(){var args=arguments;return this.each(function(){for(var i=0,length=args.length;i<length;i++)jQuery(args[i])[original](this);});};});jQuery.each({removeAttr:function(name){jQuery.attr(this,name,"");if(this.nodeType==1)this.removeAttribute(name);},addClass:function(classNames){jQuery.className.add(this,classNames);},removeClass:function(classNames){jQuery.className.remove(this,classNames);},toggleClass:function(classNames){jQuery.className[jQuery.className.has(this,classNames)?"remove":"add"](this,classNames);},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).r.length){jQuery("*",this).add(this).each(function(){jQuery.event.remove(this);jQuery.removeData(this);});if(this.parentNode)this.parentNode.removeChild(this);}},empty:function(){jQuery(">*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return i<m[3]-0;},gt:function(a,i,m){return i>m[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j<rl;j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;for(;n;n=n.nextSibling)if(n.nodeType==1){var id=jQuery.data(n);if(m=="~"&&merge[id])break;if(!nodeName||n.nodeName.toUpperCase()==nodeName){if(m=="~")merge[id]=true;r.push(n);}if(m=="+")break;}}ret=r;t=jQuery.trim(t.replace(re,""));foundToken=true;}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0])ret.shift();done=jQuery.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length);}else{var re2=quickID;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]];}else{re2=quickClass;m=re2.exec(t);}m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2])oid=jQuery('[@id="'+m[2]+'"]',elem)[0];ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[];}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object")tag="param";r=jQuery.merge(r,ret[i].getElementsByTagName(tag));}if(m[1]==".")r=jQuery.classFilter(r,m[2]);if(m[1]=="#"){var tmp=[];for(var i=0;r[i];i++)if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];break;}r=tmp;}ret=r;}t=t.replace(re2,"");}}if(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t);}}if(t)ret=[];if(ret&&context==ret[0])ret.shift();done=jQuery.merge(done,ret);return done;},classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];if(z==null||/href|src|selected/.test(m[2]))z=jQuery.attr(a,m[2])||'';if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);if(!merge[id]){var c=1;for(var n=parentNode.firstChild;n;n=n.nextSibling)if(n.nodeType==1)n.nodeIndex=c++;merge[id]=true;}var add=false;if(first==0){if(node.nodeIndex==last)add=true;}else if((node.nodeIndex-last)%first==0&&(node.nodeIndex-last)/first>=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=this.proxy(fn,function(){return fn.apply(this,arguments);});handler.data=data;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered)return jQuery.event.handle.apply(arguments.callee.elem,arguments);});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else
for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete events[type];}}});}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});data[0][expando]=true;}data[0].type=type;if(exclusive)data[0].exclusive=true;var handle=jQuery.data(elem,"handle");if(handle)val=handle.apply(elem,data);if((!fn||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}return val;},fix:function(event){if(event[expando]==true)return event;var originalEvent=event;event={originalEvent:originalEvent};var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");for(var i=props.length;i;i--)event[props[i]]=originalEvent[props[i]];event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};event.timeStamp=event.timeStamp||now();if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=event.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(fn){var args=arguments,i=1;while(i<args.length)jQuery.event.proxy(fn,args[i++]);return this.click(jQuery.event.proxy(fn,function(event){this.lastToggle=(this.lastToggle||0)%i;event.preventDefault();return args[this.lastToggle++].apply(this,arguments)||false;}));},hover:function(fnOver,fnOut){return this.bind('mouseenter',fnOver).bind('mouseleave',fnOut);},ready:function(fn){bindReady();if(jQuery.isReady)fn.call(document,jQuery);else
jQuery.readyList.push(function(){return fn.call(this,jQuery);});return this;}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.call(document);});jQuery.readyList=null;}jQuery(document).triggerHandler("ready");}}});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(document.addEventListener&&!jQuery.browser.opera)document.addEventListener("DOMContentLoaded",jQuery.ready,false);if(jQuery.browser.msie&&window==top)(function(){if(jQuery.isReady)return;try{document.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;}jQuery.ready();})();if(jQuery.browser.opera)document.addEventListener("DOMContentLoaded",function(){if(jQuery.isReady)return;for(var i=0;i<document.styleSheets.length;i++)if(document.styleSheets[i].disabled){setTimeout(arguments.callee,0);return;}jQuery.ready();},false);if(jQuery.browser.safari){var numStyles;(function(){if(jQuery.isReady)return;if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return;}if(numStyles===undefined)numStyles=jQuery("style, link[rel=stylesheet]").length;if(document.styleSheets.length!=numStyles){setTimeout(arguments.callee,0);return;}jQuery.ready();})();}jQuery.event.add(window,"load",jQuery.ready);}jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,change,select,"+"submit,keydown,keypress,keyup,error").split(","),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name);};});var withinElement=function(event,elem){var parent=event.relatedTarget;while(parent&&parent!=elem)try{parent=parent.parentNode;}catch(error){parent=elem;}return parent==elem;};jQuery(window).bind("unload",function(){jQuery("*").add(document).unbind();});jQuery.fn.extend({_load:jQuery.fn.load,load:function(url,params,callback){if(typeof url!='string')return this._load(url);var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(s.username)xhr.open(type,s.url,s.async,s.username,s.password);else
xhr.open(type,s.url,s.async);try{if(s.data)xhr.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;xhr.abort();return false;}if(s.global)jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else
jQuery.handleError(s,xhr,status);complete();if(s.async)xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xhr){xhr.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xhr,s]);}function complete(){if(s.complete)s.complete(xhr,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(filter)data=filter(data,type);if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else
for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else
s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return opt.complete.call(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else
e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.call(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",jQuery.makeArray(array));}return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].call(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.call(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++)if(!timers[i]())timers.splice(i--,1);if(!timers.length){clearInterval(jQuery.timerId);jQuery.timerId=null;}},13);}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height")this.elem.style[this.prop]="1px";jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(gotoEnd){var t=now();if(gotoEnd||t>this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done)this.options.complete.call(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0;}return results;};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return jQuery(offsetParent);}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);};});})();;(function($){var a='indexer',h=$.event,j=h.special,k=$.listen=function(c,d,e,f){if(typeof d!='object'){f=e;e=d;d=document}o(c.split(/\s+/),function(a){a=k.fixes[a]||a;var b=m(d,a)||m(d,a,new n(a,d));b.append(e,f);b.start()})},m=function(b,c,d){return $.data(b,c+'.'+a,d)};$.fn[a]=function(a){return this[0]&&m(this[0],a)||null};$[a]=function(a){return m(document,a)};$.extend(k,{regex:/^((?:\w*?|\*))(?:([#.])([\w-]+))?$/,fixes:{focus:'focusin',blur:'focusout'},cache:function(a){this.caching=a}});$.each(k.fixes,function(a,b){j[b]={setup:function(){if($.browser.msie)return!1;this.addEventListener(a,j[b].handler,!0)},teardown:function(){if($.browser.msie)return!1;this.removeEventListener(a,j[b].handler,!0)},handler:function(e){arguments[0]=e=h.fix(e);e.type=b;return h.handle.apply(this,arguments)}}});$.fn.listen=function(a,b,c){return this.each(function(){k(a,this,b,c)})};function n(a,b){$.extend(this,{ids:{},tags:{},listener:b,event:a});this.id=n.instances.push(this)};n.instances=[];n.prototype={constructor:n,handle:function(e){var a=e.stopPropagation;e.stopPropagation=function(){e.stopped=1;a.apply(this,arguments)};m(this,e.type).parse(e);e.stopPropagation=a;a=e.data=null},on:0,bubbles:0,start:function(){var a=this;if(!a.on){h.add(a.listener,a.event,a.handle);a.on=1}},stop:function(){var a=this;if(a.on){h.remove(a.listener,a.event,a.handle);a.on=0}},cache:function(a,b){return $.data(a,'listenCache_'+this.id,b)},parse:function(e){var z=this,c=e.data||e.target,d=arguments,f;if(!k.caching||!(f=z.cache(c))){f=[];if(c.id&&z.ids[c.id])p(f,z.ids[c.id]);o([c.nodeName,'*'],function(a){var b=z.tags[a];if(b)o((c.className+' *').split(' '),function(a){if(a&&b[a])p(f,b[a])})});if(k.caching)z.cache(c,f)}if(f[0]){o(f,function(a){if(a.apply(c,d)===!1){e.preventDefault();e.stopPropagation()}})}if(!e.stopped&&(c=c.parentNode)&&(c.nodeName=='A'||z.bubbles&&c!=z.listener)){e.data=c;z.parse(e)}f=d=c=null},append:function(f,g){var z=this;o(f.split(/\s*,\s*/),function(a){var b=k.regex.exec(a);if(!b)throw'$.listen > "'+a+'" is not a supported selector.';var c=b[2]=='#'&&b[3],d=b[1].toUpperCase()||'*',e=b[3]||'*';if(c)(z.ids[c]||(z.ids[c]=[])).push(g);else if(d){d=z.tags[d]=z.tags[d]||{};(d[e]||(d[e]=[])).push(g)}})}};function o(a,b,c){for(var i=0,l=a.length;i<l;i++)b.call(c,a[i],i)};function p(a,b){a.push.apply(a,b);return a};$(window).unload(function(){if(typeof n=='function')o(n.instances,function(b){b.stop();$.removeData(b.listener,b.event+'.'+a);b.ids=b.names=b.listener=null})})})(jQuery);var xslTransform={version:20071203,debug:false,init:function(){try{parseFloat(jQuery.fn.jquery)>=1;}catch(e){alert('xslTransform requires jQuery 1.0.4 or greater ... please load it prior to xslTransform');}
try{Sarissa;}catch(e){alert('Missing Sarissa ... please load it prior to xslTransform');}
if(!jQuery.log){jQuery.log=function(){};jQuery.fn.debug=function(){};}
if(this.debug)jQuery.log('xslTransform:init(): version '+xslTransform.version);},XMLSerializer:new XMLSerializer(),serialize:function(data){if(this.debug)jQuery.log('serialize(): received '+typeof(data));if(typeof(data)=='string'){return data;}
return this.XMLSerializer.serializeToString(data);},load:function(xml){if(this.debug)jQuery.log('load(): received '+typeof(xml));var r;if(typeof(xml)=='object'){return xml;}
if(xml.substring(0,1)=='<'){r=this.loadString(xml);}else{r=this.loadFile(xml);}
if(r){r.setProperty('SelectionNamespaces','xmlns:xsl="http://www.w3.org/1999/XSL/Transform"');r.setProperty('SelectionLanguage','XPath');return r;}else{if(this.debug)$.log('Unable to load '+xml);return false;}},loadString:function(str){if(this.debug)jQuery.log('loadString(): '+str+'::'+typeof(str));var p=new DOMParser();var xml=p.parseFromString(str,'text/xml');if(!xml){if(this.debug)jQuery.log('loadString(): parseFromString() failed');return false;}
return xml;},loadFile:function(url){if(this.debug)jQuery.log('loadFile(): '+url+'::'+typeof(url));if(!url){if(this.debug)jQuery.log('ERROR: loadFile() missing url');return false;}
var doc;this.xhrsuccess=function(data,str){if(this.debug)jQuery.log('loadFile() completed successfully ('+str+')');doc=data;return true;};this.xhrerror=function(xhr,err){window.DEBUG=true;if(this.debug)jQuery.log('loadFile() failed to load the requested file: ('+err+') - xml: '+xhr.responseXML+' - text: '+xhr.responseText);doc=null;return false;};$.ajax({type:'GET',url:url,async:false,success:this.xhrsuccess,error:this.xhrerror});if(!doc){if(this.debug)jQuery.log('ERROR: document '+url+' not found (404), or unable to load');return false;}
if(doc.length==0){if(this.debug)jQuery.log('ERROR: document '+url+' loaded in loadFile() has no data');return false;}
return doc;},transform:function(xsl,xml,options){var log={'xsl':xsl,'xml':xml,'options':options};if(this.debug)jQuery.log('transform(): '+xsl+'::'+xml+'::'+options.toString());options=options||{};var xml={'request':xml,'doc':this.load(xml)};if(options.xpath&&xml.doc&&!jQuery.browser.msie){xml.doc=xml.doc.selectSingleNode(options.xpath.toString());if(this.debug)$.log('transform(): xpath has been run...resulting doc: '+(this.serialize(xml.doc)));}
var result={'xsl':this.load(xsl)};result.json=false;if(options.json&&xml.doc){result.json=xml.doc.selectSingleNode(options.json.toString());}
var processor=new XSLTProcessor();processor.importStylesheet(result.xsl);if(options.params&&processor){if(this.debug)jQuery.log('transform(): received xsl params: '+options.params.toString());for(key in options.params){processor.setParameter(null,key.toString(),options.params[key].toString());}}
result.doc=processor.transformToDocument(xml.doc);var errorTxt=Sarissa.getParseErrorText(result.doc);if(this.debug)jQuery.log('transform(): Sarissa parse text: '+errorTxt);if(errorTxt!=Sarissa.PARSED_OK){result.string=Sarissa.getParseErrorText(result.doc)+' :: using '+xsl+' => '+xml.request;if(this.debug)jQuery.log('transform(): error in transformation: '+Sarissa.getParseErrorText(result.doc));return result;}
result.string=this.serialize(result.doc);result.scripts=jQuery('script',result.doc).text();return result;}};xslTransform.init();jQuery.fn.getTransform=function(xsl,xml,options){var settings={append:false,params:{},xpath:'',eval:true,callback:'',json:false};jQuery.extend(settings,options);if(xslTransform.debug)jQuery.log('getTransform: '+xsl+'::'+xml+'::'+settings.toString());if(!xsl||!xml){if(xslTransform.debug)jQuery.log('getTransform: missing xsl or xml');return;}
return this.each(function(){var trans=xslTransform.transform(xsl,xml,settings);var re=trans.string.match(/<\?xml.*?\?>/);if(re){trans.string=trans.string.replace(re,'');if(xslTransform.debug)jQuery.log('getTransform(): found an xml declaration and removed it');}
try{if(settings.append)$(this).append(trans.string);else if(settings.repl)$(this).replaceWith(trans.string);else $(this).html(trans.string);}catch(e){if(xslTransform.debug)$.log('getTransform: error placing results of transform into element, falling back to innerHTML: '+e.toString());$(this)[0].innerHTML=trans.string;}
if(settings.eval&&trans.scripts){if(trans.scripts.length>0){if(xslTransform.debug)jQuery.log('Found text/javascript in transformed result');eval.call(window,trans.scripts);}}
if(settings.callback&&jQuery.isFunction(settings.callback)){var json=false;if(settings.json&&trans.json)eval("json = "+trans.json.firstChild.data);settings.callback.apply(window,[trans.string,json]);}});};(function($){$.extend({metadata:{defaults:{type:'class',name:'metadata',cre:/({.*})/,single:'metadata'},setType:function(type,name){this.defaults.type=type;this.defaults.name=name;},get:function(elem,opts){var settings=$.extend({},this.defaults,opts);if(!settings.single.length)settings.single='metadata';var data=$.data(elem,settings.single);if(data)return data;data="{}";if(settings.type=="class"){var m=settings.cre.exec(elem.className);if(m)
data=m[1];}else if(settings.type=="elem"){if(!elem.getElementsByTagName)
return undefined;var e=elem.getElementsByTagName(settings.name);if(e.length)
data=$.trim(e[0].innerHTML);}else if(elem.getAttribute!=undefined){var attr=elem.getAttribute(settings.name);if(attr)
data=attr;}
if(data.indexOf('{')<0)
data="{"+data+"}";data=eval("("+data+")");$.data(elem,settings.single,data);return data;}}});$.fn.metadata=function(opts){return $.metadata.get(this[0],opts);};})(jQuery);jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1;}
var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}
expires='; expires='+date.toUTCString();}
var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}
return cookieValue;}};(function($){jQuery.fn.log=function(msg){if(!window.console||!console)return;if(window.console||console.firebug){msg=msg||'';if(msg!=='')msg+=': ';console.log("%s%o",msg,this);}
return this;};$.extend({log:function(msg){if(!window.console||!console)return;if(window.console||console.firebug){console.log("%s",msg);}}});})(jQuery);(function(jQuery){this.version='(beta)(0.0.2)';this.all={};this.special_keys={27:'esc',9:'tab',32:'space',13:'return',8:'backspace',145:'scroll',20:'capslock',144:'numlock',19:'pause',45:'insert',36:'home',46:'del',35:'end',33:'pageup',34:'pagedown',37:'left',38:'up',39:'right',40:'down',112:'f1',113:'f2',114:'f3',115:'f4',116:'f5',117:'f6',118:'f7',119:'f8',120:'f9',121:'f10',122:'f11',123:'f12'};this.shift_nums={"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":":","'":"\"",",":"<",".":">","/":"?","\\":"|"};this.add=function(combi,options,callback){if(jQuery.isFunction(options)){callback=options;options={};}
var opt={},defaults={type:'keydown',propagate:false,disableInInput:false,target:jQuery('html')[0]},that=this;opt=jQuery.extend(opt,defaults,options||{});combi=combi.toLowerCase();var inspector=function(event){event=jQuery.event.fix(event);var element=event.target;element=(element.nodeType==3)?element.parentNode:element;if(opt['disableInInput']){var target=jQuery(element);if(target.is("input")||target.is("textarea")){return;}}
var code=event.which,type=event.type,character=String.fromCharCode(code).toLowerCase(),special=that.special_keys[code],shift=event.shiftKey,ctrl=event.ctrlKey,alt=event.altKey,propagate=true,mapPoint=null;if(jQuery.browser.opera||jQuery.browser.safari){while(!that.all[element]&&element.parentNode){element=element.parentNode;}}
var cbMap=that.all[element].events[type].callbackMap;if(!shift&&!ctrl&&!alt){mapPoint=cbMap[special]||cbMap[character]}
else{var modif='';if(alt)modif+='alt+';if(ctrl)modif+='ctrl+';if(shift)modif+='shift+';mapPoint=cbMap[modif+special]||cbMap[modif+character]||cbMap[modif+that.shift_nums[character]]}
if(mapPoint){mapPoint.cb(event);if(!mapPoint.propagate){event.stopPropagation();event.preventDefault();return false;}}};if(!this.all[opt.target]){this.all[opt.target]={events:{}};}
if(!this.all[opt.target].events[opt.type]){this.all[opt.target].events[opt.type]={callbackMap:{}}
jQuery.event.add(opt.target,opt.type,inspector);}
this.all[opt.target].events[opt.type].callbackMap[combi]={cb:callback,propagate:opt.propagate};return jQuery;};this.remove=function(exp,opt){opt=opt||{};target=opt.target||jQuery('html')[0];type=opt.type||'keydown';exp=exp.toLowerCase();delete this.all[target].events[type].callbackMap[exp]
return jQuery;};jQuery.hotkeys=this;return jQuery;})(jQuery);var $j=jQuery.noConflict();function initMenu(){$j("#menu div").hide();$j("#menu div:first").show();$j("#menu li a").click(function(){$j("#menu li a").removeClass("menuon");$j(this).addClass("menuon");var checkElement=$j(this).next();if((checkElement.is("div"))&&(checkElement.is(":visible"))){return false}if((checkElement.is("div"))&&(!checkElement.is(":visible"))){$j("#menu div:visible").slideUp("normal");checkElement.slideDown("normal");return false}})}
$j(function(){$j(".bubble").hover(function(){if($j("#bubble").size()==0){var bubble=$j("<div>").attr("id","bubble");$j("body").append(bubble)}var off=$j(this).offset({scroll:false});$j("#bubble").html($j(this).attr("longdesc").replace("|","<br />")).css({left:off.left+"px",top:(off.top+18)+"px"}).show()},function(){$j("#bubble").hide()})});(function($){$.fn.extend({autocomplete:function(urlOrData,options){var isUrl=typeof urlOrData=="string";options=$.extend({},$.Autocompleter.defaults,{url:isUrl?urlOrData:null,data:isUrl?null:urlOrData,delay:isUrl?$.Autocompleter.defaults.delay:10,max:options&&!options.scroll?10:240},options);options.highlight=options.highlight||function(value){return value};options.formatMatch=options.formatMatch||options.formatItem;return this.each(function(){new $.Autocompleter(this,options)})},result:function(handler){return this.bind("result",handler)},search:function(handler){return this.trigger("search",[handler])},flushCache:function(){return this.trigger("flushCache")},setOptions:function(options){return this.trigger("setOptions",[options])},unautocomplete:function(){return this.trigger("unautocomplete")}});$.Autocompleter=function(input,options){var KEY={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8};var $input=$(input).attr("autocomplete","off").addClass(options.inputClass);var timeout;var previousValue="";var cache=$.Autocompleter.Cache(options);var hasFocus=0;var lastKeyPressCode;var config={mouseDownOnSelect:false};var select=$.Autocompleter.Select(options,input,selectCurrent,config);var blockSubmit;$.browser.opera&&$(input.form).bind("submit.autocomplete",function(){if(blockSubmit){blockSubmit=false;return false}});$input.bind(($.browser.opera?"keypress":"keydown")+".autocomplete",function(event){lastKeyPressCode=event.keyCode;switch(event.keyCode){case KEY.UP:event.preventDefault();if(select.visible()){select.prev()}else{onChange(0,true)}break;case KEY.DOWN:event.preventDefault();if(select.visible()){select.next()}else{onChange(0,true)}break;case KEY.PAGEUP:event.preventDefault();if(select.visible()){select.pageUp()}else{onChange(0,true)}break;case KEY.PAGEDOWN:event.preventDefault();if(select.visible()){select.pageDown()}else{onChange(0,true)}break;case options.multiple&&$.trim(options.multipleSeparator)==","&&KEY.COMMA:case KEY.TAB:case KEY.RETURN:if(selectCurrent()){event.preventDefault();blockSubmit=true;return false}break;case KEY.ESC:select.hide();break;default:clearTimeout(timeout);timeout=setTimeout(onChange,options.delay);break}}).focus(function(){hasFocus++}).blur(function(){hasFocus=0;if(!config.mouseDownOnSelect){hideResults()}}).click(function(){if(hasFocus++>1&&!select.visible()){onChange(0,true)}}).bind("search",function(){var fn=(arguments.length>1)?arguments[1]:null;function findValueCallback(q,data){var result;if(data&&data.length){for(var i=0;i<data.length;i++){if(data[i].result.toLowerCase()==q.toLowerCase()){result=data[i];break}}}if(typeof fn=="function"){fn(result)}else{$input.trigger("result",result&&[result.data,result.value])}}$.each(trimWords($input.val()),function(i,value){request(value,findValueCallback,findValueCallback)})}).bind("flushCache",function(){cache.flush()}).bind("setOptions",function(){$.extend(options,arguments[1]);if("data"in arguments[1]){cache.populate()}}).bind("unautocomplete",function(){select.unbind();$input.unbind();$(input.form).unbind(".autocomplete")});function selectCurrent(){var selected=select.selected();if(!selected){return false}var v=selected.result;previousValue=v;if(options.multiple){var words=trimWords($input.val());if(words.length>1){v=words.slice(0,words.length-1).join(options.multipleSeparator)+options.multipleSeparator+v}v+=options.multipleSeparator}$input.attr("myvalue",v);$input.val(v);hideResultsNow();$input.trigger("result",[selected.data,selected.value]);return true}function onChange(crap,skipPrevCheck){if(lastKeyPressCode==KEY.DEL){select.hide();return}var currentValue=$input.val();$input.attr("myvalue",currentValue);if(!skipPrevCheck&&currentValue==previousValue){return}previousValue=currentValue;currentValue=lastWord(currentValue);if(currentValue.length>=options.minChars){$input.addClass(options.loadingClass);if(!options.matchCase){currentValue=currentValue.toLowerCase()}request(currentValue,receiveData,hideResultsNow)}else{stopLoading();select.hide()}}function trimWords(value){if(!value){return[""]}var words=value.split(options.multipleSeparator);var result=[];$.each(words,function(i,value){if($.trim(value)){result[i]=$.trim(value)}});return result}function lastWord(value){if(!options.multiple){return value}var words=trimWords(value);return words[words.length-1]}function autoFill(q,sValue){if(options.autoFill&&(lastWord($input.val()).toLowerCase()==q.toLowerCase())&&lastKeyPressCode!=KEY.BACKSPACE){$input.val($input.val()+sValue.substring(lastWord(previousValue).length));$.Autocompleter.Selection(input,previousValue.length,previousValue.length+sValue.length)}}function hideResults(){clearTimeout(timeout);timeout=setTimeout(hideResultsNow,200)}function hideResultsNow(){var wasVisible=select.visible();select.hide();clearTimeout(timeout);stopLoading();if(options.mustMatch){$input.search(function(result){if(!result){if(options.multiple){var words=trimWords($input.val()).slice(0,-1);$input.val(words.join(options.multipleSeparator)+(words.length?options.multipleSeparator:""))}else{$input.val("")}}})}if(wasVisible){$.Autocompleter.Selection(input,input.value.length,input.value.length)}}function receiveData(q,data){if(data&&data.length&&hasFocus){stopLoading();select.display(data,q);autoFill(q,data[0].value);select.show()}else{hideResultsNow()}}function request(term,success,failure){if(!options.matchCase){term=term.toLowerCase()}var data=cache.load(term);if(data&&data.length){success(term,data)}else{if((typeof options.url=="string")&&(options.url.length>0)){var extraParams={timestamp:+new Date()};$.each(options.extraParams,function(key,param){extraParams[key]=typeof param=="function"?param():param});$.ajax({mode:"abort",port:"autocomplete"+input.name,dataType:options.dataType,url:options.url,data:$.extend({q:lastWord(term),limit:options.max},extraParams),success:function(data){var parsed=options.parse&&options.parse(data)||parse(data);cache.add(term,parsed);success(term,parsed)}})}else{select.emptyList();failure(term)}}}function parse(data){var parsed=[];var rows=data.split("\n");for(var i=0;i<rows.length;i++){var row=$.trim(rows[i]);if(row){row=row.split("|");parsed[parsed.length]={data:row,value:row[0],result:options.formatResult&&options.formatResult(row,row[0])||row[0]}}}return parsed}function stopLoading(){$input.removeClass(options.loadingClass)}};$.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:false,matchSubset:true,matchContains:false,cacheLength:10,max:100,mustMatch:false,extraParams:{},selectFirst:true,formatItem:function(row){return row[0]},formatMatch:null,autoFill:false,width:0,multiple:false,multipleSeparator:", ",highlight:function(value,term){return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>")},scroll:true,scrollHeight:180};$.Autocompleter.Cache=function(options){var data={};var length=0;function matchSubset(s,sub){if(!options.matchCase){s=s.toLowerCase()}var i=s.indexOf(sub);if(i==-1){return false}return i==0||options.matchContains}function add(q,value){if(length>options.cacheLength){flush()}if(!data[q]){length++}data[q]=value}function populate(){if(!options.data){return false}var stMatchSets={},nullData=0;if(!options.url){options.cacheLength=1}stMatchSets[""]=[];for(var i=0,ol=options.data.length;i<ol;i++){var rawValue=options.data[i];rawValue=(typeof rawValue=="string")?[rawValue]:rawValue;var value=options.formatMatch(rawValue,i+1,options.data.length);if(value===false){continue}var firstChar=value.charAt(0).toLowerCase();if(!stMatchSets[firstChar]){stMatchSets[firstChar]=[]}var row={value:value,data:rawValue,result:options.formatResult&&options.formatResult(rawValue)||value};stMatchSets[firstChar].push(row);if(nullData++<options.max){stMatchSets[""].push(row)}}$.each(stMatchSets,function(i,value){options.cacheLength++;add(i,value)})}setTimeout(populate,25);function flush(){data={};length=0}return{flush:flush,add:add,populate:populate,load:function(q){if(!options.cacheLength||!length){return null}if(!options.url&&options.matchContains){var csub=[];for(var k in data){if(k.length>0){var c=data[k];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub.push(x)}})}}return csub}else{if(data[q]){return data[q]}else{if(options.matchSubset){for(var i=q.length-1;i>=options.minChars;i--){var c=data[q.substr(0,i)];if(c){var csub=[];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub[csub.length]=x}});return csub}}}}}return null}}};$.Autocompleter.Select=function(options,input,select,config){var CLASSES={ACTIVE:"as_highlight"};var listItems,active=-1,data,term="",needsInit=true,element,list;function init(){if(!needsInit){return}element=$("<div/>").hide().addClass(options.resultsClass).css("position","absolute").appendTo(document.body);var hcorner=$("<div/>").addClass("as_corner");var hbar=$("<div/>").addClass("as_bar");var header=$("<div/>").addClass("as_header");hcorner.appendTo(header);hbar.appendTo(header);header.appendTo(element);list=$("<ul/>").appendTo(element).mouseover(function(event){if(target(event).nodeName&&target(event).nodeName.toUpperCase()=="LI"){active=$("li",list).removeClass(CLASSES.ACTIVE).index(target(event));$(target(event)).addClass(CLASSES.ACTIVE)}}).click(function(event){$(target(event)).addClass(CLASSES.ACTIVE);select();input.focus();return false}).mousedown(function(){config.mouseDownOnSelect=true}).mouseup(function(){config.mouseDownOnSelect=false});if(options.width>0){element.css("width",options.width)}var fcorner=$("<div/>").addClass("as_corner");var fbar=$("<div/>").addClass("as_bar");var footer=$("<div/>").addClass("as_footer");fcorner.appendTo(footer);fbar.appendTo(footer);footer.appendTo(element);needsInit=false}function target(event){var element=event.target;while(element&&element.tagName!="LI"){element=element.parentNode}if(!element){return[]}return element}function moveSelect(step){listItems.slice(active,active+1).removeClass(CLASSES.ACTIVE);movePosition(step);var activeItem=listItems.slice(active,active+1).addClass(CLASSES.ACTIVE);if(options.scroll){var offset=0;listItems.slice(0,active).each(function(){offset+=this.offsetHeight+4});if((offset+activeItem[0].offsetHeight-list.scrollTop())>list[0].clientHeight){list.scrollTop(offset+activeItem[0].offsetHeight-list.innerHeight())}else{if(offset<list.scrollTop()){list.scrollTop(offset)}}}}function movePosition(step){active+=step;if(active<0){active=listItems.size()-1}else{if(active>=listItems.size()){active=0}}}function limitNumberOfItems(available){return options.max&&options.max<available?options.max:available}function fillList(){list.empty();var max=limitNumberOfItems(data.length);for(var i=0;i<max;i++){if(!data[i]){continue}var formatted=options.formatItem(data[i].data,i+1,max,data[i].value,term);if(formatted===false){continue}var li=$("<li/>").addClass(i%2==0?"ac_even":"ac_odd");var a=$('<a href="#"/>').attr("name",i+1);var tl=$("<span/>").addClass("tl");var tr=$("<span/>").addClass("tr");var text=$("<span/>").attr("id","val");tl.appendTo(a);tr.appendTo(a);text.html(options.highlight(formatted,term));text.appendTo(a);a.appendTo(li);li.attr("id",i);li.appendTo(list)[0];$.data(i,"ac_data",data[i])}listItems=list.find("li");if(options.selectFirst){listItems.slice(0,1).addClass(CLASSES.ACTIVE);active=0}if($.fn.bgiframe){list.bgiframe()}}return{display:function(d,q){init();data=d;term=q;fillList()},next:function(){moveSelect(1)},prev:function(){moveSelect(-1)},pageUp:function(){if(active!=0&&active-8<0){moveSelect(-active)}else{moveSelect(-8)}},pageDown:function(){if(active!=listItems.size()-1&&active+8>listItems.size()){moveSelect(listItems.size()-1-active)}else{moveSelect(8)}},hide:function(){element&&element.hide();listItems&&listItems.removeClass(CLASSES.ACTIVE);active=-1},visible:function(){return element&&element.is(":visible")},current:function(){return this.visible()&&(listItems.filter("."+CLASSES.ACTIVE)[0]||options.selectFirst&&listItems[0])},show:function(){var offset=$(input).offset();element.css({width:typeof options.width=="string"||options.width>0?options.width:$(input).width(),top:offset.top+input.offsetHeight,left:offset.left}).show();if(options.scroll){list.scrollTop(0);list.css({maxHeight:options.scrollHeight,overflow:"auto"});if($.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var listHeight=0;listItems.each(function(){listHeight+=this.offsetHeight+4});var scrollbarsVisible=listHeight>options.scrollHeight;list.css("height",scrollbarsVisible?options.scrollHeight:listHeight);list.css('overflow-x','hidden');list.css('overflow-y',scrollbarsVisible?'auto':'hidden');if(!scrollbarsVisible){listItems.width(list.width()-parseInt(listItems.css("padding-left"))-parseInt(listItems.css("padding-right")))}}}},selected:function(){var selected=listItems&&listItems.filter("."+CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);return selected&&selected.length&&data[selected[0].id]},emptyList:function(){list&&list.empty()},unbind:function(){element&&element.remove()}}};$.Autocompleter.Selection=function(field,start,end){if(field.createTextRange){var selRange=field.createTextRange();selRange.collapse(true);selRange.moveStart("character",start);selRange.moveEnd("character",end);selRange.select()}else{if(field.setSelectionRange){field.setSelectionRange(start,end)}else{if(field.selectionStart){field.selectionStart=start;field.selectionEnd=end}}}}})(jQuery);function findValue(li){if(li==null)return alert("No match!");if(!!li.extra)var sValue=li.extra[0];else var sValue=li.selectValue;alert("The value you selected was: "+sValue);}
function selectItem(li){findValue(li);}
function lookupAjax(){var oSuggest=$j("#query")[0].autocompleter;oSuggest.findValue();return false;}
function lookupLocal(){var oSuggest=$j("#query")[0].autocompleter;oSuggest.findValue();return false;}
$j(document).ready(function(){$j("#query").autocomplete('/app/autosuggest/category',{minChars:2,matchContains:false,selectFirst:false,autoFill:false,scroll:true,scrollHeight:240,delay:20,width:300,formatItem:function(row,i,max){return row[2].replace(/.*<br>\.\.\./,'').replace(/ \(\d*\)$/,'');var retString="";if(row[1]=="2"){retString+="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";}
if(row[1]=="3"){retString+="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";}
if(row[1]=="4"){retString+="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";}
if(row[1]=="1"){retString+=row[2];}else{retString+=row[0];}
return retString;},formatResult:function(row){return row[0];}});$j("#location").autocomplete('/app/autosuggest/location',{width:190,onItemSelect:selectItem,onFindValue:findValue,autoFill:true});$j("#termsTitle").toggle(function(){$j("#termslist").show("slow");$j("#termsTitle").html("Hide Categories");},function(){$j("#termslist").hide("slow");$j("#termsTitle").html("View all Categories");});$j('div.read-more> div').hide();$j('div.read-more> a.more').click(function(){$j(this).next().slideToggle('fast');$j(this).toggleClass("less");if($j(this).html()=="less...&nbsp;&nbsp;&nbsp;"){$j(this).html("more...&nbsp;&nbsp;&nbsp;");}else{$j(this).html("less...&nbsp;&nbsp;&nbsp;");}});});function tree_component(){if(typeof tree_component.inst=="undefined"){tree_component.cntr=0;tree_component.inst=new Array();tree_component.focusInst=function(){return tree_component.inst[tree_component.focused]}}return{cntr:tree_component.cntr++,settings:{data:{type:"predefined",async:false,url:false,json:false},dflt:false,languages:[],path:false,cookies:false,ui:{dots:true,rtl:false,animation:0,hover_mode:true},rules:{multiple:false,metadata:false,type_attr:"rel",multitree:false,createat:"bottom",use_inline:false,clickable:"all",renameable:"all",deletable:"all",creatable:"all",draggable:"none",dragrules:"none",drag_copy:false},lang:{new_node:"New folder",loading:"Loading ..."},callback:{beforechange:function(NODE,TREE_OBJ){return true},beforemove:function(NODE,REF_NODE,TYPE,TREE_OBJ){return true},beforecreate:function(NODE,REF_NODE,TYPE,TREE_OBJ){return true},beforerename:function(NODE,LANG,TREE_OBJ){return true},beforedelete:function(NODE,TREE_OBJ){return true},onchange:function(NODE,TREE_OBJ){},onrename:function(NODE,LANG,TREE_OBJ){},onmove:function(NODE,REF_NODE,TYPE,TREE_OBJ){},oncopy:function(NODE,REF_NODE,TYPE,TREE_OBJ){},oncreate:function(NODE,REF_NODE,TYPE,TREE_OBJ){},ondelete:function(NODE,TREE_OBJ){},onopen:function(NODE,TREE_OBJ){},onclose:function(NODE,TREE_OBJ){},error:function(TEXT,TREE_OBJ){},ondblclk:function(NODE,TREE_OBJ){TREE_OBJ.toggle_branch.call(TREE_OBJ,NODE);TREE_OBJ.select_branch.call(TREE_OBJ,NODE)},onrgtclk:function(NODE,TREE_OBJ,EV){},onload:function(TREE_OBJ){},onfocus:function(TREE_OBJ){}}},init:function(elem,opts){var _this=this;this.container=$(elem);if(this.container.size==0){alert("Invalid container node!");return}tree_component.inst[this.cntr]=this;if(!this.container.attr("id")){this.container.attr("id","jstree_"+this.cntr)}tree_component.inst[this.container.attr("id")]=tree_component.inst[this.cntr];tree_component.focused=this.cntr;if(opts&&opts.cookies){this.settings.cookies=$.extend({},this.settings.cookies,opts.cookies);delete opts.cookies;if(!this.settings.cookies.opts){this.settings.cookies.opts={}}}if(opts&&opts.callback){this.settings.callback=$.extend({},this.settings.callback,opts.callback);delete opts.callback}if(opts&&opts.data){this.settings.data=$.extend({},this.settings.data,opts.data);delete opts.data}if(opts&&opts.ui){this.settings.ui=$.extend({},this.settings.ui,opts.ui);delete opts.ui}if(opts&&opts.rules){this.settings.rules=$.extend({},this.settings.rules,opts.rules);delete opts.rules}if(opts&&opts.lang){this.settings.lang=$.extend({},this.settings.lang,opts.lang);delete opts.lang}this.settings=$.extend({},this.settings,opts);if(this.settings.path==false){this.path="";$("script").each(function(){if(this.src.toString().match(/tree_component.*?js$/)){_this.path=this.src.toString().replace(/tree_component.*?js$/,"")}})}else{this.path=this.settings.path}this.current_lang=this.settings.languages&&this.settings.languages.length?this.settings.languages[0]:false;if(this.settings.languages&&this.settings.languages.length){this.sn=get_sheet_num("tree_component.css");var st=false;var id=this.container.attr("id")?"#"+this.container.attr("id"):".tree";for(var ln=0;ln<this.settings.languages.length;ln++){st=add_css(id+" ."+this.settings.languages[ln],this.sn);if(st!==false){if(this.settings.languages[ln]==this.current_lang){st.style.display="inline"}else{st.style.display="none"}}}}this.container.addClass("tree").css({position:"relative"});if(this.settings.ui.rtl){this.container.addClass("rtl")}if(this.settings.rules.multiple){this.selected_arr=[]}this.offset=this.container.offset();this.offset.top=this.offset.top+parseInt($.curCSS(this.container.get(0),"paddingTop",true),10)+parseInt($.curCSS(this.container.get(0),"borderTopWidth",true),10);this.container.css({position:""});if(this.settings.ui.dots==false){this.container.addClass("no_dots")}this.hovered=false;this.locked=false;if(this.settings.rules.draggable!="none"&&this.settings.rules.dragrules!="none"){var _this=this;$("<img>").attr({id:"marker",src:_this.path+"images/marker.gif"}).css({height:"5px",width:"40px",display:"block",position:"absolute",left:"30px",top:"30px",zIndex:"1000"}).hide().appendTo("body")}this.refresh();this.attachEvents();this.focus()},refresh:function(obj){if(this.locked){return this.error("LOCKED")}var _this=this;this.settings.dflt=(this.selected)?"#"+this.selected.attr("id"):this.settings.dflt;if(this.settings.cookies){var str=$.cookie(this.settings.cookies.prefix+"_selected");if(str){this.settings.dflt="#"+str}}if(obj&&this.settings.data.async){this.opened=Array();obj=this.get_node(obj);obj.find("li.open").each(function(i){_this.opened.push(this.id)});this.close_branch(obj,true);obj.children("ul:eq(0)").html("");return this.open_branch(obj,true,function(){_this.reselect.apply(_this)})}this.opened=Array();if(this.settings.cookies){var str=$.cookie(this.settings.cookies.prefix+"_open");if(str&&str.length){str=str.split(",")}else{str=[]}if(str.length){this.opened=str}}else{this.container.find("li.open").each(function(i){_this.opened.push(this.id)})}if(this.settings.data.type=="xml_flat"||this.settings.data.type=="xml_nested"){this.scrtop=this.container.get(0).scrollTop;var xsl=(this.settings.data.type=="xml_flat")?"flat.xsl":"nested.xsl";this.container.getTransform(this.path+xsl,this.settings.data.url,{callback:function(){_this.reselect.apply(_this)}});return}else{if(this.settings.data.type=="json"){if(this.settings.data.json){var str="";if(this.settings.data.json.length){for(var i=0;i<this.settings.data.json.length;i++){str+=this.parseJSON(this.settings.data.json[i])}}else{str=this.parseJSON(this.settings.data.json)}this.container.html("<ul>"+str+"</ul>");this.container.find("li:last-child").addClass("last").end().find("li:has(ul)").not(".open").addClass("closed");this.container.find("li").not(".open").not(".closed").addClass("leaf");this.reselect()}else{var _this=this;$.getJSON(this.settings.data.url,{id:0},function(data){var str="";if(data.length){for(var i=0;i<data.length;i++){str+=_this.parseJSON(data[i])}}else{str=_this.parseJSON(data)}_this.container.html("<ul>"+str+"</ul>");_this.container.find("li:last-child").addClass("last").end().find("li:has(ul)").not(".open").addClass("closed");_this.container.find("li").not(".open").not(".closed").addClass("leaf");_this.reselect.apply(_this)})}}else{this.container.find("li:last-child").addClass("last").end().find("li:has(ul)").not(".open").addClass("closed");this.container.find("li").not(".open").not(".closed").addClass("leaf");this.reselect()}}},parseJSON:function(data){var str="";str+="<li ";var cls=false;for(i in data.attributes){if(i=="class"){str+=" class='"+data.attributes[i]+" ";if(data.state=="closed"||data.state=="open"){str+=" "+data.state+" "}str+="' ";cls=true}else{str+=" "+i+"='"+data.attributes[i]+"' "}}if(!cls&&(data.state=="closed"||data.state=="open")){str+=" class='"+data.state+"' "}str+=">";if(this.settings.languages.length){for(var i=0;i<this.settings.languages.length;i++){str+="<a href='#' class='"+this.settings.languages[i]+"' ";if(data.icons&&data.icons[this.settings.languages[i]]){str+=" style='background-image:url(\""+data.icons[this.settings.languages[i]]+"\");' "}str+=">"+data.data[this.settings.languages[i]]+"</a>"}}else{str+="<a href='#' ";if(data.icons){str+=" style='background-image:url(\""+data.icons+"\");' "}str+=">"+data.data+"</a>"}if(data.children&&data.children.length){str+="<ul>";for(var i=0;i<data.children.length;i++){str+=this.parseJSON(data.children[i])}str+="</ul>"}str+="</li>";return str},getJSON:function(nod,attrib){var _this=this;if(!nod||$(nod).size()==0){nod=this.container.children("ul").children("li")}else{nod=$(nod)}if(nod.size()>1){var arr=[];nod.each(function(){arr.push(_this.getJSON(this))});return arr}if(!attrib){attrib=["id","rel","class"]}var obj={attributes:{},data:false,icons:false};for(i in attrib){obj.attributes[attrib[i]]=nod.attr(attrib[i])}var a=nod.children("a");if(a.size()>1){obj.data=[];obj.icons=[];a.each(function(){obj.data.push(this.innerHTML);obj.icons.push(this.style.backgroundImage.replace("url(","").replace(")",""))})}else{obj.data=a.text();obj.icons=a.css("backgroundImage").replace("url(","").replace(")","")}if(nod.children("ul").size()>0){obj.children=[];nod.children("ul").children("li").each(function(){obj.children.push(_this.getJSON(this))})}return obj},focus:function(){if(this.locked){return false}if(tree_component.focused!=this.cntr){tree_component.focused=this.cntr;this.settings.callback.onfocus.call(null,this)}},attachEvents:function(){var _this=this;var tmp=this.container.find("li.closed:eq(0)");if(tmp.size()==0){tmp=this.container.find("li.leaf:eq(0)")}this.li_height=tmp.height();if(!this.li_height){this.li_height=18}this.container.bind("mouseup",function(event){_this.focus.apply(_this)}).bind("click",function(event){event.stopPropagation();return true}).listen("click","li",function(event){_this.toggle_branch.apply(_this,[event.target]);event.stopPropagation()}).listen("click","a",function(event){if(_this.locked){event.preventDefault();event.target.blur();return _this.error("LOCKED")}_this.select_branch.apply(_this,[event.target,event.ctrlKey||_this.settings.rules.multiple=="on"]);if(_this.inp){_this.inp.blur()}event.preventDefault();event.target.blur();return false}).listen("dblclick","a",function(event){if(_this.locked){event.preventDefault();event.stopPropagation();event.target.blur();return _this.error("LOCKED")}_this.settings.callback.ondblclk.call(null,_this.get_node(event.target).get(0),_this);event.preventDefault();event.stopPropagation();event.target.blur()}).listen("contextmenu","a",function(event){if(_this.locked){return _this.error("LOCKED")}return _this.settings.callback.onrgtclk.call(null,_this.get_node(event.target).get(0),_this,event)}).listen("mouseover","a",function(event){if(_this.locked){event.preventDefault();event.stopPropagation();return _this.error("LOCKED")}if(_this.settings.ui.hover_mode&&_this.hovered!==false&&event.target.tagName=="A"){_this.hovered.children("a").removeClass("hover");_this.hovered=false}});if(this.settings.rules.draggable!="none"&&this.settings.rules.dragrules!="none"){$(this.container).listen("mousedown","a",function(event){if(_this.locked){return _this.error("LOCKED")}var obj=_this.get_node(event.target);if(_this.settings.rules.multiple!=false&&_this.selected_arr.length>1&&obj.children("a:eq(0)").hasClass("clicked")){var counter=0;for(i in _this.selected_arr){if(_this.check("draggable",_this.selected_arr[i])){_this.selected_arr[i].addClass("dragged");counter++}}if(counter>0){if(_this.check("draggable",obj)){_this._drag=obj}else{_this._drag=_this.container.find("li.dragged:eq(0)")}_this.isdown=true;_this.drag=_this._drag.get(0).cloneNode(true);_this.drag.id="dragged";$(_this.drag).children("a").html("Multiple selection").end().children("ul").remove()}}else{if(_this.check("draggable",obj)){_this._drag=obj;_this.drag=obj.get(0).cloneNode(true);_this.drag.id="dragged";_this.isdown=true;obj.addClass("dragged")}}obj.blur();event.preventDefault();event.stopPropagation();return false});$(document).bind("mousedown",function(event){event.stopPropagation();return true}).bind("mouseup",function(event){if(tree_component.to){clearTimeout(tree_component.to)}if(tree_component.sto){clearTimeout(tree_component.sto)}if(_this.drag&&_this.drag.parentNode&&_this.drag.parentNode==$(_this.container).get(0)){$(_this.drag).remove();if(_this.moveType){_this.moved(_this.container.find("li.dragged"),_this.moveRef,_this.moveType,false,(_this.settings.rules.drag_copy=="on"||(_this.settings.rules.drag_copy=="ctrl"&&event.ctrlKey)))}_this.moveType=false;_this.moveRef=false}$("#marker").hide();_this._drag=false;_this.drag=false;_this.isdown=false;_this.appended=false;_this.container.find("li.dragged").removeClass("dragged");event.preventDefault();event.stopPropagation();return false}).bind("mousemove",function(event){if(_this.locked){return _this.error("LOCKED")}if(_this.isdown){if(tree_component.to){clearTimeout(tree_component.to)}if(!_this.appended){_this.container.append(_this.drag);var tmp=$(_this.drag).offsetParent();if(tmp.is("html")){tmp=$("body")}_this.po=tmp.offset();_this.appended=true}$(_this.drag).css({left:(event.pageX-_this.po.left-(_this.settings.ui.rtl?$(_this.drag).width():-5)),top:(event.pageY-_this.po.top+($.browser.opera?_this.container.scrollTop():0)+15)});var cnt=$(event.target).parents(".tree:eq(0)");if(cnt.size()==0){if(tree_component.sto){clearTimeout(tree_component.sto)}return false}if(cnt.get(0)!=_this.container.get(0)&&(!_this.settings.rules.multitree||!tree_component.inst[cnt.attr("id")].settings.rules.multitree)){if($(_this.drag).children("IMG").size()==0){$(_this.drag).append("<img style='position:absolute; "+(_this.settings.ui.rtl?"right":"left")+":4px; top:0px; background:white; padding:2px;' src='"+_this.path+"images/remove.png' />")}_this.moveType=false;_this.moveRef=false;$("#marker").hide();return false}if(tree_component.sto){clearTimeout(tree_component.sto)}tree_component.sto=setTimeout(function(){tree_component.inst[cnt.attr("id")].scrollCheck(event.pageX,event.pageY)},50);var mov=false;var st=cnt.scrollTop();if(event.target.tagName=="A"){var goTo={x:($(event.target).offset().left-1),y:(event.pageY-tree_component.inst[cnt.attr("id")].offset.top)};if(cnt.hasClass("rtl")){goTo.x+=$(event.target).width()-8}if((goTo.y+st)%_this.li_height<_this.li_height/3+1){mov="before";goTo.y=event.pageY-(goTo.y+st)%_this.li_height-2}else{if((goTo.y+st)%_this.li_height>_this.li_height*2/3-1){mov="after";goTo.y=event.pageY-(goTo.y+st)%_this.li_height+_this.li_height-2}else{mov="inside";goTo.x-=2;if(cnt.hasClass("rtl")){goTo.x+=36}goTo.y=event.pageY-(goTo.y+st)%_this.li_height+Math.floor(_this.li_height/2)-2;if(_this.get_node(event.target).hasClass("closed")){tree_component.to=setTimeout(function(){_this.open_branch(_this.get_node(event.target))},500)}}}if(tree_component.inst[cnt.attr("id")].checkMove(_this.container.find("li.dragged"),$(event.target),mov)){if(mov=="inside"){$("#marker").attr("src",_this.path+"images/plus.gif").width(11)}else{if(cnt.hasClass("rtl")){$("#marker").attr("src",_this.path+"images/marker_rtl.gif").width(40)}else{$("#marker").attr("src",_this.path+"images/marker.gif").width(40)}}_this.moveType=mov;_this.moveRef=event.target;$(_this.drag).children("IMG").remove();$("#marker").css({left:goTo.x,top:goTo.y}).show()}else{if($(_this.drag).children("IMG").size()==0){$(_this.drag).append("<img style='position:absolute; "+(_this.settings.ui.rtl?"right":"left")+":4px; top:0px; background:white; padding:2px;' src='"+_this.path+"images/remove.png' />")}_this.moveType=false;_this.moveRef=false;$("#marker").hide()}}else{if(event.target.tagName=="IMG"&&event.target.id=="marker"){}else{_this.moveType=false;_this.moveRef=false;$("#marker").hide()}}event.preventDefault();event.stopPropagation();return false}return true})}},checkMove:function(NODES,REF_NODE,TYPE){if(this.locked){return this.error("LOCKED")}var _this=this;if(REF_NODE.parents("li.dragged").size()>0||REF_NODE.is(".dragged")){return this.error("MOVE: NODE OVER SELF")}if(NODES.size()==1){var NODE=NODES.eq(0);if(!this.check("dragrules",[NODE,TYPE,REF_NODE.parents("li:eq(0)")])){return this.error("MOVE: AGAINST DRAG RULES")}}else{var ok=true;NODES.each(function(i){if(ok==false){return false}if(i>0){var ref=NODES.eq((i-1));var mv="after"}else{var ref=REF_NODE;var mv=TYPE}if(!_this.check.apply(_this,["dragrules",[$(this),mv,ref]])){ok=false}});if(ok==false){return this.error("MOVE: AGAINST DRAG RULES")}}if(this.settings.rules.use_inline&&this.settings.rules.metadata){var nd=false;if(TYPE=="inside"){nd=REF_NODE.parents("li:eq(0)")}else{nd=REF_NODE.parents("li:eq(1)")}if(nd.size()){if(typeof nd.metadata()["valid_children"]!="undefined"){var tmp=nd.metadata()["valid_children"];var ok=true;NODES.each(function(i){if(ok==false){return false}if($.inArray(_this.get_type(this),tmp)==-1){ok=false}});if(ok==false){return this.error("MOVE: NOT A VALID CHILD")}}if(typeof nd.metadata()["max_children"]!="undefined"){if((nd.children("ul:eq(0)").children("li").not(".dragged").size()+NODES.size())>nd.metadata().max_children){return this.error("MOVE: MAX CHILDREN REACHED")}}var incr=0;NODES.each(function(i){var i=1;var t=$(this);while(i<100){t=t.children("ul:eq(0)");if(t.size()==0){break}i++}incr=Math.max(i,incr)});var ok=true;nd.parents("li").each(function(i){if(ok==false){return false}if($(this).metadata().max_depth){if((i+incr)>=$(this).metadata().max_depth){ok=false}}});if(ok==false){return this.error("MOVE: MAX_DEPTH REACHED")}}}return true},reselect:function(){var _this=this;if(this.opened&&this.opened.length){var opn=false;for(var j=0;j<this.opened.length;j++){if(this.settings.data.async){if(this.get_node("#"+this.opened[j]).size()>0){opn=true;var tmp=this.opened[j];delete this.opened[j];this.open_branch("#"+tmp,true,function(){_this.reselect.apply(_this)})}}else{this.open_branch("#"+this.opened[j],true)}}if(this.settings.data.async&&opn){return}delete this.opened}if(this.scrtop){this.container.scrollTop(_this.scrtop);delete this.scrtop}if(this.settings.rules.multiple!=false&&this.selected_arr.length>1){var tmp=this.selected_arr;this.selected_arr=[];for(i in tmp){this.select_branch("#"+tmp[i].attr("id"),true)}}else{if(this.settings.dflt&&$(this.settings.dflt).size()==1){this.selected=$(this.settings.dflt);this.settings.dflt=false;this.select_branch(this.selected)}}this.settings.callback.onload.call(null,_this)},get_node:function(obj){var obj=$(obj);return obj.is("li")?obj:obj.parents("li:eq(0)")},get_type:function(obj){obj=!obj?this.selected:this.get_node(obj);if(!obj){return}if(this.settings.rules.metadata){$.metadata.setType("attr",this.settings.rules.metadata);return obj.metadata().type}else{return obj.attr(this.settings.rules.type_attr)}},scrollCheck:function(x,y){var _this=this;var cnt=_this.container;var off=_this.offset;if(y-off.top<20){cnt.scrollTop(Math.max(cnt.scrollTop()-4,0))}var h_cor=(cnt.get(0).scrollWidth>cnt.width())?40:20;if(cnt.height()-(y-off.top)<h_cor){cnt.scrollTop(cnt.scrollTop()+4)}if(x-off.left<20){cnt.scrollLeft(cnt.scrollLeft()-4)}if(cnt.width()-(x-off.left)<40){cnt.scrollLeft(cnt.scrollLeft()+4)}tree_component.sto=setTimeout(function(){_this.scrollCheck(x,y)},50)},check:function(rule,nodes){if(this.locked){return this.error("LOCKED")}if(rule!="dragrules"&&this.settings.rules.use_inline&&this.settings.rules.metadata){$.metadata.setType("attr",this.settings.rules.metadata);if(typeof this.get_node(nodes).metadata()[rule]!="undefined"){return this.get_node(nodes).metadata()[rule]}}if(!this.settings.rules[rule]){return false}if(this.settings.rules[rule]=="none"){return false}if(this.settings.rules[rule]=="all"){return true}if(rule=="dragrules"){var nds=new Array();nds[0]=this.get_type(nodes[0]);nds[1]=nodes[1];nds[2]=this.get_type(nodes[2]);for(var i=0;i<this.settings.rules.dragrules.length;i++){var tmp=this.settings.rules.dragrules[i].split(" ");for(var j=0;j<3;j++){if(tmp[j]==nds[j]||tmp[j]=="*"){tmp[j]=true}}if(tmp[0]===true&&tmp[1]===true&&tmp[2]===true){return true}}return false}else{return($.inArray(this.get_type(nodes),this.settings.rules[rule])!=-1)?true:false}},hover_branch:function(obj){if(this.locked){return this.error("LOCKED")}if(this.settings.ui.hover_mode==false){return this.select_branch(obj)}var _this=this;var obj=_this.get_node(obj);if(!obj.size()){return this.error("HOVER: NOT A VALID NODE")}if(!_this.check("clickable",obj)){return this.error("SELECT: NODE NOT SELECTABLE")}if(this.hovered){this.hovered.children("A").removeClass("hover")}this.hovered=obj;this.hovered.children("a").removeClass("hover").addClass("hover");var off_t=this.hovered.offset().top;var beg_t=this.container.offset().top;var end_t=beg_t+this.container.height();var h_cor=(this.container.get(0).scrollWidth>this.container.width())?40:20;if(off_t+5<beg_t){this.container.scrollTop(this.container.scrollTop()-(beg_t-off_t+5))}if(off_t+h_cor>end_t){this.container.scrollTop(this.container.scrollTop()+(off_t+h_cor-end_t))}},select_branch:function(obj,multiple){if(this.locked){return this.error("LOCKED")}if(!obj&&this.hovered!==false){obj=this.hovered}var _this=this;obj=_this.get_node(obj);if(!obj.size()){return this.error("SELECT: NOT A VALID NODE")}obj.children("a").removeClass("hover");if(!_this.check("clickable",obj)){return this.error("SELECT: NODE NOT SELECTABLE")}if(_this.settings.callback.beforechange.call(null,obj.get(0),_this)===false){return this.error("SELECT: STOPPED BY USER")}if(this.settings.rules.multiple!=false&&multiple&&obj.children("a.clicked").size()>0){return this.deselect_branch(obj)}if(this.settings.rules.multiple!=false&&multiple){this.selected_arr.push(obj)}if(this.settings.rules.multiple!=false&&!multiple){for(i in this.selected_arr){this.selected_arr[i].children("A").removeClass("clicked")}this.selected_arr=[];this.selected_arr.push(obj);if(this.selected){this.selected.children("A").removeClass("clicked")}}if(!this.settings.rules.multiple){if(this.selected){this.selected.children("A").removeClass("clicked")}}this.selected=obj;if(this.settings.ui.hover_mode&&this.hovered!==false){this.hovered.children("A").removeClass("hover");this.hovered=obj}this.selected.children("a").removeClass("clicked").addClass("clicked").end().parents("li.closed").each(function(){_this.open_branch(this,true)});var off_t=this.selected.offset().top;var beg_t=this.container.offset().top;var end_t=beg_t+this.container.height();var h_cor=(this.container.get(0).scrollWidth>this.container.width())?40:20;if(off_t+5<beg_t){this.container.scrollTop(this.container.scrollTop()-(beg_t-off_t+5))}if(off_t+h_cor>end_t){this.container.scrollTop(this.container.scrollTop()+(off_t+h_cor-end_t))}this.set_cookie("selected");this.settings.callback.onchange.call(null,this.selected.get(0),_this)},deselect_branch:function(obj){if(this.locked){return this.error("LOCKED")}var _this=this;var obj=this.get_node(obj);obj.children("a").removeClass("clicked");if(this.settings.rules.multiple!=false&&this.selected_arr.length>1){this.selected_arr=[];this.container.find("a.clicked").filter(":first-child").parent().each(function(){_this.selected_arr.push($(this))});if(obj.get(0)==this.selected.get(0)){this.selected=this.selected_arr[0];this.set_cookie("selected")}}else{if(this.settings.rules.multiple!=false){this.selected_arr=[]}this.selected=false;this.set_cookie("selected")}if(this.selected){this.settings.callback.onchange.call(null,this.selected.get(0),_this)}else{this.settings.callback.onchange.call(null,false,_this)}},toggle_branch:function(obj){if(this.locked){return this.error("LOCKED")}var obj=this.get_node(obj);if(obj.hasClass("closed")){return this.open_branch(obj)}if(obj.hasClass("open")){return this.close_branch(obj)}},open_branch:function(obj,disable_animation,callback){if(this.locked){return this.error("LOCKED")}var obj=this.get_node(obj);if(!obj.size()){return this.error("OPEN: NO SUCH NODE")}if(this.settings.data.async&&obj.find("li").size()==0){var _this=this;obj.children("ul:eq(0)").remove().end().append("<ul><li class='last'><a style='background-image:url("+_this.path+"images/throbber.gif)' href='#'>"+(_this.settings.lang.loading||"Loading ...")+"</a></li></ul>");obj.removeClass("closed").addClass("open");if(this.settings.data.type=="xml_flat"||this.settings.data.type=="xml_nested"){var xsl=(this.settings.data.type=="xml_flat")?"flat.xsl":"nested.xsl";var str=(this.settings.data.url.indexOf("?")==-1)?"?id="+encodeURIComponent(obj.attr("id")):"&id="+encodeURIComponent(obj.attr("id"));obj.children("ul:eq(0)").getTransform(this.path+xsl,this.settings.data.url+str,{repl:true,callback:function(str,json){if(str.length<10){obj.removeClass("closed").removeClass("open").addClass("leaf").children("ul").remove();if(callback){callback.call()}return}_this.open_branch.apply(_this,[obj]);if(callback){callback.call()}}})}else{$.getJSON(this.settings.data.url,{id:obj.attr("id")},function(data,textStatus){if(!data||data.length==0){obj.removeClass("closed").removeClass("open").addClass("leaf").children("ul").remove();if(callback){callback.call()}return}var str="";if(data.length){for(var i=0;i<data.length;i++){str+=_this.parseJSON(data[i])}}else{str=_this.parseJSON(data)}obj.children("ul:eq(0)").replaceWith("<ul>"+str+"</ul>");obj.find("li:last-child").addClass("last").end().find("li:has(ul)").not(".open").addClass("closed");obj.find("li").not(".open").not(".closed").addClass("leaf");_this.open_branch.apply(_this,[obj]);if(callback){callback.call()}})}return true}else{if(parseInt(this.settings.ui.animation)>0&&!disable_animation&&!($.browser.msie&&$.browser.version<7)){obj.children("ul:eq(0)").css("display","none");obj.removeClass("closed").addClass("open");obj.children("ul:eq(0)").slideDown(parseInt(this.settings.ui.animation),function(){$(this).css("display","");if(callback){callback.call()}})}else{obj.removeClass("closed").addClass("open");if(callback){callback.call()}}this.set_cookie("open");this.settings.callback.onopen.call(null,obj.get(0),this);return true}},close_branch:function(obj,disable_animation){if(this.locked){return this.error("LOCKED")}var _this=this;var obj=this.get_node(obj);if(parseInt(this.settings.ui.animation)>0&&!disable_animation&&!($.browser.msie&&$.browser.version<7)&&obj.children("ul:eq(0)").size()==1){obj.children("ul:eq(0)").slideUp(parseInt(this.settings.ui.animation),function(){obj.removeClass("open").addClass("closed");_this.set_cookie("open");$(this).css("display","")})}else{obj.removeClass("open").addClass("closed");this.set_cookie("open")}if(this.selected&&obj.children("ul:eq(0)").find("a.clicked").size()>0){obj.find("li:has(a.clicked)").each(function(){_this.deselect_branch(this)});if(obj.children("a.clicked").size()==0){this.select_branch(obj,(this.settings.rules.multiple!=false&&this.selected_arr.length>0))}}this.settings.callback.onclose.call(null,obj.get(0),this)},open_all:function(obj){if(this.locked){return this.error("LOCKED")}var _this=this;obj=obj?$(obj):this.container;obj.find("li.closed").each(function(){var __this=this;_this.open_branch.apply(_this,[this,true,function(){_this.open_all.apply(_this,[__this])}])})},close_all:function(){if(this.locked){return this.error("LOCKED")}var _this=this;$(this.container).find("li.open").each(function(){_this.close_branch(this)})},show_lang:function(i){if(this.locked){return this.error("LOCKED")}if(this.settings.languages[i]==this.current_lang){return true}var st=false;var id=this.container.attr("id")?"#"+this.container.attr("id"):".tree";st=get_css(id+" ."+this.current_lang,this.sn);if(st!==false){st.style.display="none"}st=get_css(id+" ."+this.settings.languages[i],this.sn);if(st!==false){st.style.display="block"}this.current_lang=this.settings.languages[i];return true},cycle_lang:function(){if(this.locked){return this.error("LOCKED")}var i=$.inArray(this.current_lang,this.settings.languages);i++;if(i>this.settings.languages.length-1){i=0}this.show_lang(i)},create:function(type,obj,data,icon){if(this.locked){return this.error("LOCKED")}obj=obj?this.get_node(obj):this.selected;if(!obj||!obj.size()){return this.error("CREATE: NO NODE SELECTED")}if(!this.check("creatable",obj)){return this.error("CREATE: CANNOT CREATE IN NODE")}var t=type||this.get_type(obj);if(this.settings.rules.use_inline&&this.settings.rules.metadata){$.metadata.setType("attr",this.settings.rules.metadata);if(typeof obj.metadata()["valid_children"]!="undefined"){if($.inArray(t,obj.metadata()["valid_children"])==-1){return this.error("CREATE: NODE NOT A VALID CHILD")}}if(typeof obj.metadata()["max_children"]!="undefined"){if((obj.children("ul:eq(0)").children("li").size()+1)>obj.metadata().max_children){return this.error("CREATE: MAX_CHILDREN REACHED")}}var ok=true;obj.parents("li").each(function(i){if($(this).metadata().max_depth){if((i+1)>=$(this).metadata().max_depth){ok=false}}});if(!ok){return this.error("CREATE: MAX_DEPTH REACHED")}}if(obj.hasClass("closed")){var _this=this;return this.open_branch(obj,true,function(){_this.create.apply(_this,[type,obj])})}$li=$("<li />");if(this.settings.rules.metadata){$.metadata.setType("attr",this.settings.rules.metadata);$li.attr(this.settings.rules.metadata,"type: '"+t+"'")}else{$li.attr(this.settings.rules.type_attr,t)}var icn=(typeof icon).toLowerCase()=="string"?icon:"";if(this.settings.languages.length){for(i=0;i<this.settings.languages.length;i++){if((typeof data).toLowerCase()=="string"){val=data}else{if(data&&data[i]){val=data[i]}else{if(this.settings.lang.new_node){if((typeof this.settings.lang.new_node).toLowerCase()!="string"&&this.settings.lang.new_node[i]){val=this.settings.lang.new_node[i]}else{val=this.settings.lang.new_node}}else{val="New folder"}}}if((typeof icon).toLowerCase()!="string"&&icon[i]){icn=icon[i]}$li.append("<a href='#'"+(icn.length?" style='background-image:url(\""+icn+"\");' ":" ")+"class='"+this.settings.languages[i]+"'>"+val+"</a>")}}else{$li.append("<a href='#'"+(icn.length?" style='background-image:url(\""+icn+"\");' ":" ")+">"+(data||this.settings.lang.new_node||"New folder")+"</a>")}$li.addClass("leaf");if(this.settings.rules.createat=="top"||obj.children("ul").size()==0){this.moved($li,obj.children("a:eq(0)"),"inside",true)}else{this.moved($li,obj.children("ul:eq(0)").children("li:last").children("a:eq(0)"),"after",true)}this.select_branch($li.children("a:eq(0)"));if(!data){this.rename()}return $li},rename:function(){if(this.locked){return this.error("LOCKED")}if(this.selected){var _this=this;if(!this.check("renameable",this.selected)){return this.error("RENAME: NODE NOT RENAMABLE")}if(!this.settings.callback.beforerename.call(null,this.selected.get(0),_this.current_lang,_this)){return this.error("RENAME: STOPPED BY USER")}var obj=this.selected;if(this.current_lang){obj=obj.find("a."+this.current_lang).get(0)}else{obj=obj.find("a:first").get(0)}last_value=obj.innerHTML;_this.inp=$("<input type='text' />");_this.inp.val(last_value).bind("mousedown",function(event){event.stopPropagation()}).bind("mouseup",function(event){event.stopPropagation()}).bind("click",function(event){event.stopPropagation()}).bind("keyup",function(event){var key=event.keyCode||event.which;if(key==27){this.value=last_value;this.blur();return}if(key==13){this.blur();return}});_this.inp.blur(function(event){if(this.value==""){this.value==last_value}$(obj).html($(obj).parent().find("input").eq(0).attr("value")).get(0).style.display="";$(obj).prevAll("span").remove();if(this.value!=last_value){_this.settings.callback.onrename.call(null,_this.get_node(obj).get(0),_this.current_lang,_this)}_this.inp=false});var spn=$("<span />").addClass(obj.className).append(_this.inp);spn.attr("style",$(obj).attr("style"));obj.style.display="none";$(obj).parent().prepend(spn);_this.inp.get(0).focus();_this.inp.get(0).select()}else{return this.error("RENAME: NO NODE SELECTED")}},remove:function(obj){if(this.locked){return this.error("LOCKED")}if(obj){obj=this.get_node(obj);if(obj.size()){if(!this.check("deletable",obj)){return this.error("DELETE: NODE NOT DELETABLE")}if(!this.settings.callback.beforedelete.call(null,obj.get(0),_this)){return this.error("DELETE: STOPPED BY USER")}$parent=obj.parent();obj=obj.remove();$parent.children("li:last").addClass("last");if($parent.children("li").size()==0){$li=$parent.parents("li:eq(0)");$li.removeClass("open").removeClass("closed").addClass("leaf").children("ul").remove();this.set_cookie("open")}this.settings.callback.ondelete.call(null,obj,this)}}else{if(this.selected){if(!this.check("deletable",this.selected)){return this.error("DELETE: NODE NOT DELETABLE")}if(!this.settings.callback.beforedelete.call(null,this.selected.get(0),_this)){return this.error("DELETE: STOPPED BY USER")}$parent=this.selected.parent();var obj=this.selected;if(this.settings.rules.multiple==false||this.selected_arr.length==1){var stop=true;this.get_prev(true)}obj=obj.remove();$parent.children("li:last").addClass("last");if($parent.children("li").size()==0){$li=$parent.parents("li:eq(0)");$li.removeClass("open").removeClass("closed").addClass("leaf").children("ul").remove();this.set_cookie("open")}this.selected=false;this.settings.callback.ondelete.call(null,obj,this);if(this.settings.rules.multiple!=false&&!stop){var _this=this;this.selected_arr=[];this.container.find("a.clicked").filter(":first-child").parent().each(function(){_this.selected_arr.push($(this))});if(this.selected_arr.length>0){this.selected=this.selected_arr[0];this.remove()}}}else{return this.error("DELETE: NO NODE SELECTED")}}},get_next:function(force){var obj=this.hovered||this.selected;if(obj){if(obj.hasClass("open")){return force?this.select_branch(obj.find("li:eq(0)")):this.hover_branch(obj.find("li:eq(0)"))}else{if($(obj).nextAll("li").size()>0){return force?this.select_branch(obj.nextAll("li:eq(0)")):this.hover_branch(obj.nextAll("li:eq(0)"))}else{return force?this.select_branch(obj.parents("li").next("li").eq(0)):this.hover_branch(obj.parents("li").next("li").eq(0))}}}},get_prev:function(force){var obj=this.hovered||this.selected;if(obj){if(obj.prev("li").size()){var obj=obj.prev("li").eq(0);while(obj.hasClass("open")){obj=obj.children("ul:eq(0)").children("li:last")}return force?this.select_branch(obj):this.hover_branch(obj)}else{return force?this.select_branch(obj.parents("li:eq(0)")):this.hover_branch(obj.parents("li:eq(0)"))}}},get_left:function(force,rtl){if(this.settings.ui.rtl&&!rtl){return this.get_right(force,true)}var obj=this.hovered||this.selected;if(obj){if(obj.hasClass("open")){this.close_branch(obj)}else{return force?this.select_branch(obj.parents("li:eq(0)")):this.hover_branch(obj.parents("li:eq(0)"))}}},get_right:function(force,rtl){if(this.settings.ui.rtl&&!rtl){return this.get_left(force,true)}var obj=this.hovered||this.selected;if(obj){if(obj.hasClass("closed")){this.open_branch(obj)}else{return force?this.select_branch(obj.find("li:eq(0)")):this.hover_branch(obj.find("li:eq(0)"))}}},toggleDots:function(){this.container.toggleClass("no_dots")},set_cookie:function(type){if(this.settings.cookies===false){return false}switch(type){case"selected":var val=this.selected?this.selected.attr("id"):false;$.cookie(this.settings.cookies.prefix+"_selected",val,this.settings.cookies.opts);break;case"open":var str="";this.container.find("li.open").each(function(i){str+=this.id+","});$.cookie(this.settings.cookies.prefix+"_open",str.replace(/,$/ig,""),this.settings.cookies.opts);break}},moved:function(what,where,how,is_new,is_copy){var what=$(what);var $parent=$(what).parents("ul:eq(0)");var $where=$(where);if(what.size()>1){var _this=this;var tmp=this.moved(what.eq(0),where,how,false,is_copy);what.each(function(i){if(i==0){return}tmp=_this.moved(this,tmp.children("a:eq(0)"),"after",false,is_copy)});return}if(is_copy){what=what.clone();what.each(function(i){this.id=this.id+"_copy";$(this).find("li").each(function(){this.id=this.id+"_copy"});$(this).find("a.clicked").removeClass("clicked")})}if(is_new){if(!this.settings.callback.beforecreate.call(null,this.get_node(what).get(0),this.get_node(where).get(0),how,this)){return}}else{if(!this.settings.callback.beforemove.call(null,this.get_node(what).get(0),this.get_node(where).get(0),how,this)){return}}var tmp=$(where).parents(".tree:eq(0)");if(tmp.get(0)!=this.container.get(0)){tmp=tree_component.inst[tmp.attr("id")];if(this.settings.languages.length){var res=[];if(tmp.settings.languages.length==0){res.push("."+this.current_lang)}else{for(i in this.settings.languages){for(j in tmp.settings.languages){if(this.settings.languages[i]==tmp.settings.languages[j]){res.push("."+this.settings.languages[i])}}}}if(res.length==0){return this.error("MOVE: NO COMMON LANGUAGES")}what.find("a").removeClass("clicked").not(res.join(",")).remove()}}switch(how){case"before":$where.parents("ul:eq(0)").children("li.last").removeClass("last");$where.parent().before(what.removeClass("last"));$where.parents("ul:eq(0)").children("li:last").addClass("last");break;case"after":$where.parents("ul:eq(0)").children("li.last").removeClass("last");$where.parent().after(what.removeClass("last"));$where.parents("ul:eq(0)").children("li:last").addClass("last");break;case"inside":if(this.settings.data.async){var obj=this.get_node($where);if(obj.hasClass("closed")){var _this=this;return this.open_branch(obj,true,function(){_this.moved.apply(_this,[what,where,how,is_new,is_copy])})}}if($where.parent().children("ul:first").size()){if(this.settings.rules.createat=="top"){$where.parent().children("ul:first").prepend(what.removeClass("last")).children("li:last").addClass("last")}else{$where.parent().children("ul:first").children(".last").removeClass("last").end().append(what.removeClass("last")).children("li:last").addClass("last")}}else{what.addClass("last");$where.parent().append("<ul/>").removeClass("leaf").addClass("closed");$where.parent().children("ul:first").prepend(what)}if(!this.settings.data.async){this.open_branch($where)}break;default:break}if($parent.find("li").size()==0){var $li=$parent.parent();$li.removeClass("open").removeClass("closed").addClass("leaf").children("ul").remove();$li.parents("ul:eq(0)").children("li.last").removeClass("last").end().children("li:last").addClass("last");this.set_cookie("open")}else{$parent.children("li.last").removeClass("last");$parent.children("li:last").addClass("last")}if(is_new&&how!="inside"){where=this.get_node(where).parents("li:eq(0)")}if(is_copy){this.settings.callback.oncopy.call(null,this.get_node(what).get(0),this.get_node(where).get(0),how,this)}else{if(is_new){this.settings.callback.oncreate.call(null,this.get_node(what).get(0),this.get_node(where).get(0),this.settings.insertAt,this)}else{this.settings.callback.onmove.call(null,this.get_node(what).get(0),this.get_node(where).get(0),how,this)}}return what},error:function(code){this.settings.callback.error.call(null,code,this);return false},lock:function(state){this.locked=state;if(this.locked){this.container.addClass("locked")}else{this.container.removeClass("locked")}},cut:function(){if(this.locked){return this.error("LOCKED")}if(!this.selected){return this.error("CUT: NO NODE SELECTED")}this.copy_nodes=false;this.cut_nodes=this.container.find("a.clicked").filter(":first-child").parent()},copy:function(){if(this.locked){return this.error("LOCKED")}if(!this.selected){return this.error("COPY: NO NODE SELECTED")}this.copy_nodes=this.container.find("a.clicked").filter(":first-child").parent();this.cut_nodes=false},paste:function(){if(this.locked){return this.error("LOCKED")}if(!this.selected){return this.error("PASTE: NO NODE SELECTED")}if(!this.copy_nodes&&!this.cut_nodes){return this.error("PASTE: NOTHING TO DO")}if(this.copy_nodes&&this.copy_nodes.size()){if(!this.checkMove(this.copy_nodes,this.selected.children("a:eq(0)"),"inside")){return false}this.moved(this.copy_nodes,this.selected.children("a:eq(0)"),"inside",false,true);this.copy_nodes=false}if(this.cut_nodes&&this.cut_nodes.size()){if(!this.checkMove(this.cut_nodes,this.selected.children("a:eq(0)"),"inside")){return false}this.moved(this.cut_nodes,this.selected.children("a:eq(0)"),"inside");this.cut_nodes=false}}}};function changeSort(id,sort)
{if(id!='sortbyselect')return;window.location=sort;}
function changeCategory(id,category)
{if(id!='topHeadings')return;window.location="/"+URLEncode(category);}
function changeLocation(id,category,location)
{if(id!='location')return;window.location="/search/"+URLEncode(category)+"/"+URLEncode(location);}
function URLEncode(clearString)
{if(clearString==null||clearString=="")return"";var output='';var x=0;clearString=clearString.toString();var regex=/(^[a-zA-Z0-9_.]*)/;while(x<clearString.length){var match=regex.exec(clearString.substr(x));if(match!=null&&match.length>1&&match[1]!=''){output+=match[1];x+=match[1].length;}else{if(clearString[x]==' ')
output+='-';else{var charCode=clearString.charCodeAt(x);var hexVal=charCode.toString(16);output+='%'+(hexVal.length<2?'0':'')+hexVal.toUpperCase();}
x++;}}
return output;}
function divaffiche()
{document.getElementById("AlphaBar").style.display="block";document.getElementById("AlphaHide").style.display="block";document.getElementById("AlphaDisplay").style.display="none";}
function divcache()
{document.getElementById("AlphaBar").style.display="none";document.getElementById("AlphaHide").style.display="none";document.getElementById("AlphaDisplay").style.display="block";}
function ExtLargeMapControl(opts){this.sliderStep=9;this.imgSrc="http://maps.google.com/mapfiles/mapcontrols3d.png";this.imgSmallSrc="http://maps.google.com/mapfiles/szc3d.png";this.divTbl={};this.divTbl.container={"left":0,"top":0,"width":59};this.divTbl.topArrowBtn={"left":20,"top":0,"width":18,"height":18};this.divTbl.leftArrowBtn={"left":0,"top":20};this.divTbl.rightArrowBtn={"left":40,"top":20};this.divTbl.bottomArrowBtn={"left":20,"top":40};this.divTbl.centerBtn={"left":20,"top":20};this.divTbl.zoomSlideBarContainer={"left":19,"top":86,"width":22};this.divTbl.zoomSliderContainer={"left":0,"top":0,"width":22,"height":14};this.divTbl.zoomSliderContainerImg={"left":0,"top":-384,"width":22,"height":14};this.divTbl.zoomOutBtnContainer={"left":0,"top":0,"width":59,"height":23};this.divTbl.zoomOutBtnContainerImg={"left":0,"top":-360,"width":59,"height":23};opts=opts||{};this.zoomInBtnTitle=opts.zoomInBtnTitle||"zoom in";this.zoomOutBtnTitle=opts.zoomOutBtnTitle||"zoom out";this.moveNorthBtnTitle=opts.moveNorthBtnTitle||"north";this.moveSouthBtnTitle=opts.moveSouthBtnTitle||"south";this.moveEastBtnTitle=opts.moveEastBtnTitle||"east";this.moveWestBtnTitle=opts.moveWestBtnTitle||"west";this.homeBtnTitle=opts.homeBtnTitle||"home position";this.opts=opts;this.divSmallTbl={};this.divSmallTbl.container={"left":0,"top":0,"width":19,"height":42};this.divSmallTbl.zoomInBtn={"left":0,"top":0,"width":19,"height":21};this.divSmallTbl.zoomOutBtnImg={"left":0,"top":-21,"width":19,"height":21};this.divSmallTbl.zoomOutBtn={"left":0,"top":21,"width":19,"height":21};}
ExtLargeMapControl.prototype=new GControl();ExtLargeMapControl.prototype.initialize=function(map){this._map=map;GEvent.addListener(map,'maptypechanged',GEvent.callback(this,this._updateZoomSliderRange));var _handleList={};this._keyboardhandler=new GKeyboardHandler(map);var agt=navigator.userAgent.toLowerCase();this._is_ie=((agt.indexOf("msie")!==-1)&&(agt.indexOf("opera")===-1));this._is_gecko=(agt.indexOf('gecko')!==-1);this._is_opera=(agt.indexOf("opera")!==-1);var commonImg=new Image();commonImg.src=this.imgSrc;var container;var zoomOutBtn;var zoomInBtn;if(this.opts.type==="small"){container=document.createElement("div");container.style.left=this.divSmallTbl.container.left+"px";container.style.top=this.divSmallTbl.container.top+"px";container.style.width=this.divSmallTbl.container.width+"px";container.style.height=this.divSmallTbl.container.height+"px";container.style.position="absolute";container.style.overflow="hidden";this._container=container;zoomInBtn=this.makeImgDiv_(this.imgSmallSrc,this.divSmallTbl.zoomInBtn);zoomInBtn.style.cursor="pointer";zoomInBtn.title=this.zoomInBtnTitle;container.appendChild(zoomInBtn);zoomOutBtn=this.makeImgDiv_(this.imgSmallSrc,this.divSmallTbl.zoomOutBtnImg);zoomOutBtn.style.cursor="pointer";zoomOutBtn.style.overflow="hidden";zoomOutBtn.style.position="absolute";zoomOutBtn.style.left=this.divSmallTbl.zoomOutBtn.left+"px";zoomOutBtn.style.top=this.divSmallTbl.zoomOutBtn.top+"px";zoomOutBtn.style.width=this.divSmallTbl.zoomOutBtn.width+"px";zoomOutBtn.style.height=this.divSmallTbl.zoomOutBtn.height+"px";zoomOutBtn.title=this.zoomOutBtnTitle;container.appendChild(zoomOutBtn);GEvent.bindDom(zoomOutBtn,"click",this,this._eventZoomOut);GEvent.bindDom(zoomInBtn,"click",this,this._eventZoomIn);}else{var currentMapType=map.getCurrentMapType();var minZoom=parseInt(currentMapType.getMinimumResolution(),10);var maxZoom=parseInt(map.getCurrentMapType().getMaximumResolution(),10);this._maxZoom=maxZoom;this._step=this.sliderStep;var ctrlHeight=(86+5)+(maxZoom-minZoom+1)*this.sliderStep+5;container=this.makeImgDiv_(this.imgSrc,this.divTbl.container);container.style.height=(ctrlHeight+this.sliderStep+2)+"px";_handleList.container=container;this._container=container;var topBtn=this.makeImgDiv_(this.imgSrc,this.divTbl.topArrowBtn);topBtn.style.cursor="pointer";topBtn.style.left="20px";topBtn.style.top="0px";topBtn.title=this.moveNorthBtnTitle;container.appendChild(topBtn);var leftBtn=topBtn.cloneNode(true);leftBtn.style.left=this.divTbl.leftArrowBtn.left+"px";leftBtn.style.top=this.divTbl.leftArrowBtn.top+"px";leftBtn.title=this.moveWestBtnTitle;container.appendChild(leftBtn);var rightBtn=topBtn.cloneNode(true);rightBtn.style.left=this.divTbl.rightArrowBtn.left+"px";rightBtn.style.top=this.divTbl.rightArrowBtn.top+"px";rightBtn.title=this.moveEastBtnTitle;container.appendChild(rightBtn);var bottomBtn=topBtn.cloneNode(true);bottomBtn.style.left=this.divTbl.bottomArrowBtn.left+"px";bottomBtn.style.top=this.divTbl.bottomArrowBtn.top+"px";bottomBtn.title=this.moveSouthBtnTitle;container.appendChild(bottomBtn);var homeBtn=topBtn.cloneNode(true);homeBtn.style.left=this.divTbl.centerBtn.left+"px";homeBtn.style.top=this.divTbl.centerBtn.top+"px";homeBtn.title=this.homeBtnTitle;container.appendChild(homeBtn);_handleList.topBtn=topBtn;_handleList.leftBtn=leftBtn;_handleList.rightBtn=rightBtn;_handleList.bottomBtn=bottomBtn;_handleList.homeBtn=homeBtn;var zoomSlideBarContainer=document.createElement("div");zoomSlideBarContainer.style.position="absolute";zoomSlideBarContainer.style.left=this.divTbl.zoomSlideBarContainer.left+"px";zoomSlideBarContainer.style.top=this.divTbl.zoomSlideBarContainer.top+"px";zoomSlideBarContainer.style.width=this.divTbl.zoomSlideBarContainer.width+"px";zoomSlideBarContainer.style.height=((maxZoom-minZoom+1)*this.sliderStep)+"px";zoomSlideBarContainer.style.overflow="hidden";zoomSlideBarContainer.style.cursor="pointer";container.appendChild(zoomSlideBarContainer);_handleList.slideBar=zoomSlideBarContainer;var zoomLevel=map.getZoom();var zoomSliderContainer=this.makeImgDiv_(this.imgSrc,this.divTbl.zoomSliderContainerImg);zoomSliderContainer.style.top=((maxZoom-zoomLevel)*this.sliderStep+1)+"px";zoomSliderContainer.style.left=this.divTbl.zoomSliderContainer.left+"px";zoomSliderContainer.style.width=this.divTbl.zoomSliderContainer.width+"px";zoomSliderContainer.style.height=this.divTbl.zoomSliderContainer.height+"px";zoomSlideBarContainer.cursor="url(http://maps.google.com/mapfiles/openhand.cur), default";zoomSlideBarContainer.appendChild(zoomSliderContainer);_handleList.slideBarContainer=zoomSliderContainer;var zoomOutBtnContainer=this.makeImgDiv_(this.imgSrc,this.divTbl.zoomOutBtnContainerImg);zoomOutBtnContainer.style.top=(86+(maxZoom-minZoom+1)*this.sliderStep)+"px";zoomOutBtnContainer.style.left=this.divTbl.zoomOutBtnContainer.left+"px";zoomOutBtnContainer.style.width=this.divTbl.zoomOutBtnContainer.width+"px";zoomOutBtnContainer.style.height=this.divTbl.zoomOutBtnContainer.height+"px";zoomOutBtnContainer.cursor="url(http://maps.google.com/mapfiles/openhand.cur), default";container.appendChild(zoomOutBtnContainer);_handleList.zoomOutBtnContainer=zoomOutBtnContainer;zoomOutBtn=document.createElement("div");zoomOutBtn.style.position="absolute";zoomOutBtn.style.left="20px";zoomOutBtn.style.top=(91+(maxZoom-minZoom+1)*this.sliderStep)+"px";zoomOutBtn.style.width="18px";zoomOutBtn.style.height="23px";zoomOutBtn.style.cursor="pointer";zoomOutBtn.style.overflow="hidden";zoomOutBtn.title=this.zoomOutBtnTitle;container.appendChild(zoomOutBtn);_handleList.zoomOutBtn=zoomOutBtn;zoomInBtn=document.createElement("div");zoomInBtn.style.position="absolute";zoomInBtn.style.left="20px";zoomInBtn.style.top="65px";zoomInBtn.style.width="18px";zoomInBtn.style.height="23px";zoomInBtn.style.cursor="pointer";zoomInBtn.style.overflow="hidden";zoomInBtn.title=this.zoomInBtnTitle;container.appendChild(zoomInBtn);_handleList.zoomInBtn=zoomInBtn;GEvent.bindDom(_handleList.topBtn,"click",this,this._eventTop);GEvent.bindDom(_handleList.leftBtn,"click",this,this._eventLeft);GEvent.bindDom(_handleList.rightBtn,"click",this,this._eventRight);GEvent.bindDom(_handleList.bottomBtn,"click",this,this._eventBottom);GEvent.bindDom(_handleList.homeBtn,"click",this,this._eventHome);GEvent.bindDom(_handleList.zoomOutBtn,"click",this,this._eventZoomOut);GEvent.bindDom(_handleList.zoomInBtn,"click",this,this._eventZoomIn);GEvent.bindDom(_handleList.slideBar,"click",this,this._eventSlideBar);GEvent.bind(map,"zoomend",this,this._eventZoomEnd);var drgOpt={container:_handleList.slideBar};var drgCtrl=new GDraggableObject(_handleList.slideBarContainer,drgOpt);GEvent.bindDom(drgCtrl,"dragend",this,this._eventSlideDragEnd);this._slider=drgCtrl;this._eventZoomEnd(map.getZoom(),map.getZoom());}
this._handleList=_handleList;map.getContainer().appendChild(container);return container;};ExtLargeMapControl.prototype._updateZoomSliderRange=function(setMaxZoom){var minZoom=parseInt(this._map.getCurrentMapType().getMinimumResolution(),10);var maxZoom=parseInt(this._map.getCurrentMapType().getMaximumResolution(),10);if(this.isNull(setMaxZoom)===false){maxZoom=setMaxZoom;}else{this._maxZoom=maxZoom;}
var ctrlHeight=(86+5)+(maxZoom-minZoom+1)*this.sliderStep+5;if(this.isNull(this._handleList)===true){return;}
this._handleList.container.style.height=(ctrlHeight+this.sliderStep+2)+"px";this._handleList.slideBar.style.height=((maxZoom-minZoom+1)*this.sliderStep)+"px";this._handleList.zoomOutBtnContainer.style.top=(86+(maxZoom-minZoom+1)*this.sliderStep)+"px";this._handleList.zoomOutBtn.style.top=(91+(maxZoom-minZoom+1)*this.sliderStep)+"px";this._handleList.slideBarContainer.style.top=((maxZoom-this._map.getZoom())*this.sliderStep+1)+"px";};ExtLargeMapControl.prototype._eventTop=function(){this._map.panDirection(0,1);};ExtLargeMapControl.prototype._eventLeft=function(){this._map.panDirection(1,0);};ExtLargeMapControl.prototype._eventRight=function(){this._map.panDirection(-1,0);};ExtLargeMapControl.prototype._eventBottom=function(){this._map.panDirection(0,-1);};ExtLargeMapControl.prototype._eventZoomOut=function(){this._map.zoomOut();};ExtLargeMapControl.prototype._eventZoomIn=function(){this._map.zoomIn();};ExtLargeMapControl.prototype._eventSlideBar=function(e){var map=this._map;var mouseY=e.clientY;var slideStep=this._step;var maxZoom=this._maxZoom;var container=this._container;var ctrlPos=this._getDomPosition(container);mouseY-=(ctrlPos.y+91);var zoomLevel=Math.floor(maxZoom-(mouseY/slideStep));zoomLevel=zoomLevel<0?0:zoomLevel;map.setZoom(zoomLevel);};ExtLargeMapControl.prototype._getDomPosition=function(that){var targetEle=that;var pos={x:0,y:0};while(targetEle){pos.x+=targetEle.offsetLeft;pos.y+=targetEle.offsetTop;targetEle=targetEle.offsetParent;if(targetEle&&this._is_ie){pos.x+=(parseInt(ExtLargeMapControl.getElementStyle(targetEle,"borderLeftWidth","border-left-width"),10)||0);pos.y+=(parseInt(ExtLargeMapControl.getElementStyle(targetEle,"borderTopWidth","border-top-width"),10)||0);}}
if(this._is_gecko){var bd=document.getElementsByTagName("BODY")[0];pos.x+=2*(parseInt(ExtLargeMapControl.getElementStyle(bd,"borderLeftWidth","border-left-width"),10)||0);pos.y+=2*(parseInt(ExtLargeMapControl.getElementStyle(bd,"borderTopWidth","border-top-width"),10)||0);}
return pos;};ExtLargeMapControl.getElementStyle=function(targetElm,IEStyleProp,CSSStyleProp){var elem=targetElm;if(elem.currentStyle){return elem.currentStyle[IEStyleProp];}else if(window.getComputedStyle){var compStyle=window.getComputedStyle(elem,"");return compStyle.getPropertyValue(CSSStyleProp);}};ExtLargeMapControl.prototype._eventSlideDragEnd=function(e){var maxZoom=this._maxZoom;var mouseY=this._slider.top;var step=this._step;var zoomLevel=Math.floor(maxZoom-(mouseY/step));zoomLevel=zoomLevel<0?0:zoomLevel;this._map.setZoom(zoomLevel);};ExtLargeMapControl.prototype._eventHome=function(){this._map.returnToSavedPosition();};ExtLargeMapControl.prototype._eventZoomEnd=function(oldZoom,newZoom){var maxZoom=this._maxZoom;if(newZoom<maxZoom){this._updateZoomSliderRange();}else{this._updateZoomSliderRange(newZoom);maxZoom=newZoom;}
var step=this._step;this._slider.moveTo(new GPoint(0,(maxZoom-newZoom)*step));};ExtLargeMapControl.prototype.copy=function(){return new ExtLargeMapControl(this.latlng_,this.opts);};ExtLargeMapControl.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(10,10));};ExtLargeMapControl.prototype.selectable=function(){return false;};ExtLargeMapControl.prototype.printable=function(){return true;};ExtLargeMapControl.prototype.isNull=function(value){if(!value&&value!==0||value===undefined||value===""||value===null||typeof value==="undefined"){return true;}
return false;};ExtLargeMapControl.prototype.makeImgDiv_=function(imgSrc,params){var imgDiv=document.createElement("div");imgDiv.style.position="absolute";imgDiv.style.overflow="hidden";if(params.width){imgDiv.style.width=params.width+"px";}
if(params.height){imgDiv.style.height=params.height+"px";}
var img=null;if(!this._is_ie){img=new Image();img.src=imgSrc;}else{img=document.createElement("div");if(params.width){img.style.width=params.width+"px";}
if(params.height){img.style.height=params.height+"px";}}
img.style.position="relative";img.style.left=params.left+"px";img.style.top=params.top+"px";img.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+imgSrc+"')";imgDiv.appendChild(img);return imgDiv;};jQuery.fn.inc=function(url,transform,post){return this.each(function(){var t=$j(this);var transfer=function(txt){t.html($j.isFunction(transform)?transform(txt):txt);if(post){post();}};if($j.browser.msie){do{var f='inc'+(Math.round(Math.random()*999));}
while($j('#'+f).length);$j('<iframe><\/iframe>').hide().attr('id',f).bind('readystatechange',function(){if(this.readyState=='complete'){transfer(document.frames(f).document.body.innerHTML);}}).attr('src',url).appendTo(document.body);}
else{$j.ajax({url:url,complete:function(res,status){if(status=='success')transfer(res.responseText);}});}});};$j(function(){$j('[@class~=inc]').each(function(){$j(this).inc(unescape(this.className.replace(/.*inc:([^ ]+)( .*|$)/,'$1')));});});var zIndexBase=1;String.prototype.replaceAll=function(s1,s2){return this.replace(new RegExp(s1,"g"),s2);}
String.prototype.DecodeHtmlSpec=function(){var strtmp=this.replaceAll("&quot;",'"');strtmp=strtmp.replaceAll("&amp;","&");strtmp=strtmp.replaceAll("&lt;","<");strtmp=strtmp.replaceAll("&gt;",">");strtmp=strtmp.replaceAll("&nbsp;"," ");strtmp=strtmp.replaceAll("&#039;","'");return strtmp;}
function KMLObj(title,desc,op,fid){this.title=title;this.description=escape(desc);this.marks=[];this.folders=[];this.groundOverlays=[];this.open=op;this.folderid=fid}
function $(mid){return document.getElementById(mid)}
function GeoXml(myvar,map,url,xmldoc,opts){this.myvar=myvar;this.opts=opts||{};this.mb=new MessageBox(map,this,"mb",this.opts.messagebox);this.map=map;this.url=url;this.xmldoc=xmldoc;if(typeof url=="string"){this.urls=[url]}else{this.urls=url}
this.mb.style=this.opts.messagestyle||{backgroundColor:"silver"};this.alwayspop=this.opts.alwaysinfopop||false;this.titlestyle=this.opts.titlestyle||'style = "font-family: arial, sans-serif;font-size: medium;font-weight:bold;font-size: 100%;"';this.descstyle=this.opts.descstyle||'style = "font-family: arial, sans-serif;font-size: small;padding-bottom:.7em;"';this.directionstyle=this.opts.directionstyle||'style="font-family: arial, sans-serif;font-size: small;padding-left: 1px;padding-top: 1px;padding-right: 4px;"';this.sidebarfn=this.opts.sidebarfn||GeoXml.addSidebar;this.pointlabelopacity=this.opts.pointlabelopacity||100;this.polylabelopacity=this.opts.polylabelopacity||100;this.hilite=this.opts.hilite||{color:"#aaffff",opacity:0.3,textcolor:"#000000"};this.latestsidebar="";this.forcefoldersopen=false;if(typeof this.opts.allfoldersopen!="undefined"){this.forcefoldersopen=this.opts.allfoldersopen}
this.clickablepolys=true;this.clickablelines=true;this.clickablemarkers=true;if(typeof this.opts.clickablemarkers!="undefined"){this.clickablemarkers=this.opts.clickablemarkers}
if(typeof this.opts.clickablepolys!="undefined"){this.clickablepolys=this.opts.clickablepolys}
if(typeof this.opts.clickablelines!="undefined"){this.clickablelines=this.opts.clickablelines}
this.nolegend=false;if(typeof this.opts.nolegend!="undefined"){this.nolegend=true}
if(typeof this.opts.preloadHTML=="undefined"){this.opts.preloadHTML=true}
this.hideall=false;if(typeof proxy!="undefined"){this.proxy=proxy}
if(!this.proxy&&typeof getcapproxy!="undefined"){if(fixUrlEnd){getcapproxy=fixUrlEnd(getcapproxy)}}
if(this.opts.hideall){this.hideall=this.opts.hideall}
if(top.publishdirectory){this.publishdirectory=top.publishdirectory}else{this.publishdirectory="http://www.dyasdesigns.com/tntmap/"}
if(top.standalone){this.publishdirectory=""}
this.kmlicon=this.publishdirectory+"images/ge.png";this.docicon=this.publishdirectory+"images/ge.png";this.foldericon=this.publishdirectory+"images/folder.png";this.gmlicon=this.publishdirectory+"images/geo.gif";this.rssicon=this.publishdirectory+"images/rssb.png";this.globalicon=this.publishdirectory+"images/geo.gif";this.WMSICON='<img src="'+this.publishdirectory+'images/geo.gif" style="border:none" />';GeoXml.WMSICON=this.WMSICON;this.baseLayers=[];this.bounds=new GLatLngBounds();this.style={width:2,opacity:0.75,fillopacity:0.4};this.style.color=this.randomColor();this.style.fillcolor=this.randomColor();this.iwwidth=this.opts.iwwidth||400;this.lastmarker={};this.verySmall=1e-7;this.progress=0;this.ZoomFactor=2;this.NumLevels=18;this.maxtitlewidth=0;this.styles=[];this.jsdocs=[];this.jsonmarks=[];this.polyset=[];this.polygons=[];this.polylines=[];this.multibounds=[];this.overlayman=new Clusterer(map,this);this.overlayman.rowHeight=20;if(this.opts.sidebarid){this.basesidebar=this.opts.sidebarid}
this.kml=[new KMLObj("GeoXML","",true,0)];this.overlayman.folders.push([]);this.overlayman.subfolders.push([]);this.overlayman.folderhtml.push([]);this.overlayman.folderhtmlast.push(0);this.overlayman.folderBounds.push(new GLatLngBounds());this.wmscount=0;this.labels=new GTileLayerOverlay(G_HYBRID_MAP.getTileLayers()[1])}
GeoXml.prototype.showIt=function(str,h,w){var features="status=yes,resizable=yes,toolbar=0,height="+h+",width="+h+",scrollbars=yes";var myWin;if(top.widget){alert(str);this.mb.showMess(str)}else{myWin=window.open("","_blank",features);myWin.document.open("text/xml");myWin.document.write(str);myWin.document.close()}};GeoXml.prototype.clear=function(idx){for(var m=0;m<this.overlayman.markers.length;m++){this.overlayman.RemoveMarker(this.overlayman.markers[m])}
this.kml=[new KMLObj("GeoXML","",true,0)];this.maxtitlewidth=0;this.styles=[];this.jsdocs=[];this.jsonmarks=[];this.polyset=[];this.polylines=[];this.multibounds=[];this.bounds=new GLatLngBounds();this.overlayman=new Clusterer(this.map,this);this.overlayman.rowHeight=20;$(this.basesidebar).innerHTML="";this.overlayman.folders.push([]);this.overlayman.subfolders.push([]);this.overlayman.folderhtml.push([]);this.overlayman.folderhtmlast.push(0);this.overlayman.byname=[];this.overlayman.byid=[];this.overlayman.folderBounds.push(new GLatLngBounds());this.wmscount=0};GeoXml.prototype.createMarkerJSON=function(item,idx){var that=this;var style=that.makeIcon(style,item.href);var point=new GLatLng(item.y,item.x);that.overlayman.folderBounds[idx].extend(point);that.bounds.extend(point);if(item.shadow){style.shadow=item.shadow}else{style.shadow=null}
if(!!that.opts.createmarker){that.opts.createmarker(point,item.title,unescape(item.description),null,idx,style,item.visibility,item.id)}else{that.createMarker(point,item.title,unescape(item.description),null,idx,style,item.visibility,item.id)}};GeoXml.prototype.createMarker=function(point,name,desc,style,idx,instyle,visible,kml_id){var myvar=this.myvar;var icon;var bicon=new GIcon();name=name.DecodeHtmlSpec();if(this.opts.baseicon){bicon.iconSize=this.opts.baseicon.iconSize;bicon.iconAnchor=this.opts.baseicon.iconAnchor;bicon.shadowSize=this.opts.baseicon.shadowSize;bicon.infoWindowAnchor=this.opts.baseicon.infoWindowAnchor}else{bicon.infoWindowAnchor=new GPoint(16,0);bicon.iconSize=new GSize(38,34);bicon.shadowSize=new GSize(38,34);bicon.iconAnchor=new GPoint(16,32)}
var shadow;var href;if(this.opts.iconFromDescription){var text=desc;var pattern=new RegExp("<\\s*img","ig");var result;var pattern2=/src\s*=\s*[\'\"]/;var pattern3=/[\'\"]/;while((result=pattern.exec(text))!=null){var stuff=text.substr(result.index);var result2=pattern2.exec(stuff);if(result2!=null){stuff=stuff.substr(result2.index+result2[0].length);var result3=pattern3.exec(stuff);if(result3!=null){var imageUrl=stuff.substr(0,result3.index);href=imageUrl}}}
shadow=null;if(!href){href="http://maps.google.com/mapfiles/kml/pal3/icon40.png"}
icon=new GIcon(bicon,href,null,shadow)}else{href="http://maps.google.com/mapfiles/kml/pal3/icon40";if(instyle==null||typeof instyle=="undefined"){shadow=href+"s.png";href+=".png";if(this.opts.baseicon){href=this.opts.baseicon.image;shadow=this.opts.baseicon.shadow}}else{if(instyle.href){href=instyle.href}
if(instyle.shadow){shadow=instyle.shadow}}
icon=new GIcon(bicon,href,null,shadow)}
var iwoptions=this.opts.iwoptions||{};var markeroptions=this.opts.markeroptions||{};var icontype=this.opts.icontype||"style";if(icontype=="style"){if(!!this.styles[style]){icon=new GIcon(bicon,this.styles[style].href,null,this.styles[style].shadow);icon.src=this.styles[style].href;href=this.styles[style].href}}
if(!markeroptions.icon){markeroptions.icon=icon}
markeroptions.title="";var m=new GMarker(point,markeroptions);m.title=name;m.id=kml_id;var obj={type:"point",title:name,description:escape(desc),href:href,shadow:shadow,visibility:visible,x:point.x,y:point.y,id:m.id};this.kml[idx].marks.push(obj);if(this.opts.pointlabelclass){var l=new ELabel(point,name,this.opts.pointlabelclass,this.opts.pointlabeloffset,this.pointlabelopacity,true);m.label=l;this.map.addOverlay(l)}
var html,html1,html2,html3,html4;var awidth=this.iwwidth;if(desc.length*8<awidth){awidth=desc.length*8}
var overridename=(name.length-23)/4;if(awidth<overridename*10){awidth=overridename*10}
html="<div style = 'width:"+awidth+"px'><h1 "+this.titlestyle+">"+name+"</h1><div "+this.descstyle+">"+desc+"</div>";if(this.opts.directions){html1=html+"<div "+this.directionstyle+'>Get Directions: <a href="#" onclick="GEvent.trigger('+this.myvar+'.lastmarker,\'click2\');return false;">To Here</a> - <a href="#" onclick="GEvent.trigger('+this.myvar+'.lastmarker,\'click3\');return false;">From Here</a><br><a href="#" onclick="GEvent.trigger('+this.myvar+".lastmarker,'click4');return false;\">Search nearby</a></div>";html2=html+"<div "+this.directionstyle+'>Get Directions: To here - <a href="#" onclick="GEvent.trigger('+this.myvar+'.lastmarker,\'click3\');return false;">From Here</a><br>Start address:<form action="http://maps.google.com/maps" method="get" target="_blank"><input type="text" SIZE=35 MAXLENGTH=80 name="saddr" id="saddr" value="" /><INPUT value="Go" TYPE="SUBMIT"><input type="hidden" name="daddr" value="'+point.lat()+","+point.lng()+"("+name+')"/><br><a href="# onclick="GEvent.trigger('+this.myvar+".lastmarker,'click');return false;\">&#171; Back</a></div>";html3=html+"<div "+this.directionstyle+'>Get Directions: <a href="#" onclick="GEvent.trigger('+this.myvar+'.lastmarker,\'click2\');return false;">To Here</a> - From Here<br>End address:<form action="http://maps.google.com/maps" method="get"" target="_blank"><input type="text" SIZE=35 MAXLENGTH=80 name="daddr" id="daddr" value="" /><INPUT value="Go" TYPE="SUBMIT"><input type="hidden" name="saddr" value="'+point.lat()+","+point.lng()+"("+name+')"/><br><a href="#" onclick="GEvent.trigger('+this.myvar+".lastmarker,'click');return false;\">&#171; Back</a></div>";html4=html+"<div "+this.directionstyle+'>Search nearby: e.g. "pizza"<br><form action="http://maps.google.com/maps" method="get"" target="_blank"><input type="text" SIZE=35 MAXLENGTH=80 name="q" id="q" value="" /><INPUT value="Go" TYPE="SUBMIT"><input type="hidden" name="near" value="'+name+" @"+point.lat()+","+point.lng()+'"/><br><a href="# onclick="GEvent.trigger('+this.myvar+".lastmarker,'click');return false;\">&#171; Back</a></div>";GEvent.addListener(m,"click2",function(){m.openInfoWindowHtml(html2+"</div>",iwoptions)});GEvent.addListener(m,"click3",function(){m.openInfoWindowHtml(html3+"</div>",iwoptions)});GEvent.addListener(m,"click4",function(){m.openInfoWindowHtml(html4+"</div>",iwoptions)})}else{html1=html}
if(this.clickablemarkers){GEvent.addListener(m,"click",function(){eval(myvar+".lastmarker = m");var bar=document.getElementById('mtgt_'+kml_id);if(bar){bar.style.zIndex=zIndexBase++;}
m.openInfoWindowHtml(html1+"</div>",iwoptions)})}
if(this.opts.domouseover){m.mess=html1+"</div>";m.geoxml=this;GEvent.addListener(m,"mouseover",function(point){if(!point){point=m.getPoint()}
m.geoxml.mb.showMess(m.mess,5000)})}
var nhtml="";var parm;if(this.opts.sidebarid){var folderid=this.myvar+"_folder"+idx;var n=this.overlayman.markers.length;var blob='&nbsp;<img style="vertical-align:text-top;padding:0;margin:0" height="16" border="0" src="'+href+'">&nbsp;';parm=this.myvar+"$$$"+name+"$$$marker$$$"+n+"$$$"+blob+"$$$"+visible+"$$$null";m.sidebarid=this.myvar+"sb"+n;m.hilite=this.hilite;m.geoxml=this;GEvent.addListener(m,"mouseover",function(){var bar=$(this.sidebarid);if(bar){bar.style.backgroundColor=this.hilite.color;bar.style.color=this.hilite.textcolor}});GEvent.addListener(m,"mouseout",function(){var bar=$(this.sidebarid);if(bar){bar.style.background="none";bar.style.color=""}})}
if(this.opts.divhighlight){GEvent.addListener(m,"mouseover",function(){eval(myvar+".lastmarker = m");var bar=document.getElementById('mtgt_'+kml_id);if(bar){bar.style.zIndex=zIndexBase++;}
m.openInfoWindowHtml(html1+"</div>",iwoptions)
$j('#premiumads'+kml_id).addClass("highlightrow");});GEvent.addListener(m,"mouseout",function(){$j('#premiumads'+kml_id).removeClass("highlightrow");})}
if(!!this.opts.addmarker){this.opts.addmarker(m,name,idx,parm,visible)}else{this.overlayman.AddMarker(m,name,idx,parm,visible)}};GeoXml.getDescription=function(node){var sub="";var n=0;var cn;if(document.all){for(;n<node.childNodes.length;n++){cn=node.childNodes.item(n);sub+=cn.xml}}else{var serializer=new XMLSerializer();for(;n<node.childNodes.length;n++){cn=serializer.serializeToString(node.childNodes.item(n));sub+=cn}}
var s=sub.replace("<![CDATA[","");var u=s.replace("]]>","");u=u.replace(/\&amp;/g,"&");u=u.replace(/\&lt;/g,"<");u=u.replace(/\&quot;/g,'"');u=u.replace(/\&apos;/g,"'");u=u.replace(/\&gt;/g,">");return u};GeoXml.prototype.processLine=function(pnum,lnum,idx){var op=this.polylines[pnum];var line=op.lines[lnum];var obj;var p;if(!line){return}
var thismap=this.map;var iwoptions=this.opts.iwoptions||{};var polylineEncoder=new PolylineEncoder(this.NumLevels,this.ZoomFactor,this.verySmall,true);if(line.length>2){var result=polylineEncoder.dpEncode(line);obj={points:result.encodedPoints,levels:result.encodedLevels,color:op.color,weight:op.width,opacity:op.opacity,clickable:op.clickablepolys,zoomFactor:this.ZoomFactor,numLevels:this.NumLevels,type:"polyline"};p=new GPolyline.fromEncoded(obj)}else{obj={points:line,color:op.color,weight:op.width,opacity:op.opacity,type:"line",id:op.id};p=new GPolyline(line,op.color,op.width,op.opacity)}
p.bounds=op.pbounds;p.id=op.id;var nhtml="";var n=this.overlayman.markers.length;this.polylines[pnum].lineidx.push(n);var parm;var awidth=this.iwwidth;var desc=op.description;if(desc.length*8<awidth){awidth=desc.length*8}
if(awidth<op.name.length*12){awidth=op.name.length*12}
var html="<div style='font-weight: bold; font-size: medium; margin-bottom: 0em;'>"+op.name;html+="</div><div style='font-family: Arial, sans-serif;font-size: small;width:"+awidth+"px;'>"+desc+"</div>";if(lnum==0){if(this.opts.sidebarid){var blob='&nbsp;&nbsp;<span style=";border-left:'+op.width+"px solid "+op.color+';">&nbsp;</span> ';parm=this.myvar+"$$$"+op.name+"$$$polyline$$$"+n+"$$$"+blob+"$$$"+op.visible+"$$$"+pnum+"$$$";this.latestsidebar=this.myvar+"sb"+n}}
if(lnum<line.length){setTimeout(this.myvar+".processLine("+pnum+","+(lnum+1)+",'"+idx+"');",15);if(this.opts.sidebarid){p.sidebar=this.latestsidebar}}
if(this.opts.domouseover){p.mess=html}
p.title=op.name;p.geoxml=this;p.strokeColor=op.color;p.strokeWeight=op.width;p.strokeOpacity=op.opacity;p.hilite=this.hilite;p.mytitle=p.title;p.map=this.map;p.idx=pnum;p.onOver=function(){var pline=this.geoxml.polylines[this.idx];for(var l=0;l<pline.lineidx.length;l++){var mark=this.geoxml.overlayman.markers[pline.lineidx[l]];mark.realColor=mark.strokeColor;mark.setStrokeStyle({color:this.hilite.color});mark.redraw(true)}
if(this.sidebar){$(this.sidebar).style.backgroundColor=this.hilite.color;$(this.sidebar).style.color=this.hilite.textcolor}
if(this.mess){this.geoxml.mb.showMess(this.mess,5000)}else{this.title="Click for more information about "+this.mytitle}};p.onOut=function(){var pline=this.geoxml.polylines[this.idx];for(var l=0;l<pline.lineidx.length;l++){var mark=this.geoxml.overlayman.markers[pline.lineidx[l]];mark.setStrokeStyle({color:this.realColor});mark.redraw(true)}
this.geoxml.mb.hideMess();if(this.sidebar){$(this.sidebar).style.background="none";$(this.sidebar).style.color=""}};GEvent.addListener(p,"mouseout",p.onOut);GEvent.addListener(p,"mouseover",p.onOver);GEvent.addListener(p,"click",function(point){var doit=false;if(!point){point=this.getPoint();doit=true}
if(this.geoxml.clickablelines||doit){this.map.openInfoWindowHtml(point,html,iwoptions)}});obj.name=op.name;obj.description=escape(op.description);obj.visibility=op.visibility;this.kml[idx].marks.push(obj);this.overlayman.AddMarker(p,op.name,idx,parm,op.visibility)};GeoXml.prototype.createPolyline=function(lines,color,width,opacity,pbounds,name,desc,idx,visible,kml_id){var p={};if(!color){p.color=this.randomColor()}else{p.color=color}
if(!opacity){p.opacity=0.45}else{p.opacity=opacity}
if(!width){p.width=2}else{p.width=width}
p.idx=idx;p.visibility=visible;if(this.hideall){p.visibility=false}
p.name=name;p.description=desc;p.lines=lines;p.lineidx=[];p.id=kml_id;this.polylines.push(p);setTimeout(this.myvar+".processLine("+(this.polylines.length-1)+",0,'"+idx+"');",15)};GeoXml.prototype.processPLine=function(pnum,linenum,idx){var p=this.polyset[pnum];var line=p.lines[linenum];var obj={};if(line&&line.length){var polylineEncoder=new PolylineEncoder(18,2,0.00001,true);var result=polylineEncoder.dpEncode(line);obj={};obj.points=result.encodedPoints;obj.levels=result.encodedLevels;obj.color=p.color;obj.weight=p.weight;obj.numLevels=18;obj.zoomFactor=2;obj.opacity=p.opacity;p.obj.polylines.push(obj)}
if(linenum==p.lines.length-1){this.finishPolygon(p.obj,idx)}else{setTimeout(this.myvar+".processPLine("+pnum+","+(linenum+1)+",'"+idx+"');",5)}};GeoXml.prototype.finishPolygon=function(op,idx){op.type="polygon";this.finishPolygonJSON(op,idx,false)};GeoXml.prototype.finishPolygonJSON=function(op,idx,updatebound,lastpoly){var that=this;var iwoptions=that.opts.iwoptions||{};if(typeof op.visibility=="undefined"){op.visibility=true}
if(that.hideall){op.visibility=false}
var desc=unescape(op.description);op.opacity=op.fillOpacity;var p=new GPolygon.fromEncoded(op);var html="<div style='font-weight: bold; font-size: medium; margin-bottom: 0em;'>"+op.name+"</div><div style='font-family: Arial, sans-serif;font-size: small;width:"+this.iwwidth+"px'>"+desc+"</div>";var newgeom=(lastpoly!="p_"+op.name);if(newgeom){this.latestsidebar=that.myvar+"sb"+this.overlayman.markers.length}
if(that.opts.domouseover){p.mess=html}
p.strokeColor=op.polylines[0].color;p.mb=that.mb;p.hilite=that.hilite;p.strokeOpacity=op.polylines[0].opacity;p.fillOpacity=op.opacity;p.fillColor=op.color;if(!op.fill){p.fillOpacity=0}
if(that.domouseover){p.mess=html}
p.geoxml=that;p.title=op.name;p.id=op.id;var n=this.overlayman.markers.length;if(newgeom){that.multibounds.push(new GLatLngBounds());that.polygons.push([])}
var len=that.multibounds.length-1;that.multibounds[len].extend(p.getBounds().getSouthWest());that.multibounds[len].extend(p.getBounds().getNorthEast());that.polygons[that.polygons.length-1].push(n);p.polyindex=that.polygons.length-1;p.geomindex=len;if(this.opts.sidebarid){p.sidebarid=this.latestsidebar;p.onOver=function(){if(this.sidebarid){var bar=$(this.sidebarid);if(bar){bar.style.backgroundColor=this.hilite.color;bar.style.color=this.hilite.textcolor}}
if(this.geoxml.clickablepolys){var poly=this.geoxml.polygons[this.polyindex];if(poly){for(var pg=0;pg<poly.length;pg++){var mark=this.geoxml.overlayman.markers[poly[pg]];mark.realColor=mark.fillColor;mark.setFillStyle({color:this.hilite.color});mark.redraw(true)}}}
if(this.mess){p.geoxml.mb.showMess(this.mess,5000)}};p.onOut=function(){if(this.sidebarid){var bar=$(this.sidebarid);if(bar){bar.style.background="none";bar.style.color=""}}
var poly;if(this.geoxml.clickablepolys){poly=this.geoxml.polygons[this.polyindex]}
if(poly){for(var pg=0;pg<poly.length;pg++){var mark=this.geoxml.overlayman.markers[poly[pg]];mark.setFillStyle({color:mark.realColor});mark.redraw(true)}}}}
GEvent.addListener(p,"mouseout",p.onOut);GEvent.addListener(p,"mouseover",p.onOver);op.description=escape(desc);this.kml[idx].marks.push(op);p.map=this.map;var bounds;GEvent.addListener(p,"click",function(point,overlay){if(!point&&this.geoxml.alwayspop){bounds=this.geoxml.multibounds[this.geomindex];this.map.setCenter(bounds.getCenter(),this.map.getBoundsZoomLevel(bounds));point=bounds.getCenter()}
if(!point){this.geoxml.mb.showMess("Zooming to "+p.title,3000);bounds=this.geoxml.multibounds[this.geomindex];this.map.setZoom(this.map.getBoundsZoomLevel(bounds));this.map.panTo(bounds.getCenter())}else{if(this.geoxml.clickablepolys){this.map.openInfoWindowHtml(point,html,iwoptions)}}});if(this.opts.polylabelclass&&newgeom){var epoint=p.getBounds().getCenter();var off=this.opts.polylabeloffset;if(!off){off=new GSize(0,0)}
off.x=-(op.name.length*6);var l=new ELabel(epoint," "+op.name+" ",this.opts.polylabelclass,off,this.polylabelopacity,true);p.label=l;this.map.addOverlay(l)}
var nhtml="";var parm;if(this.basesidebar&&newgeom){var folderid=this.myvar+"_folder"+idx;var blob='<span style="background-color:'+op.color+";border:2px solid "+p.strokeColor+';">&nbsp;&nbsp;&nbsp;&nbsp;</span> ';parm=this.myvar+"$$$"+op.name+"$$$polygon$$$"+n+"$$$"+blob+"$$$"+op.visibility+"$$$null"}
if(updatebound){var ne=p.getBounds().getNorthEast();var sw=p.getBounds().getSouthWest();this.bounds.extend(ne);this.bounds.extend(sw);this.overlayman.folderBounds[idx].extend(sw);this.overlayman.folderBounds[idx].extend(ne)}
this.overlayman.AddMarker(p,op.name,idx,parm,op.visibility);return op.name};GeoXml.prototype.finishLineJSON=function(po,idx,lastlinename){var m;var that=this;var thismap=this.map;if(po.type=="line"){m=new GPolyline(po.points,po.color,po.weight,po.opacity)}else{m=new GPolyline.fromEncoded(po)}
m.mytitle=po.name;m.title=po.name;m.geoxml=this;m.strokeColor=po.color;m.strokeWeight=po.weight;m.strokeOpacity=po.opacity;m.hilite=this.hilite;var n=that.overlayman.markers.length;var lineisnew=false;var pnum;if(("l_"+po.name)!=lastlinename){lineisnew=true;that.polylines.push(po);pnum=that.polylines.length-1;that.polylines[pnum].lineidx=[];that.latestsidebar=that.myvar+"sb"+n}else{pnum=that.polylines.length-1;that.polylines[pnum].lineidx.push(n)}
if(this.opts.basesidebar){m.sidebarid=that.latestsidebar}
m.onOver=function(){if(!!this.sidebarid){if(bar){bar.style.backgroundColor=this.hilite.color}}
this.realColor=this.strokeColor;mark.setStrokeStyle({color:this.hilite.color});this.redraw(true);if(this.mess){this.geoxml.mb.showMess(this.mess,5000)}else{this.title="Click for more information about "+this.mytitle}};m.onOut=function(){if(!!this.sidebarid){var bar=$(this.sidebarid);if(bar){bar.style.background="none"}}
mark.setStrokeStyle({color:this.realColor});this.redraw(true);if(this.mess){this.geoxml.mb.hideMess()}};GEvent.addListener(m,"mouseover",m.onOver);GEvent.addListener(m,"mouseover",m.onOut);var parm="";that.kml[idx].marks.push(po);var desc=unescape(po.description);var awidth=this.iwwidth;if(desc.length*8<awidth){awidth=desc.length*8}
if(awidth<po.name.length*12){awidth=po.name.length*12}
var html="<div style='font-weight: bold; font-size: medium; margin-bottom: 0em;'>"+po.name;html+="</div><div style='font-family: Arial, sans-serif;font-size: small;width:"+awidth+"px'>"+desc+"</div>";m.map=this.map;if(this.clickablelines){GEvent.addListener(m,"click",function(point){if(!point){point=m.getPoint()}
this.map.openInfoWindowHtml(point,html,that.opts.iwoptions)})}
if(that.basesidebar&&lineisnew){var blob='&nbsp;&nbsp;<span style=";border-left:'+po.weight+"px solid "+po.color+';">&nbsp;</span> ';if(typeof po.visibility=="undefined"){po.visibility=true}
parm=that.myvar+"$$$"+po.name+"$$$polyline$$$"+n+"$$$"+blob+"$$$"+po.visibility+"$$$"+(that.polylines.length-1)+"$$$"}
var ne=m.getBounds().getNorthEast();var sw=m.getBounds().getSouthWest();that.bounds.extend(ne);that.bounds.extend(sw);that.overlayman.folderBounds[idx].extend(sw);that.overlayman.folderBounds[idx].extend(ne);that.overlayman.AddMarker(m,po.name,idx,parm,po.visibility);return(po.name)};GeoXml.prototype.handlePlaceObj=function(num,max,idx,lastlinename,depth){var that=this;var po=that.jsonmarks[num];var name=po.name;if(po.title){name=po.title}
if(name.length+depth>that.maxtitlewidth){that.maxtitlewidth=name.length+depth}
switch(po.type){case"polygon":lastlinename="p_"+that.finishPolygonJSON(po,idx,true,lastlinename);break;case"line":case"polyline":lastlinename="l_"+that.finishLineJSON(po,idx,lastlinename);break;case"point":that.createMarkerJSON(po,idx);lastlinename="";break}
if(num<max-1){var act=that.myvar+".handlePlaceObj("+(num+1)+","+max+","+idx+',"'+lastlinename+'",'+depth+");";document.status="processing "+name;setTimeout(act,1)}else{lastlinename="";if(num==that.jsonmarks.length-1){that.progress--;if(that.progress<=0){if(!that.opts.nozoom){that.map.setZoom(that.map.getBoundsZoomLevel(that.bounds));that.map.setCenter(that.bounds.getCenter())}
GEvent.trigger(that,"parsed");that.setFolders();if(!that.opts.sidebarid){that.mb.showMess("Finished Parsing",1000);that.ParseURL()}}}}};GeoXml.prototype.parseJSON=function(doc,title,latlon,desc,sbid){var that=this;that.overlayman.miStart=new Date();that.jsdocs=eval("("+doc+")");var bar=$(that.basesidebar);if(bar){bar.style.display=""}
that.recurseJSON(that.jsdocs[0],title,desc,that.basesidebar,0)};GeoXml.prototype.setFolders=function(){var that=this;var len=that.kml.length;for(var i=0;i<len;i++){var fid=that.kml[i].folderid;var fob=$(fid);if(fob!==null){if(!!that.kml[i].open){fob.style.display="block"}else{fob.style.display="none"}}}};GeoXml.prototype.recurseJSON=function(doc,title,desc,sbid,depth){var that=this;var polys=doc.marks;var name=doc.title;if(!sbid){sbid=0}
var description=unescape(doc.description);if(!description&&desc){description=desc}
var keepopen=that.forcefoldersopen;if(doc.open){keepopen=true}
var visible=false;if(typeof doc.visibility!="undefined"&&doc.visibility){visible=true}
var snippet=doc.snippet;var idx=that.overlayman.folders.length;if(!description){description=name}
var folderid;var icon;that.overlayman.folders.push([]);that.overlayman.subfolders.push([]);that.overlayman.folderhtml.push([]);that.overlayman.folderhtmlast.push(0);that.overlayman.folderBounds.push(new GLatLngBounds());that.kml.push(new KMLObj(title,description,keepopen));if((!depth&&(doc.folders&&doc.folders.length>1))||doc.marks.length){if(depth<2||doc.marks.length<1){icon=that.globalicon}else{icon=that.foldericon}
folderid=that.createFolder(idx,name,sbid,icon,description,snippet,keepopen,visible)}else{folderid=sbid}
var parm,blob;var nhtml="";var html;var m;var num=that.jsonmarks.length;var max=num+polys.length;for(var p=0;p<polys.length;p++){var po=polys[p];that.jsonmarks.push(po);desc=unescape(po.description);m=null;if(that.opts.preloadHTML&&desc&&desc.match(/<(\s)*img/i)){var preload=document.createElement("span");preload.style.visibility="visible";preload.style.position="absolute";preload.style.left="-1200px";preload.style.top="-1200px";preload.style.zIndex=this.overlayman.markers.length;document.body.appendChild(preload);preload.innerHTML=desc}}
if(that.groundOverlays){}
if(polys.length){that.handlePlaceObj(num,max,idx,null,depth)}
var fc=0;var fid=0;if(typeof doc.folders!="undefined"){fc=doc.folders.lenth;for(var f=0;f<doc.folders.length;++f){var nextdoc=that.jsdocs[doc.folders[f]];fid=that.recurseJSON(nextdoc,nextdoc.title,nextdoc.description,folderid,(depth+1));that.overlayman.subfolders[idx].push(fid);that.overlayman.folderBounds[idx].extend(that.overlayman.folderBounds[fid].getSouthWest());that.overlayman.folderBounds[idx].extend(that.overlayman.folderBounds[fid].getNorthEast());if(fid!=idx){that.kml[idx].folders.push(fid)}}}
if(fc||polys.length){that.bounds.extend(that.overlayman.folderBounds[idx].getSouthWest());that.bounds.extend(that.overlayman.folderBounds[idx].getNorthEast())}
return idx};GeoXml.prototype.createPolygon=function(lines,color,width,opacity,fillcolor,fillOpacity,pbounds,name,desc,folderid,visible,fill,outline,kml_id){var thismap=this.map;var p={};p.obj={description:desc,name:name};p.obj.polylines=[];p.obj.id=kml_id;p.obj.visibility=visible;p.obj.fill=fill;p.obj.outline=outline;p.fillcolor=fillcolor;p.obj.strokecolor=color;if(!color){p.color=this.style.color}else{p.color=color}
if(!fillcolor){p.obj.color=this.randomColor()}else{p.obj.color=fillcolor}
if(!opacity){p.obj.opacity=this.style.opacity}else{p.obj.opacity=opacity}
if(typeof fillOpacity=="undefined"){p.obj.fillOpacity=this.style.fillOpacity}else{p.obj.fillOpacity=fillOpacity}
if(!width){p.weight=this.style.width}else{p.weight=width}
p.bounds=pbounds;p.lines=lines;p.sidebarid=this.opts.sidebarid;this.polyset.push(p);document.status="processing poly "+name;setTimeout(this.myvar+".processPLine("+(this.polyset.length-1)+",0,'"+folderid+"')",5)};GeoXml.prototype.toggleFolder=function(i){var f=$(this.myvar+"_folder"+i);var tb=$(this.myvar+"TB"+i);if(f.style.display=="none"){f.style.display="";if(tb){tb.style.fontWeight="normal"}}else{f.style.display="none";if(tb){tb.style.fontWeight="bold"}}};GeoXml.prototype.saveJSON=function(){if(top.standalone){var fpath=browseForSave("Select a directory to place your json file","JSON Data Files (*.js)|*.js|All Files (*.*)|*.*","JSON-DATA");if(typeof fpath!="undefined"){saveLocalFile(fpath+".js",this.kml.toJSONString())}
return}
if(this.kml.toJSONString){if(typeof serverBlessJSON!="undefined"){serverBlessJSON(escape(this.kml.toJSONString()),"MyKJSON")}else{this.showIt(this.kml.toJSONString())}}else{alert("No JSON methods currently available")}};GeoXml.prototype.toggleContents=function(i,show){var f=this.overlayman.folders[i];var cb;var j;var m;if(show){for(j=0;j<f.length;j++){m=this.overlayman.markers[f[j]];m.hidden=false;cb=$(this.myvar+""+f[j]+"CB");if(cb){cb.checked=true}
if(m.hide){m.show()}else{this.map.addOverlay(m)}
if(!!m.label){m.label.show()}}}else{for(j=0;j<f.length;j++){m=this.overlayman.markers[f[j]];m.hidden=true;cb=$(this.myvar+""+f[j]+"CB");if(cb){cb.checked=false}
if(m.hide){m.hide()}else{this.map.removeOverlay(m)}
if(!!m.label){m.label.hide()}}}
var sf=this.overlayman.subfolders[i];if(typeof sf!="undefined"){for(j=0;j<sf.length;j++){if(sf[j]!=i){cb=$(this.myvar+""+sf[j]+"FCB");if(cb){cb.checked=(!!show)}
this.toggleContents(sf[j],show)}}}};GeoXml.prototype.showHide=function(a,show,p){var m,i;if(a!=null){if(show){this.overlayman.markers[a].show();this.overlayman.markers[a].hidden=false;if(!!this.overlayman.markers[a].label){this.overlayman.markers[a].label.show()}}else{this.overlayman.markers[a].hide();this.overlayman.markers[a].hidden=true;if(!!this.overlayman.markers[a].label){this.overlayman.markers[a].label.hide()}}}else{var ms=this.polylines[p];if(show){for(i=0;i<ms.lineidx.length;i++){m=this.overlayman.markers[ms.lineidx[i]];m.hidden=false;if(m.hide){m.show()}else{this.map.addOverlay(m)}
if(!!m.label){m.show()}}}else{for(i=0;i<ms.lineidx.length;i++){m=this.overlayman.markers[ms.lineidx[i]];m.hidden=true;if(m.hide){m.hide()}else{this.map.removeOverlay(m)}
if(!!m.label){m.hide()}}}}};GeoXml.prototype.toggleOff=function(a,show){if(show){this.map.addOverlay(this.overlayman.markers[a]);this.overlayman.markers[a].hidden=false}else{this.map.removeOverlay(this.overlayman.markers[a]);this.overlayman.markers[a].hidden=true}
if(this.labels.onMap){this.map.removeOverlay(this.labels);this.map.addOverlay(this.labels)}};GeoXml.addSidebar=function(myvar,name,type,e,graphic,ckd,i){var check="checked";if(ckd=="false"){check=""}
var h="";var mid=myvar+"sb"+e;switch(type){case"marker":h='<li id="'+mid+'" onmouseout="GEvent.trigger('+myvar+".overlayman.markers["+e+"],'mouseout');\" onmouseover=\"GEvent.trigger("+myvar+".overlayman.markers["+e+"],'mouseover');\" ><input id=\""+myvar+""+e+'CB" type="checkbox" style="vertical-align:middle" '+check+' onclick="'+myvar+".showHide("+e+',this.checked)"><a href="#" onclick="GEvent.trigger('+myvar+".overlayman.markers["+e+"],'click');return false;\">"+graphic+name+"</a></li>";break;case"polyline":h='<li id="'+mid+'"  onmouseout="'+myvar+".overlayman.markers["+e+'].onOut();" onmouseover="'+myvar+".overlayman.markers["+e+'].onOver();" ><input id="'+myvar+""+e+'CB" type="checkbox" '+check+' onclick="'+myvar+".showHide(null,this.checked,"+i+')"><span style="margin-top:6px;"><a href="#" onclick="GEvent.trigger('+myvar+".overlayman.markers["+e+"],'click');return false;\">&nbsp;"+graphic+name+"</a></span></li>";break;case"polygon":h='<li id="'+mid+'"  onmouseout="'+myvar+".overlayman.markers["+e+'].onOut();" onmouseover="'+myvar+".overlayman.markers["+e+'].onOver();" ><input id="'+myvar+""+e+'CB" type="checkbox" '+check+' onclick="'+myvar+".showHide("+e+',this.checked)"><span style="margin-top:6px;"><a href="#" onclick="GEvent.trigger('+myvar+".overlayman.markers["+e+"],'click');return false;\">&nbsp;"+graphic+name+"</a></span></nobr></li>";break;case"groundoverlay":h='<li id="'+mid+'"><input id="'+myvar+""+e+'CB" type="checkbox" '+check+' onclick="'+myvar+".showHide("+e+',this.checked)"><span style="margin-top:6px;"><a href="#" onclick="GEvent.trigger('+myvar+".overlayman.markers["+e+"],'zoomto');return false;\">&nbsp;"+graphic+name+"</a></span></li>";break;case"tiledoverlay":h='<li id="'+mid+'"><nobr><input id="'+myvar+""+e+'CB" type="checkbox" '+check+' onclick="'+myvar+".toggleOff("+e+',this.checked)"><span style="margin-top:6px;"><a href="#" oncontextMenu="'+myvar+".upgradeLayer("+i+');return false;" onclick="GEvent.trigger('+myvar+".overlayman.markers["+e+"],'zoomto');return false;\">"+GeoXml.WMSICON+"&nbsp;"+name+"</a><br />"+graphic+"</span></li>";break}
return h};GeoXml.addDropdown=function(myvar,name,type,i,graphic){return'<option value="'+i+'">'+name+"</option>"};GeoXml.prototype.parse=function(titles){var that=this;var names=[];if(typeof titles!="undefined"){if(typeof titles!="string"){names=titles}else{names=titles.split(",")}}
that.progress+=that.urls.length;for(var u=0;u<that.urls.length;u++){var title=names[u];if(typeof title=="undefined"||!title||title=="null"){var segs=that.urls[u].split("/");title=segs[segs.length-1]}
that.mb.showMess("Loading "+title);var re=/\.js$/i;if(that.urls[u].search(re)!=-1){that.loadJSONUrl(this.urls[u],title)}else{that.loadXMLUrl(this.urls[u],title)}}};GeoXml.prototype.parseString=function(doc,titles,latlon){var names=[];if(titles){names=titles.split(",")}
if(typeof doc=="string"){this.docs=[doc]}else{this.docs=doc}
this.progress+=this.docs.length;for(var u=0;u<this.docs.length;u++){this.mb.showMess("Processing "+names[u]);this.processing(GXml.parse(this.docs[u]),names[u],latlon)}};GeoXml.prototype.parseXML=function(doc,titles,latlon){var names=[];if(typeof titles!="undefined"){if(typeof titles=="string"){names=titles.split(",")}else{names=titles}}
if(typeof doc=="array"){this.docs=doc}else{this.docs=[doc]}
this.progress+=this.docs.length;for(var u=0;u<this.docs.length;u++){this.mb.showMess("Processing "+names[u]);this.processing(this.docs[u],names[u],latlon)}};var currdeschead="";GeoXml.prototype.makeDescription=function(elem,title,depth){var d="";var len=elem.childNodes.length;var ln=0;var val;while(len--){var subelem=elem.childNodes.item(ln);var nn=subelem.nodeName;var sec=nn.split(":");var base="";if(sec.length>1){base=sec[1]}else{base=nn}
if(base.match(/^(visible|visibility|boundedBy|StyleMap|styleUrl|posList|coordinates|Style|Polygon|LineString|Point|LookAt|Envelope|Box|MultiPolygon)/)){currdeschead=""}else{if(base.match(/#text|the_geom|SchemaData|ExtendedData|#cdata-section/)){}else{if(base.match(/Snippet/i)){}else{if(base.match(/SimpleData/)){base=subelem.getAttribute("name")}
currdeschead="<b>&nbsp;"+base+"&nbsp;</b> :"}}
val=subelem.nodeValue;if(base.match(/(\S)*(name|title)(\S)*/i)){if(!val){val=GXml.value(subelem)}
title=val;if(val&&typeof title!="undefined"&&title.length>this.maxtitlewidth){this.maxtitlewidth=title.length}
currdeschead=""}else{if(val&&val.match(/(\S)+/)){if(val.match(/^http:\/\/|^https:\/\//i)){val='<a href="'+val+'">'+val+"</a>"}else{if(!title||title==""){title=val;if(val&&typeof title!="undefined"&&title.length>this.maxtitlewidth){this.maxtitlewidth=title.length}}}}
if(val&&(val.match(/(\s)*/)!=true)){d+=currdeschead+"<span>"+val+"</span><br />";currdeschead=""}
if(subelem.childNodes.length){var con=this.makeDescription(subelem,title,depth+1);if(con){d+=con.desc;if(typeof con.title!="undefined"&&con.title){title=con.title;if(title.length>this.maxtitlewidth){this.maxtitlewidth=title.length+depth}}}}}}
ln++}
var dc={};dc.desc=d;dc.title=title;return dc};GeoXml.prototype.randomColor=function(){var hex="0123456789abcdef";var color="#";for(var i=0;i<6;i++){var idx=parseInt(Math.random()*16,10);color+=hex.substring(idx,idx+1)}
return color};GeoXml.prototype.handleGeomark=function(mark,idx,trans){var that=this;var desc,title,name,style;title="";desc="";var styleid=0;var lat,lon;var visible=true;var fill=true;var outline=true;var width,color,opacity,fillOpacity,fillColor;var cor=[];var node,nv,cm;var coords="";var poslist=[];var point_count=0;var box_count=0;var line_count=0;var poly_count=0;var p;var points=[];var cc,l;var pbounds=new GLatLngBounds();var coordset=mark.getElementsByTagName("coordinates");if(coordset.length<1){coordset=mark.getElementsByTagName("gml:coordinates")}
if(coordset.length<1){coordset=[];poslist=mark.getElementsByTagName("gml:posList");if(poslist.length<1){poslist=mark.getElementsByTagName("posList")}
for(l=0;l<poslist.length;l++){coords=" ";cor=GXml.value(poslist.item(l)).split(" ");for(cc=0;cc<(cor.length-1);cc++){if(cor[cc]&&cor[cc]!=" "&&!isNaN(parseFloat(cor[cc]))){coords+=""+parseFloat(cor[cc])+","+parseFloat(cor[cc+1]);coords+=" "}
cc++}
if(coords){if(poslist.item(l).parentNode&&(poslist.item(l).parentNode.nodeName=="gml:LineString")){line_count++}else{poly_count++}
cm="<coordinates>"+coords+"</coordinates>";node=GXml.parse(cm);if(coordset.push){coordset.push(node)}}}
var pos=mark.getElementsByTagName("gml:pos");if(pos.length<1){pos=mark.getElementsByTagName("gml:pos")}
if(pos.length){for(p=0;p<pos.length;p++){nv=GXml.value(pos.item(p));cor=nv.split(" ");node=GXml.parse("<coordinates>"+cor[0]+","+cor[1]+"</coordinates>");if(coordset.push){coordset.push(node)}}}}
var newcoords=false;point_count=0;box_count=0;line_count=0;poly_count=0;var dc=that.makeDescription(mark,"");desc="<ul>"+dc.desc+"</ul>";if(!name&&dc.title){name=dc.title;if(name.length>this.maxtitlewidth){this.maxtitlewidth=name.length}}
if(newcoords&&typeof lat!="undefined"){coordset.push(""+lon+","+lat)}
var lines=[];var point;var skiprender;var bits;for(var c=0;c<coordset.length;c++){skiprender=false;if(coordset[c].parentNode&&(coordset[c].parentNode.nodeName=="gml:Box"||coordset[c].parentNode.nodeName=="gml:Envelope")){skiprender=true}
coords=GXml.value(coordset[c]);coords+=" ";coords=coords.replace(/\s+/g," ");coords=coords.replace(/^ /,"");coords=coords.replace(/, /,",");var path=coords.split(" ");if(path.length==1||path[1]==""){bits=path[0].split(",");point=new GLatLng(parseFloat(bits[1])/trans.ys-trans.y,parseFloat(bits[0])/trans.xs-trans.x);that.bounds.extend(point);if(!skiprender){if(!name){name="un-named place"}
if(!!that.opts.createmarker){that.opts.createmarker(point,name,desc,styleid,idx,null,visible)}else{that.createMarker(point,name,desc,styleid,idx,null,visible)}}}else{for(p=0;p<path.length-1;p++){bits=path[p].split(",");point=new GLatLng(parseFloat(bits[1])/trans.ys-trans.y,parseFloat(bits[0])/trans.xs-trans.x);points.push(point);pbounds.extend(point)}
that.bounds.extend(pbounds.getNorthEast());that.bounds.extend(pbounds.getSouthWest());if(!skiprender){lines.push(points)}}}
if(!lines||lines.length<1){return}
var linestring=mark.getElementsByTagName("LineString");if(linestring.length<1){linestring=mark.getElementsByTagName("gml:LineString")}
if(linestring.length||line_count>0){if(!!style){width=style.width;color=style.color;opacity=style.opacity}else{width=this.style.width;color=this.style.color;opacity=this.style.opacity}
if(!name){name="un-named path"}
if(!!that.opts.createpolyline){that.opts.createpolyline(lines,color,width,opacity,pbounds,name,desc,idx,visible)}else{that.createPolyline(lines,color,width,opacity,pbounds,name,desc,idx,visible)}}
var polygons=mark.getElementsByTagName("Polygon");if(polygons.length<1){polygons=mark.getElementsByTagName("gml:Polygon")}
if(polygons.length||poly_count>0){if(!!style){width=style.width;color=style.color;opacity=style.opacity;fillOpacity=style.fillOpacity;fillColor=style.fillColor;fill=style.file;outline=style.outline}
fillColor=this.randomColor();color=this.randomColor();fill=1;outline=1;if(!name){name="un-named area"}
if(!!that.opts.createpolygon){that.opts.createpolygon(lines,color,width,opacity,fillColor,fillOpacity,pbounds,name,desc,idx,visible,fill,outline)}else{that.createPolygon(lines,color,width,opacity,fillColor,fillOpacity,pbounds,name,desc,idx,visible,fill,outline)}}};GeoXml.prototype.handlePlacemark=function(mark,idx,depth,fullstyle){var that=this;var desc,title,name,style;title="";desc="";var styleid=0;var lat,lon;var visible=true;var newcoords=false;var outline;var opacity;var fillcolor;var fillOpacity;var color;var width;var pbounds;var fill;var points=[];var lines=[];var bits=[];var point;var cor,node,cm,nv;var l,pos,p,j,k,cc;var kml_id=mark.getAttribute("id");var point_count=0;var box_count=0;var line_count=0;var poly_count=0;var coords="";l=mark.getAttribute("lat");if(typeof l!="undefined"){lat=l}
l=mark.getAttribute("lon");if(typeof l!="undefined"){newcoords=true;lon=l}
l=0;var coordset=mark.getElementsByTagName("coordinates");if(coordset.length<1){coordset=mark.getElementsByTagName("gml:coordinates")}
if(coordset.length<1){coordset=[];var poslist=mark.getElementsByTagName("gml:posList");for(l=0;l<poslist.length;l++){coords=" ";var plitem=GXml.value(poslist.item(l))+" ";cor=plitem.split(" ");for(cc=0;cc<(cor.length-1);cc++){if(cor[cc]&&cor[cc]!=" "&&!isNaN(parseFloat(cor[cc]))){coords+=""+parseFloat(cor[cc])+","+parseFloat(cor[cc+1]);coords+=" "}
cc++}
if(coords){if(poslist.item(l).parentNode&&(poslist.item(l).parentNode.nodeName=="gml:LineString")){line_count++}else{poly_count++}
cm="<coordinates>"+coords+"</coordinates>";node=GXml.parse(cm);if(coordset.push){coordset.push(node)}}}
pos=mark.getElementsByTagName("gml:pos");if(pos.length<1){pos=mark.getElementsByTagName("gml:pos")}
if(pos.length){for(p=0;p<pos.length;p++){nv=GXml.value(pos.item(p))+" ";cor=nv.split(" ");node=GXml.parse("<coordinates>"+cor[0]+","+cor[1]+"</coordinates>");if(coordset.push){coordset.push(node)}}}}
for(var ln=0;ln<mark.childNodes.length;ln++){var nn=mark.childNodes.item(ln).nodeName;nv=GXml.value(mark.childNodes.item(ln));var ns=nn.split(":");var base;if(ns.length>1){base=ns[1].toLowerCase()}else{base=ns[0].toLowerCase()}
var processme=false;switch(base){case"name":name=nv;if(name.length+depth>this.maxtitlewidth){this.maxtitlewidth=name.length+depth}
break;case"title":title=nv;if(title.length+depth>this.maxtitlewidth){this.maxtitlewidth=title.length+depth}
break;case"desc":case"description":desc=GeoXml.getDescription(mark.childNodes.item(ln));if(!desc){desc=nv}
if(that.opts.preloadHTML&&desc&&desc.match(/<(\s)*img/i)){var preload=document.createElement("span");preload.style.visibility="visible";preload.style.position="absolute";preload.style.left="-1200px";preload.style.top="-1200px";preload.style.zIndex=this.overlayman.markers.length;document.body.appendChild(preload);preload.innerHTML=desc}
break;case"visibility":if(nv=="0"){visible=false}
break;case"href":case"link":if(nv){if(name){name="<a class='gmnoprint' target='_self' href='"+nv+"'>"+name+"</a>"}
else{desc+="<p><a target='_blank' href='"+nv+"'>link</a></p>"}}else{var href=mark.childNodes.item(ln).getAttribute("href");if(href){var imtype=mark.childNodes.item(ln).getAttribute("type");if(imtype.match(/image/)){desc+='<img style="width:256px" src=\''+href+"' />"}}}
break;case"author":desc+="<p><b>author:</b>"+nv+"</p>";break;case"time":desc+="<p><b>time:</b>"+nv+"</p>";break;case"lat":lat=nv;break;case"long":lon=nv;newcoords=true;break;case"point":point_count++;processme=true;break;case"line":line_count++;processme=true;break;case"box":box_count++;processme=true;break;case"polygon":poly_count++;processme=true;break;case"did":kml_id=nv;break;case"styleurl":styleid=nv;break;case"stylemap":var found=false;node=mark.childNodes.item(ln);for(j=0;(j<node.childNodes.length&&!found);j++){var pair=node.childNodes[j];for(k=0;(k<pair.childNodes.length&&!found);k++){var pn=pair.childNodes[k].nodeName;if(pn=="Style"){style=this.handleStyle(pair.childNodes[k]);found=true}}}
break;case"style":style=this.handleStyle(mark.childNodes.item(ln));break}
if(processme){cor=nv.split(" ");coords="";for(cc=0;cc<(cor.length-1);cc++){if(cor[cc]&&cor[cc]!=" "&&!isNaN(parseFloat(cor[cc]))){coords+=""+parseFloat(cor[cc+1])+","+parseFloat(cor[cc]);if(cc>1&&cc<(cor.length-2)){coords+=" "}}
cc++}
if(coords!=""){node=GXml.parse("<coordinates>"+coords+"</coordinates>");if(coordset.push){coordset.push(node)}}}}
if(!name&&title){name=title}
if(fullstyle){style=fullstyle}
if(styleid){style=this.styles[styleid]}
if(typeof desc=="undefined"||!desc){var dc=that.makeDescription(mark,"");desc="<ul>"+dc.desc+"</ul>";if(!name&&dc.title){name=dc.title;if((name.length+depth)>this.maxtitlewidth){this.maxtitlewidth=name.length+depth}}}
if(newcoords&&typeof lat!="undefined"){if(lat){var cs=""+lon+","+lat+" ";node=GXml.parse("<coordinates>"+cs+"</coordinates>");coordset.push(node)}}
for(var c=0;c<coordset.length;c++){var skiprender=false;if(coordset[c].parentNode&&(coordset[c].parentNode.nodeName.match(/^(gml:Box|gml:Envelope)/i))){skiprender=true}
coords=GXml.value(coordset[c]);coords+=" ";coords=coords.replace(/\s+/g," ");coords=coords.replace(/^ /,"");coords=coords.replace(/, /,",");var path=coords.split(" ");if(path.length==1||path[1]==""){bits=path[0].split(",");point=new GLatLng(parseFloat(bits[1]),parseFloat(bits[0]));this.overlayman.folderBounds[idx].extend(point);if(!skiprender){if(!name){name="un-named place"}
if(!!that.opts.createmarker){that.opts.createmarker(point,name,desc,styleid,idx,style,visible,kml_id)}else{that.createMarker(point,name,desc,styleid,idx,style,visible,kml_id)}}}else{points=[];pbounds=new GLatLngBounds();for(p=0;p<path.length-1;p++){bits=path[p].split(",");point=new GLatLng(parseFloat(bits[1]),parseFloat(bits[0]));points.push(point);pbounds.extend(point)}
this.overlayman.folderBounds[idx].extend(pbounds.getSouthWest());this.overlayman.folderBounds[idx].extend(pbounds.getNorthEast());if(!skiprender){lines.push(points)}}}
if(!lines||lines.length<1){return}
var linestring=mark.getElementsByTagName("LineString");if(linestring.length<1){linestring=mark.getElementsByTagName("gml:LineString")}
if(linestring.length||line_count>0){if(!!style){width=style.width;color=style.color;opacity=style.opacity}else{width=this.style.width;color=this.style.color;opacity=this.style.opacity}
if(!name){name="un-named path"}
if(!!that.opts.createpolyline){that.opts.createpolyline(lines,color,width,opacity,pbounds,name,desc,idx,visible,kml_id)}else{that.createPolyline(lines,color,width,opacity,pbounds,name,desc,idx,visible,kml_id)}}
var polygons=mark.getElementsByTagName("Polygon");if(polygons.length<1){polygons=mark.getElementsByTagName("gml:Polygon")}
if(polygons.length||poly_count>0){if(!!style){width=style.width;color=style.color;opacity=style.opacity;fillOpacity=style.fillOpacity;fillcolor=style.fillcolor;fill=style.fill;outline=style.outline}
if(typeof fill=="undefined"){fill=1}
if(typeof color=="undefined"){color=this.style.color}
if(typeof fillcolor=="undefined"){fillcolor=this.randomColor()}
if(!name){name="un-named area"}
if(!!that.opts.createpolygon){that.opts.createpolygon(lines,color,width,opacity,fillcolor,fillOpacity,pbounds,name,desc,idx,visible,fill,outline,kml_id)}else{that.createPolygon(lines,color,width,opacity,fillcolor,fillOpacity,pbounds,name,desc,idx,visible,fill,outline,kml_id)}}};GeoXml.prototype.makeIcon=function(tempstyle,href){if(!!href){if(!!this.opts.baseicon){tempstyle=new GIcon(this.opts.baseicon,href);tempstyle.href=href}else{tempstyle=new GIcon(G_DEFAULT_ICON,href);tempstyle.iconSize=new GSize(32,32);tempstyle.shadowSize=new GSize(59,32);tempstyle.dragCrossAnchor=new GPoint(2,8);tempstyle.iconAnchor=new GPoint(16,32);tempstyle.href=href;if(this.opts.printgif){var bits=href.split("/");var gif=bits[bits.length-1];gif=this.opts.printgifpath+gif.replace(/.png/i,".gif");tempstyle.printImage=gif;tempstyle.mozPrintImage=gif}
if(!!this.opts.noshadow){tempstyle.shadow=""}else{if(href.indexOf("/red.png")>-1||href.indexOf("/blue.png")>-1||href.indexOf("/green.png")>-1||href.indexOf("/yellow.png")>-1||href.indexOf("/lightblue.png")>-1||href.indexOf("/purple.png")>-1||href.indexOf("/orange.png")>-1||href.indexOf("/pink.png")>-1||href.indexOf("-dot.png")>-1){tempstyle.shadow="http://maps.google.com/mapfiles/ms/icons/msmarker.shadow.png"}else{if(href.indexOf("-pushpin.png")>-1||href.indexOf("/pause.png")>-1||href.indexOf("/go.png")>-1||href.indexOf("/stop.png")>-1){tempstyle.shadow="http://maps.google.com/mapfiles/ms/icons/pushpin_shadow.png"}else{var shadow=href.replace(".png",".shadow.png");if(shadow.indexOf(".jpg")){shadow=""}
tempstyle.shadow=shadow}}}}}
if(this.opts.noshadow){tempstyle.shadow=""}
return tempstyle};GeoXml.prototype.handleStyle=function(style,sid){var icons=style.getElementsByTagName("Icon");var tempstyle,opacity;var aa,bb,gg,rr;var fill,href,color,colormode,outline;if(icons.length>0){href=GXml.value(icons[0].getElementsByTagName("href")[0]);tempstyle=this.makeIcon(tempstyle,href)}
var linestyles=style.getElementsByTagName("LineStyle");if(linestyles.length>0){var width=parseInt(GXml.value(linestyles[0].getElementsByTagName("width")[0]),10);if(width<1){width=5}
color=GXml.value(linestyles[0].getElementsByTagName("color")[0]);aa=color.substr(0,2);bb=color.substr(2,2);gg=color.substr(4,2);rr=color.substr(6,2);color="#"+rr+gg+bb;opacity=parseInt(aa,16)/256;if(!tempstyle){tempstyle={}}
tempstyle.color=color;tempstyle.width=width;tempstyle.opacity=opacity}
var polystyles=style.getElementsByTagName("PolyStyle");if(polystyles.length>0){fill=parseInt(GXml.value(polystyles[0].getElementsByTagName("fill")[0]),10);outline=parseInt(GXml.value(polystyles[0].getElementsByTagName("outline")[0]),10);color=GXml.value(polystyles[0].getElementsByTagName("color")[0]);colormode=GXml.value(polystyles[0].getElementsByTagName("colorMode")[0]);if(polystyles[0].getElementsByTagName("fill").length==0){fill=1}
if(polystyles[0].getElementsByTagName("outline").length==0){outline=1}
aa=color.substr(0,2);bb=color.substr(2,2);gg=color.substr(4,2);rr=color.substr(6,2);color="#"+rr+gg+bb;opacity=parseInt(aa,16)/256;if(!tempstyle){tempstyle={}}
tempstyle.fill=fill;tempstyle.outline=outline;if(colormode!="random"){tempstyle.fillcolor=color}else{tempstyle.colortint=color}
tempstyle.fillOpacity=opacity;if(!fill){tempstyle.fillOpacity=0}
if(!outline){tempstyle.opacity=0}}
if(sid){this.styles["#"+sid]=tempstyle}
return tempstyle};GeoXml.prototype.processKML=function(node,marks,title,sbid,depth,paren){var that=this;var thismap=this.map;var icon;var grouptitle;var keepopen=this.forcefoldersopen;if(node.nodeName=="kml"){icon=this.docicon}
if(node.nodeName=="Document"){icon=this.kmlicon}
if(node.nodeName=="Folder"){icon=this.foldericon;grouptitle=title}
var pm=[];var sf=[];var desc="";var snip="";var i;var visible=true;var boundsmodified=false;var networklink=false;var url;var ground=null;var opacity=1;var wmsbounds;var makewms=false;var wmslist=[];var mytitle;var color;var ol;var n,ne,sw,se;var html;var kml_id=node.getAttribute("id");for(var ln=0;ln<node.childNodes.length;ln++){var nextn=node.childNodes.item(ln);var nn=nextn.nodeName;var nv=nextn.nodeValue;switch(nn){case"name":case"title":title=GXml.value(nextn);if(title.length+depth>this.maxtitlewidth){this.maxtitlewidth=title.length+depth}
break;case"Folder":case"Document":sf.push(nextn);break;case"GroundOverlay":url=GXml.value(nextn.getElementsByTagName("href")[0]);var north=parseFloat(GXml.value(nextn.getElementsByTagName("north")[0]));var south=parseFloat(GXml.value(nextn.getElementsByTagName("south")[0]));var east=parseFloat(GXml.value(nextn.getElementsByTagName("east")[0]));var west=parseFloat(GXml.value(nextn.getElementsByTagName("west")[0]));var attr=GXml.value(nextn.getElementsByTagName("attribution")[0]);sw=new GLatLng(south,west);ne=new GLatLng(north,east);this.bounds.extend(sw);this.bounds.extend(ne);color=GXml.value(nextn.getElementsByTagName("color")[0]);opacity=parseInt(color.substring(1,3),16)/256;mytitle=GXml.value(nextn.getElementsByTagName("name")[0]);var arcims=/arcimsproxy/i;if(url.match(arcims)){url+="&bbox="+west+","+south+","+east+","+north+"&response=img";wmsbounds=new GLatLngBounds(sw,ne);makewms=true;ol=this.makeWMSTileLayer(url,visible,mytitle,opacity,attr,title,wmsbounds);if(ol){ol.bounds=wmsbounds;ol.title=mytitle;ol.opacity=opacity;ol.visible=visible;ol.url=url;if(!this.quiet){this.mb.showMess("Adding Tiled ArcIms Overlay "+title,1000)}
wmslist.push(ol)}}else{var rs=/request=getmap/i;if(url.match(rs)){url+="&bbox="+west+","+south+","+east+","+north;wmsbounds=new GLatLngBounds(sw,ne);makewms=true;ol=this.makeWMSTileLayer(url,visible,mytitle,opacity,attr,title,wmsbounds);if(ol){ol.bounds=wmsbounds;ol.title=mytitle;ol.opacity=opacity;ol.visible=visible;ol.url=url;if(!this.quiet){this.mb.showMess("Adding Tiled WMS Overlay "+title,1000)}
wmslist.push(ol)}}else{wmsbounds=new GLatLngBounds(sw,ne);ground=new GGroundOverlay(url,wmsbounds);ground.bounds=wmsbounds;ground.getBounds=function(){return this.bounds};boundsmodified=true;makewms=false}}
break;case"NetworkLink":url=GXml.value(nextn.getElementsByTagName("href")[0]);networklink=true;break;case"description":case"Description":desc=GeoXml.getDescription(nextn);break;case"open":if(GXml.value(nextn)=="1"){keepopen=true}
if(GXml.value(nextn)=="0"){keepopen=this.forcefoldersopen}
break;case"visibility":if(GXml.value(nextn)=="0"){visible=false}
break;case"snippet":snip=GXml.value(nextn);break;default:for(var k=0;k<marks.length;k++){if(nn==marks[k]){pm.push(nextn)}}}}
var folderid;var idx=this.overlayman.folders.length;var me=paren;if(sf.length>1||pm.length||ground||makewms){this.overlayman.folders.push([]);this.overlayman.subfolders.push([]);this.overlayman.folderhtml.push([]);this.overlayman.folderhtmlast.push(0);this.overlayman.folderBounds.push(new GLatLngBounds());this.kml.push(new KMLObj(title,desc,false,idx));me=this.kml.length-1;folderid=this.createFolder(idx,title,sbid,icon,desc,snip,false,visible)}else{folderid=sbid}
if(node.nodeName=="Folder"||node.nodeName=="Document"){this.kml[me].open=keepopen;this.kml[me].folderid=folderid}
if(ground||makewms){this.kml[this.kml.length-1].visibility=visible;this.kml[this.kml.length-1].groundOverlays.push({url:url,bounds:wmsbounds})}
if(networklink){var re=/&amp;/g;url=url.replace(re,"&");var nl=/\n/g;url=url.replace(nl,"");this.progress++;if(!top.standalone){if(typeof this.proxy!="undefined"){url=this.proxy+escape(url)}}
var comm=this.myvar+".loadXMLUrl('"+url+"','"+title+"',null,null,'"+sbid+"');";setTimeout(comm,1000);return}
if(makewms&&wmslist.length){for(var wo=0;wo<wmslist.length;wo++){var ol=wmslist[wo];var blob="";if(this.basesidebar){var n=this.overlayman.markers.length;if(!this.nolegend){var myurl=ol.url.replace(/height=(\d)+/i,"height=100");myurl=myurl.replace(/width=(\d)+/i,"width=100");blob='<img src="'+myurl+'" style="width:100px" />'}}
parm=this.myvar+"$$$"+ol.title+"$$$tiledoverlay$$$"+n+"$$$"+blob+"$$$"+ol.visible+"$$$"+(this.baseLayers.length-1);var html=ol.desc;var thismap=this.map;GEvent.addListener(ol,"zoomto",function(){thismap.setZoom(thismap.getBoundsZoomLevel(this.getBounds()));thismap.panTo(this.getBounds().getCenter())});this.overlayman.AddMarker(ol,title,idx,parm,true,true)}}
if(ground){if(this.basesidebar){var n=this.overlayman.markers.length;var blob='<span style="background-color:black;border:2px solid brown;">&nbsp;&nbsp;&nbsp;&nbsp;</span> ';parm=this.myvar+"$$$"+title+"$$$polygon$$$"+n+"$$$"+blob+"$$$"+visible+"$$$null";var html=desc;var thismap=this.map;GEvent.addListener(ground,"zoomto",function(){thismap.setZoom(thismap.getBoundsZoomLevel(ground.getBounds()));thismap.panTo(ground.getBounds().getCenter())});this.overlayman.folderBounds[idx].extend(ground.getBounds().getSouthWest());this.overlayman.folderBounds[idx].extend(ground.getBounds().getNorthEast());boundsmodified=true;this.overlayman.AddMarker(ground,title,idx,parm,visible)}
this.map.addOverlay(ground)}
for(i=0;i<pm.length;i++){this.handlePlacemark(pm[i],idx,depth+1)}
var fc=0;for(i=0;i<sf.length;i++){var fid=this.processKML(sf[i],marks,title,folderid,depth+1,me);if(typeof fid=="number"&&fid!=idx){var sub=this.overlayman.folderBounds[fid];if(!sub){this.overlayman.folderBounds[fid]=new GLatLngBounds()}else{var sw=this.overlayman.folderBounds[fid].getSouthWest();var ne=this.overlayman.folderBounds[fid].getNorthEast();this.overlayman.folderBounds[idx].extend(sw);this.overlayman.folderBounds[idx].extend(ne)}
this.overlayman.subfolders[idx].push(fid);if(fid!=idx){this.kml[idx].folders.push(fid)}
fc++}}
if(fc||pm.length||boundsmodified){this.bounds.extend(this.overlayman.folderBounds[idx].getSouthWest());this.bounds.extend(this.overlayman.folderBounds[idx].getNorthEast())}
if(sf.length==0&&pm.length==0&&!this.opts.basesidebar){this.ParseURL()}
return idx};GeoXml.prototype.processGPX=function(node,title,sbid,depth){var icon;if(node.nodeName=="gpx"){icon=this.gmlicon}
if(node.nodeName=="rte"||node.nodeName=="trk"||node.nodeName=="trkseg"){icon=this.foldericon}
var pm=[];var sf=[];var desc="";var snip="";var i,lon,lat,l;var open=this.forcefoldersopen;var coords="";var visible=true;for(var ln=0;ln<node.childNodes.length;ln++){var nextn=node.childNodes.item(ln);var nn=nextn.nodeName;if(nn=="name"||nn=="title"){title=GXml.value(nextn);if(title.length+depth>this.maxtitlewidth){this.maxtitlewidth=title.length+depth}}
if(nn=="rte"){sf.push(nextn)}
if(nn=="trk"){sf.push(nextn)}
if(nn=="trkseg"){sf.push(nextn)}
if(nn=="trkpt"){pm.push(nextn);l=nextn.getAttribute("lat");if(typeof l!="undefined"){lat=l}
l=nextn.getAttribute("lon");if(typeof l!="undefined"){lon=l;coords+=lon+","+lat+" "}}
if(nn=="rtept"){pm.push(nextn);l=nextn.getAttribute("lat");if(typeof l!="undefined"){lat=l}
l=nextn.getAttribute("lon");if(typeof l!="undefined"){lon=l;coords+=lon+","+lat+" "}}
if(nn=="wpt"){pm.push(nextn)}
if(nn=="description"||nn=="desc"){desc=GXml.value(nextn)}}
if(coords.length){var nc='<?xml version="1.0"?><Placemark><name>'+title+"</name><description>"+desc+"</description><LineString><coordinates>"+coords+"</coordinates></LineString></Placemark>";var pathnode=GXml.parse(nc).documentElement;pm.push(pathnode)}
var folderid;var idx=this.overlayman.folders.length;if(pm.length||node.nodeName=="gpx"){this.overlayman.folders.push([]);this.overlayman.subfolders.push([]);this.overlayman.folderhtml.push([]);this.overlayman.folderhtmlast.push(0);this.overlayman.folderBounds.push(new GLatLngBounds());this.kml.push(new KMLObj(title,desc,open,idx));folderid=this.createFolder(idx,title,sbid,icon,desc,snip,open,visible)}else{folderid=sbid}
for(i=0;i<pm.length;i++){this.handlePlacemark(pm[i],idx,depth+1)}
for(i=0;i<sf.length;i++){var fid=this.processGPX(sf[i],title,folderid,depth+1);this.overlayman.subfolders[idx].push(fid);this.overlayman.folderBounds[idx].extend(this.overlayman.folderBounds[fid].getSouthWest());this.overlayman.folderBounds[idx].extend(this.overlayman.folderBounds[fid].getNorthEast())}
if(this.overlayman.folderBounds[idx]){this.bounds.extend(this.overlayman.folderBounds[idx].getSouthWest());this.bounds.extend(this.overlayman.folderBounds[idx].getNorthEast())}
return idx};GeoXml.prototype.ParseURL=function(){var query=top.location.search.substring(1);var pairs=query.split("&");var marks=this.overlayman.markers;for(var i=0;i<pairs.length;i++){var pos=pairs[i].indexOf("=");var argname=pairs[i].substring(0,pos).toLowerCase();var val=unescape(pairs[i].substring(pos+1));var m=0;var nae;if(val){switch(argname){case"openbyid":for(m=0;m<marks.length;m++){nae=marks[m].id;if(nae==val){this.overlayman.markers[m].show();this.overlayman.markers[m].hidden=false;GEvent.trigger(this.overlayman.markers[m],"click");break}}
break;case"kml":case"url":case"src":case"geoxml":this.urls.push(val);this.parse();break;case"openbyname":for(m=0;m<marks.length;m++){nae=marks[m].title;if(nae==val){this.overlayman.markers[m].show();this.overlayman.markers[m].hidden=false;GEvent.trigger(this.overlayman.markers[m],"click");break}}
break}}}};GeoXml.prototype.processing=function(xmlDoc,title,latlon,desc,sbid){this.overlayman.miStart=new Date();if(!desc){desc=title}
var that=this;if(!sbid){sbid=0}
var shadow;var idx;var root=xmlDoc.documentElement;if(!root){alert("No document found");return 0}
var placemarks=[];var name;var pname;var styles;var basename=root.nodeName;var keepopen=that.opts.allfoldersopen;var bases=basename.split(":");if(bases.length>1){basename=bases[1]}
var bar,sid,i;if(basename=="FeatureCollection"){bar=$(that.basesidebar);if(!title){title=name}
if(typeof title=="undefined"){title="Un-named GML"}
if(title.length>that.maxtitlewidth){that.maxtitlewidth=title.length}
bar.style.display="";idx=that.overlayman.folders.length;that.processGML(root,title,latlon,desc,(that.kml.length-1));that.kml[0].folders.push(idx)}
if(basename=="gpx"){if(!title){title=name}
if(typeof title=="undefined"){title="Un-named GPX"}
that.title=title;if(title.length>that.maxtitlewidth){that.maxtitlewidth=title.length}
bar=$(that.basesidebar);if(bar){bar.style.display=""}
idx=that.overlayman.folders.length;that.processGPX(root,title,that.basesidebar,sbid);that.kml[0].folders.push(idx)}else{if(basename=="kml"){styles=root.getElementsByTagName("Style");for(i=0;i<styles.length;i++){sid=styles[i].getAttribute("id");if(sid){that.handleStyle(styles[i],sid)}}
styles=root.getElementsByTagName("StyleMap");for(i=0;i<styles.length;i++){sid=styles[i].getAttribute("id");if(sid){var found=false;var node=styles[i];for(var j=0;(j<node.childNodes.length&&!found);j++){var pair=node.childNodes[j];for(var k=0;(k<pair.childNodes.length&&!found);k++){var pn=pair.childNodes[k].nodeName;if(pn=="styleUrl"){var pid=GXml.value(pair.childNodes[k]);that.styles["#"+sid]=that.styles[pid];found=true}
if(pn=="Style"){that.handleStyle(pair.childNodes[k],sid);found=true}}}}}
if(!title){title=name}
if(typeof title=="undefined"){title="KML Document"}
that.title=title;if(title.length>that.maxtitlewidth){that.maxtitlewidth=title.length}
var marknames=["Placemark"];var schema=root.getElementsByTagName("Schema");for(var s=0;s<schema.length;s++){pname=schema[s].getAttribute("parent");if(pname=="Placemark"){pname=schema[s].getAttribute("name");marknames.push(pname)}}
bar=$(that.basesidebar);if(bar){bar.style.display=""}
idx=that.overlayman.folders.length;var paren=that.kml.length-1;var fid=that.processKML(root,marknames,title,that.basesidebar,0,paren);that.kml[0].folders.push(idx)}else{placemarks=root.getElementsByTagName("item");if(placemarks.length<1){placemarks=root.getElementsByTagName("atom")}
if(placemarks.length<1){placemarks=root.getElementsByTagName("entry")}
if(!title){title=name}
if(typeof title=="undefined"){title="News Feed"}
that.title=title;if(title.length>that.maxtitlewidth){that.maxtitlewidth=title.length}
var style;if(that.opts.baseicon){style=that.opts.baseicon;style.href=style.image}else{style=new GIcon(G_DEFAULT_ICON,that.rssicon);style.iconSize=new GSize(32,32);style.shadowSize=new GSize(59,32);style.dragCrossAnchor=new GPoint(2,8);style.iconAnchor=new GPoint(16,32);style.href=that.rssicon;shadow=that.rssicon.replace(".png",".shadow.png");style.shadow=shadow+"_shadow.png"}
style.color="#00FFFF";style.width="3";style.opacity=0.5;if(!desc){desc="RSS feed"}
that.kml[0].folders.push(that.overlayman.folders.length);if(placemarks.length){bar=$(that.basesidebar);if(bar){bar.style.display=""}
that.overlayman.folders.push([]);that.overlayman.folderhtml.push([]);that.overlayman.folderhtmlast.push(0);that.overlayman.folderBounds.push(new GLatLngBounds());idx=that.kml.length-1;that.kml[idx].open=keepopen;that.kml.push(new KMLObj(title,desc,keepopen,idx));if(that.basesidebar){var folderid=that.createFolder(idx,title,that.basesidebar,that.globalicon,desc,null,keepopen,true)}
for(i=0;i<placemarks.length;i++){that.handlePlacemark(placemarks[i],idx,sbid,style)}}}}
that.progress--;if(that.progress==0){GEvent.trigger(that,"initialized");if(!that.opts.sidebarid){that.mb.showMess("Finished Parsing",1000)}
if(!that.opts.nozoom&&!that.basesidebar){that.map.setZoom(that.map.getBoundsZoomLevel(that.bounds));that.map.setCenter(that.bounds.getCenter())}}};GeoXml.prototype.createFolder=function(idx,title,sbid,icon,desc,snippet,keepopen,visible){var sb=$(sbid);keepopen=true;var folderid=this.myvar+"_folder"+idx;var checked="";if(visible){checked=" checked "}
this.overlayman.folderhtml[folderid]="";var disp="display:block";var fw="font-weight:normal";if(typeof keepopen=="undefined"||!keepopen){disp="display:none";fw="font-weight:bold"}
if(!desc||desc==""){desc=title}
desc=escape(desc);var htm='<ul><input type="checkbox" id="'+this.myvar+""+idx+'FCB" style="vertical-align:middle" ';htm+=checked;htm+='onclick="'+this.myvar+".toggleContents("+idx+',this.checked)">';htm+='&nbsp;<span title="'+snippet+'" id="'+this.myvar+"TB"+idx+'" oncontextmenu="'+this.myvar+".saveJSON("+idx+');" onclick="'+this.myvar+".toggleFolder("+idx+')" style="'+fw+'">';htm+='<img style="vertical-align:text-top;padding:0;margin:0" height="16" border="0" src="'+icon+'" /></span>&nbsp;';htm+='<a href="#" onclick="'+this.myvar+".overlayman.zoomToFolder("+idx+");"+this.myvar+".mb.showMess('"+desc+"',3000);return false;\">"+title+'</a><br><div id="'+folderid+'" style="'+disp+'"></div></ul>';if(sb){sb.innerHTML=htm+sb.innerHTML}
return folderid};GeoXml.prototype.processGML=function(root,title,latlon,desc,me){var that=this;var isWFS=false;var placemarks=[];var srsName;var isLatLon=false;var xmin=0;var ymin=0;var xscale=1;var yscale=1;var points,pt,pts;var coor,coorstr;var x,y,k,i;var name=title;var pt1,pt2,box;for(var ln=0;ln<root.childNodes.length;ln++){var kid=root.childNodes.item(ln).nodeName;var n=root.childNodes.item(ln);if(kid=="gml:boundedBy"||kid=="boundedBy"){for(var j=0;j<n.childNodes.length;j++){var nn=n.childNodes.item(j).nodeName;var llre=/CRS:84|(4326|4269)$/i;if(nn=="Box"||nn=="gml:Box"){box=n.childNodes.item(j);srsName=n.childNodes.item(j).getAttribute("srsName");if(srsName.match(llre)){isLatLon=true}else{alert("SRSname ="+srsName+"; attempting to create transform");for(k=0;k<box.childNodes.length;k++){coor=box.childNodes.item(k);if(coor.nodeName=="gml:coordinates"||coor.nodeName=="coordinates"){coorstr=GXml.value(coor);pts=coorstr.split(" ");pt1=pts[0].split(",");pt2=pts[1].split(",");xscale=(parseFloat(pt2[0])-parseFloat(pt1[0]))/(latlon.xmax-latlon.xmin);yscale=(parseFloat(pt2[1])-parseFloat(pt1[1]))/(latlon.ymax-latlon.ymin);xmin=pt1[0]/xscale-latlon.xmin;ymin=pt1[1]/yscale-latlon.ymin}}}
break}
if(nn=="Envelope"||nn=="gml:Envelope"){box=n.childNodes.item(j);srsName=n.childNodes.item(j).getAttribute("srsName");if(srsName.match(llre)){isLatLon=true}else{alert("SRSname ="+srsName+"; attempting to create transform");for(k=0;k<box.childNodes.length;k++){coor=box.childNodes.item(k);if(coor.nodeName=="gml:coordinates"||coor.nodeName=="coordinates"){pts=coor.split(" ");var b={xmin:100000000,ymin:100000000,xmax:-100000000,ymax:-100000000};for(var m=0;m<pts.length-1;m++){pt=pts[m].split(",");x=parseFloat(pt[0]);y=parseFloat(pt[1]);if(x<b.xmin){b.xmin=x}
if(y<b.ymin){b.ymin=y}
if(x>b.xmax){b.xmax=x}
if(y>b.ymax){b.ymax=y}}
xscale=(b.xmax-b.xmin)/(latlon.xmax-latlon.xmin);yscale=(b.ymax-b.ymin)/(latlon.ymax-latlon.ymin);xmin=b.xmin/xscale-latlon.xmin;ymin=b.ymin/yscale-latlon.ymin}}}}
break}}
if(kid=="gml:featureMember"||kid=="featureMember"){placemarks.push(n)}}
var folderid;if(!title){title=name}
this.title=title;if(placemarks.length<1){alert("No features found in "+title);this.mb.showMess("No features found in "+title,3000)}else{this.mb.showMess("Adding "+placemarks.length+" features found in "+title);this.overlayman.folders.push([]);this.overlayman.folderhtml.push([]);this.overlayman.folderhtmlast.push(0);this.overlayman.folderBounds.push(new GLatLngBounds());var idx=this.overlayman.folders.length-1;if(this.basesidebar){folderid=this.createFolder(idx,title,this.basesidebar,this.gmlicon,desc,null,true,true)}
this.kml.push(new KMLObj(title,desc,true,idx));this.kml[me].open=that.opts.allfoldersopen;this.kml[me].folderid=folderid;if(isLatLon){for(i=0;i<placemarks.length;i++){this.handlePlacemark(placemarks[i],idx,0)}}else{var trans={xs:xscale,ys:yscale,x:xmin,y:ymin};for(i=0;i<placemarks.length;i++){this.handleGeomark(placemarks[i],idx,trans,0)}}}};PolylineEncoder=function(numLevels,zoomFactor,verySmall,forceEndpoints){var i;if(!numLevels){numLevels=18}
if(!zoomFactor){zoomFactor=2}
if(!verySmall){verySmall=1e-7}
if(!forceEndpoints){forceEndpoints=true}
this.numLevels=numLevels;this.zoomFactor=zoomFactor;this.verySmall=verySmall;this.veryTiny=verySmall*verySmall;this.forceEndpoints=forceEndpoints;this.zoomLevelBreaks=[];for(i=0;i<numLevels;i++){this.zoomLevelBreaks[i]=verySmall*Math.pow(zoomFactor,numLevels-i-1);this.zoomLevelBreaks[i]*=this.zoomLevelBreaks[i]}};PolylineEncoder.prototype.dpEncode=function(points){var absMaxDist=0;var stack=[];var dists=[];var maxDist,maxLoc,temp,first,last,current;var i,encodedPoints,encodedLevels;var segmentLength;stack.push([0,points.length-1]);while(stack.length>0){current=stack.pop();maxDist=0;segmentLength=Math.pow(points[current[1]].lat()-points[current[0]].lat(),2)+Math.pow(points[current[1]].lng()-points[current[0]].lng(),2);for(i=current[0]+1;i<current[1];i++){temp=this.distance(points[i],points[current[0]],points[current[1]],segmentLength);if(temp>maxDist){maxDist=temp;maxLoc=i;if(maxDist>absMaxDist){absMaxDist=maxDist}}}
if(maxDist>this.veryTiny){dists[maxLoc]=maxDist;stack.push([current[0],maxLoc]);stack.push([maxLoc,current[1]])}}
encodedPoints=this.createEncodings(points,dists);encodedLevels=this.encodeLevels(points,dists,absMaxDist);return{encodedPoints:encodedPoints,encodedLevels:encodedLevels,encodedPointsLiteral:encodedPoints.replace(/\\/g,"\\\\")}};PolylineEncoder.prototype.dpEncodeToJSON=function(points,color,weight,opacity){var result;result=this.dpEncode(points);return{color:color,weight:weight,opacity:opacity,points:result.encodedPoints,levels:result.encodedLevels,numLevels:this.numLevels,zoomFactor:this.zoomFactor,literals:result.encodePointsLiteral}};PolylineEncoder.prototype.dpEncodeToGPolyline=function(points,color,weight,opacity){return new GPolyline.fromEncoded(this.dpEncodeToJSON(points,color,weight,opacity))};PolylineEncoder.prototype.dpEncodeToGPolygon=function(pointsArray,boundaryColor,boundaryWeight,boundaryOpacity,fillColor,fillOpacity,fill,outline){var i,boundaries;boundaries=[];for(i=0;i<pointsArray.length;i++){boundaries.push(this.dpEncodeToJSON(pointsArray[i],boundaryColor,boundaryWeight,boundaryOpacity))}
return new GPolygon.fromEncoded({polylines:boundaries,color:fillColor,opacity:fillOpacity,fill:fill,outline:outline})};PolylineEncoder.prototype.distance=function(p0,p1,p2,segLength){var u,out;var dlat2=p2.lat()-p1.lat();var dlong1=p2.lng()-p1.lng();if(dlat2==0&&dlong1==0){out=Math.pow(p2.lat()-p0.lat(),2)+Math.pow(p2.lng()-p0.lng(),2)}else{var dlat0=p0.lat()-p1.lat();var dlong0=p0.lng()-p1.lng();u=((dlat0)*(dlat2)+(dlong0)*(dlong1))/segLength;if(u<=0){out=Math.pow(dlat0,2)+Math.pow(dlong0,2)}
if(u>=1){out=Math.pow(p0.lat()-p2.lat(),2)+Math.pow(p0.lng()-p2.lng(),2)}
if(0<u&&u<1){out=Math.pow(dlat0-u*(dlat2),2)+Math.pow(dlong0-u*(dlong1),2)}}
return out};PolylineEncoder.prototype.createEncodings=function(points,dists){var i;var j;var floor=Math.floor;var len=points.length-2;var late5;var lnge5;var dlat=floor(points[0].lat()*100000);var dlng=floor(points[0].lng()*100000);var plat=dlat;var plng=dlng;var encoded_points=this.encodeSignedNumber(dlat)+this.encodeSignedNumber(dlng);for(j=len;j>0;j--){i=len-j+1;if(dists[i]!=undefined){late5=floor(points[i].lat()*100000);lnge5=floor(points[i].lng()*100000);dlat=late5-plat;dlng=lnge5-plng;plat=late5;plng=lnge5;encoded_points+=this.encodeSignedNumber(dlat)+this.encodeSignedNumber(dlng)}}
dlat=floor(points[len+1].lat()*100000)-plat;dlng=floor(points[len+1].lng()*100000)-plng;encoded_points+=this.encodeSignedNumber(dlat)+this.encodeSignedNumber(dlng);return encoded_points};PolylineEncoder.prototype.computeLevel=function(dd){var lev;if(dd>this.veryTiny){lev=0;while(dd<this.zoomLevelBreaks[lev]){lev++}
return lev}};PolylineEncoder.prototype.encodeLevels=function(points,dists,absMaxDist){var i;var encoded_levels="";if(this.forceEndpoints){encoded_levels+=this.encodeNumber(this.numLevels-1)}else{encoded_levels+=this.encodeNumber(this.numLevels-this.computeLevel(absMaxDist)-1)}
for(i=1;i<points.length-1;i++){if(dists[i]!=undefined){encoded_levels+=this.encodeNumber(this.numLevels-this.computeLevel(dists[i])-1)}}
if(this.forceEndpoints){encoded_levels+=this.encodeNumber(this.numLevels-1)}else{encoded_levels+=this.encodeNumber(this.numLevels-this.computeLevel(absMaxDist)-1)}
return encoded_levels};PolylineEncoder.prototype.encodeNumber=function(num){var encodeString="";var nextValue,finalValue;while(num>=32){nextValue=(32|(num&31))+63;encodeString+=(String.fromCharCode(nextValue));num>>=5}
finalValue=num+63;encodeString+=(String.fromCharCode(finalValue));return encodeString};PolylineEncoder.prototype.encodeSignedNumber=function(num){var sgn_num=num<<1;if(num<0){sgn_num=~(sgn_num)}
return(this.encodeNumber(sgn_num))};PolylineEncoder.latLng=function(y,x){this.y=y;this.x=x};PolylineEncoder.latLng.prototype.lat=function(){return this.y};PolylineEncoder.latLng.prototype.lng=function(){return this.x};PolylineEncoder.pointsToLatLngs=function(points){var i,latLngs;latLngs=[];for(i=0;i<points.length;i++){latLngs.push(new PolylineEncoder.latLng(points[i][0],points[i][1]))}
return latLngs};PolylineEncoder.pointsToGLatLngs=function(points){var i,gLatLngs;gLatLngs=[];for(i=0;i<points.length;i++){gLatLngs.push(new GLatLng(points[i][0],points[i][1]))}
return gLatLngs};GPolyline.prototype.getPoint=function(){return(this.getVertex(Math.round(this.getVertexCount()/2)))};GPolyline.prototype.computeBounds=function(){var bounds=new GLatLngBounds();for(var i=0;i<this.getVertexCount();i++){var v=this.getVertex(i);if(v){bounds.extend(v)}}
this.bounds=bounds;return bounds};GTileLayerOverlay.prototype.getBounds=function(){return this.bounds};GPolyline.prototype.getBounds=function(){if(typeof this.bounds!="undefined"){return this.bounds}else{return(this.computeBounds())}};GTileLayer.prototype.getBounds=function(){return this.bounds};GPolygon.prototype.getPoint=function(){return(this.getBounds().getCenter())};Clusterer=function(map,paren){this.myvar=paren.myvar;this.paren=paren;this.map=map;this.markers=[];this.byid=[];this.byname=[];this.clusters=[];this.timeout=null;this.folders=[];this.folderBounds=[];this.folderhtml=[];this.folderhtmlast=[];this.subfolders=[];this.currentZoomLevel=map.getZoom();this.isParsed=false;this.maxVisibleMarkers=Clusterer.defaultMaxVisibleMarkers;this.gridSize=Clusterer.defaultGridSize;this.minMarkersPerCluster=Clusterer.defaultMinMarkersPerCluster;this.maxLinesPerInfoBox=Clusterer.defaultMaxLinesPerInfoBox;this.icon=Clusterer.defaultIcon;GEvent.addListener(map,"zoomend",Clusterer.MakeCaller(Clusterer.Display,this));GEvent.addListener(map,"moveend",Clusterer.MakeCaller(Clusterer.Display,this));GEvent.addListener(map,"infowindowclose",Clusterer.MakeCaller(Clusterer.PopDown,this))};Clusterer.defaultMaxVisibleMarkers=650;Clusterer.defaultGridSize=15;Clusterer.defaultMinMarkersPerCluster=5;Clusterer.defaultMaxLinesPerInfoBox=15;Clusterer.defaultIcon=new GIcon();Clusterer.defaultIcon.image="http://www.acme.com/resources/images/markers/blue_large.PNG";Clusterer.defaultIcon.shadow="http://www.acme.com/resources/images/markers/shadow_large.PNG";Clusterer.defaultIcon.iconSize=new GSize(30,51);Clusterer.defaultIcon.shadowSize=new GSize(56,51);Clusterer.defaultIcon.iconAnchor=new GPoint(13,34);Clusterer.defaultIcon.infoWindowAnchor=new GPoint(13,3);Clusterer.defaultIcon.infoShadowAnchor=new GPoint(27,37);Clusterer.prototype.SetIcon=function(icon){this.icon=icon};Clusterer.prototype.SetMaxVisibleMarkers=function(n){this.maxVisibleMarkers=n};Clusterer.prototype.SetMinMarkersPerCluster=function(n){this.minMarkersPerCluster=n};Clusterer.prototype.SetMaxLinesPerInfoBox=function(n){this.maxLinesPerInfoBox=n};Clusterer.prototype.AddMarker=function(marker,title,idx,sidebar,visible,forcevisible){if(marker.setMap!=null){marker.setMap(this.map)}
marker.hidden=false;if(visible!=true){marker.hidden=true}
if(this.paren.hideall){marker.hidden=true}
marker.title=title;this.folders[idx].push(this.markers.length);var bounds=this.map.getBounds();var vis=false;if(typeof marker.getBounds=="undefined"){if(bounds.contains(marker.getPoint())){vis=true}}else{var b=marker.getBounds();if(!b.isEmpty()){if(bounds.intersects(b)){vis=true}}}
if(forcevisible){vis=true}
this.markers.push(marker);if(vis){marker.onMap=true;this.map.addOverlay(marker);if(marker.hidden){marker.hide();if(!!marker.label){marker.label.hide()}}}
this.DisplayLater();if(sidebar){this.folderhtml[idx].push(sidebar)}};Clusterer.prototype.zoomToFolder=function(idx){var bounds=this.folderBounds[idx];this.map.setZoom(this.map.getBoundsZoomLevel(bounds));this.map.panTo(bounds.getCenter())};Clusterer.prototype.RemoveMarker=function(marker){for(var i=0;i<this.markers.length;++i){if(this.markers[i]==marker){if(marker.onMap){this.map.removeOverlay(marker)}
for(var j=0;j<this.clusters.length;++j){var cluster=this.clusters[j];if(cluster!=null){for(var k=0;k<cluster.markers.length;++k){if(cluster.markers[k]==marker){cluster.markers[k]=null;--cluster.markerCount;break}}
if(cluster.markerCount==0){this.ClearCluster(cluster);this.clusters[j]=null}else{if(cluster==this.poppedUpCluster){Clusterer.RePop(this)}}}}
this.markers[i]=null;break}}
this.DisplayLater()};Clusterer.prototype.DisplayLater=function(){if(this.timeout!=null){clearTimeout(this.timeout)}
this.timeout=setTimeout(Clusterer.MakeCaller(Clusterer.Display,this),50)};Clusterer.Display=function(clusterer){var i,j,k,marker,cluster,l;clearTimeout(clusterer.timeout);var update_side=false;var count=0;var clon,bits;var vis;var content;if(clusterer.paren.basesidebar){for(k=0;k<clusterer.folderhtml.length;k++){var curlen=clusterer.folderhtml[k].length;var con=clusterer.folderhtmlast[k];if(con<curlen){var destid=clusterer.paren.myvar+"_folder"+k;var dest=$(destid);if(dest){if(clusterer.paren.opts.sortbyname){content=dest.innerHTML;clon=clusterer.folderhtml[k].sort();for(l=0;l<curlen;l++){bits=clon[l].split("$$$",7);content+=clusterer.paren.sidebarfn(bits[0],bits[1],bits[2],bits[3],bits[4],bits[5],bits[6])}}else{content=dest.innerHTML;clon=clusterer.folderhtml[k];for(l=con;l<curlen;l++){bits=clon[l].split("$$$",7);content+=clusterer.paren.sidebarfn(bits[0],bits[1],bits[2],bits[3],bits[4],bits[5],bits[6])}}
clusterer.folderhtmlast[k]=curlen;dest.innerHTML=content;if(clusterer.paren.forcefoldersopen){dest.style.display="block"}
update_side=true;count=curlen}else{alert("target folder not found "+destid)}}}}
if(update_side&&count>0){if(clusterer.paren.progress==0){clusterer.paren.setFolders();GEvent.trigger(clusterer.paren,"parsed");if(!clusterer.paren.opts.sidebarid){clusterer.paren.mb.showMess("Finished Parsing",1000)}
var mifinish=new Date();var sec=((mifinish-clusterer.miStart)/1000+" seconds");clusterer.paren.mb.showMess("Loaded "+count+"  GeoXML elements in "+sec,5000);clusterer.paren.ParseURL();if(!clusterer.paren.opts.nozoom){clusterer.paren.map.setZoom(clusterer.paren.map.getBoundsZoomLevel(clusterer.paren.bounds));clusterer.paren.map.setCenter(clusterer.paren.bounds.getCenter())}}}
if(update_side&&typeof resizeKML!="undefined"){resizeKML()}
var bounds,sw,ne,dx,dy;var newZoomLevel=clusterer.map.getZoom();if(newZoomLevel!=clusterer.currentZoomLevel){for(i=0;i<clusterer.clusters.length;++i){if(clusterer.clusters[i]!=null){clusterer.ClearCluster(clusterer.clusters[i]);clusterer.clusters[i]=null}}
clusterer.clusters.length=0;clusterer.currentZoomLevel=newZoomLevel}
bounds=clusterer.map.getBounds();sw=bounds.getSouthWest();ne=bounds.getNorthEast();dx=ne.lng()-sw.lng();dy=ne.lat()-sw.lat();if(dx<300&&dy<150){dx*=0.05;dy*=0.05;bounds=new GLatLngBounds(new GLatLng(sw.lat()-dy,sw.lng()-dx),new GLatLng(ne.lat()+dy,ne.lng()+dx))}
var visibleMarkers=[];var nonvisibleMarkers=[];var viscount=0;for(i=0;i<clusterer.markers.length;++i){marker=clusterer.markers[i];vis=false;if(marker!=null){var mid=clusterer.paren.myvar+"sb"+i;if(typeof marker.getBounds=="undefined"){if(bounds.contains(marker.getPoint())){vis=true;if($(mid)){$(mid).className="inView"}
viscount++}else{if($(mid)){$(mid).className="outView"}}}else{var b=marker.getBounds();if($(mid)){if(bounds.intersects(b)){$(mid).className="inView"}else{$(mid).className="outView"}}
vis=true}
if(vis){visibleMarkers.push(i)}else{nonvisibleMarkers.push(i)}}}
for(i=0;i<nonvisibleMarkers.length;++i){marker=clusterer.markers[nonvisibleMarkers[i]];if(marker.onMap){clusterer.map.removeOverlay(marker);marker.onMap=false}}
for(i=0;i<clusterer.clusters.length;++i){cluster=clusterer.clusters[i];if(cluster!=null&&cluster.marker){vis=false;if(typeof cluster.marker.getBounds=="undefined"){if(bounds.contains(cluster.marker.getPoint())){vis=true}}else{vis=true}
if(!vis&&cluster.onMap){clusterer.map.removeOverlay(cluster.marker);cluster.onMap=false}}}
if(viscount>clusterer.maxVisibleMarkers){if(!update_side){clusterer.paren.mb.showMess("Clustering on "+viscount+"  GeoXML elements")}
var latRange=bounds.getNorthEast().lat()-bounds.getSouthWest().lat();var latInc=latRange/clusterer.gridSize;var lngInc=latInc/Math.cos((bounds.getNorthEast().lat()+bounds.getSouthWest().lat())/2*Math.PI/180);for(var lat=bounds.getSouthWest().lat();lat<=bounds.getNorthEast().lat();lat+=latInc){for(var lng=bounds.getSouthWest().lng();lng<=bounds.getNorthEast().lng();lng+=lngInc){cluster={};cluster.clusterer=clusterer;cluster.bounds=new GLatLngBounds(new GLatLng(lat,lng),new GLatLng(lat+latInc,lng+lngInc));cluster.markers=[];cluster.markerCount=0;cluster.onMap=false;cluster.marker=null;clusterer.clusters.push(cluster)}}
for(i=0;i<visibleMarkers.length;++i){marker=clusterer.markers[visibleMarkers[i]];if(marker!=null&&!marker.inCluster){for(j=0;j<clusterer.clusters.length;++j){cluster=clusterer.clusters[j];if(cluster!=null){vis=false;if(typeof marker.getBounds=="undefined"){if(cluster.bounds.contains(marker.getPoint())){vis=true}}
if(vis){marker.inCluster=true;clusterer.clusters[j].markers.push(marker);++clusterer.clusters[j].markerCount}}}}}
for(i=0;i<clusterer.clusters.length;++i){if(clusterer.clusters[i]!=null&&clusterer.clusters[i].markerCount<clusterer.minMarkersPerCluster){clusterer.ClearCluster(clusterer.clusters[i]);clusterer.clusters[i]=null}}
for(i=clusterer.clusters.length-1;i>=0;--i){if(clusterer.clusters[i]!=null){break}else{--clusterer.clusters.length}}
for(i=0;i<clusterer.clusters.length;++i){cluster=clusterer.clusters[i];if(cluster!=null){for(j=0;j<cluster.markers.length;++j){marker=cluster.markers[j];if(marker!=null&&marker.onMap){clusterer.map.removeOverlay(marker);marker.onMap=false}}}}
for(i=0;i<clusterer.clusters.length;++i){cluster=clusterer.clusters[i];if(cluster!=null&&cluster.marker==null){var xTotal=0;var yTotal=0;for(j=0;j<cluster.markers.length;++j){marker=cluster.markers[j];if(marker!=null){xTotal+=(+marker.getPoint().lng());yTotal+=(+marker.getPoint().lat())}}
var location=new GLatLng(yTotal/cluster.markerCount,xTotal/cluster.markerCount);marker=new GMarker(location,{icon:clusterer.icon});cluster.marker=marker;GEvent.addListener(marker,"click",Clusterer.MakeCaller(Clusterer.PopUp,cluster))}}}
if(!update_side&&viscount){clusterer.paren.mb.showMess("Showing "+viscount+"  GeoXML elements",500)}
for(i=0;i<visibleMarkers.length;++i){marker=clusterer.markers[visibleMarkers[i]];if(marker!=null&&!marker.onMap&&!marker.inCluster){if(marker.addedToMap!=null){marker.addedToMap()}
if(marker.hidden){if(marker.hide){clusterer.map.addOverlay(marker);marker.hide();if(!!marker.label){marker.label.hide()}}}else{clusterer.map.addOverlay(marker)}
marker.onMap=true}}
for(i=0;i<clusterer.clusters.length;++i){cluster=clusterer.clusters[i];if(cluster!=null&&cluster.marker){vis=false;if(typeof marker.getPoint!="undefined"){if(bounds.contains(cluster.marker.getPoint())){vis=true}}else{if(bounds.intersects(cluster.marker.getBounds())){vis=true}}
if(!cluster.onMap&&vis){clusterer.map.addOverlay(cluster.marker);cluster.onMap=true}}}
Clusterer.RePop(clusterer)};Clusterer.PopUp=function(cluster){var clusterer=cluster.clusterer;var html='<table width="300">';var n=0;for(var i=0;i<cluster.markers.length;++i){var marker=cluster.markers[i];if(marker!=null){++n;html+="<tr><td>";if(typeof marker.getIcon!="undefined"&&marker.getIcon().smallImage!=null){html+='<img src="'+marker.getIcon().smallImage+'">'}else{html+='<img src="'+marker.getIcon().image+'" width="'+(marker.getIcon().iconSize.width/2)+'" height="'+(marker.getIcon().iconSize.height/2)+'">'}
html+="</td><td>"+marker.title+"</td></tr>";if(n==clusterer.maxLinesPerInfoBox-1&&cluster.markerCount>clusterer.maxLinesPerInfoBox){html+='<tr><td colspan="2">...and '+(cluster.markerCount-n)+" more</td></tr>";break}}}
html+="</table>";clusterer.map.closeInfoWindow();cluster.marker.openInfoWindowHtml(html);clusterer.poppedUpCluster=cluster};Clusterer.RePop=function(clusterer){if(clusterer.poppedUpCluster!=null){Clusterer.PopUp(clusterer.poppedUpCluster)}};Clusterer.PopDown=function(clusterer){clusterer.poppedUpCluster=null};Clusterer.prototype.ClearCluster=function(cluster){var i,marker;for(i=0;i<cluster.markers.length;++i){if(cluster.markers[i]!=null){cluster.markers[i].inCluster=false;cluster.markers[i]=null}}
cluster.markers.length=0;cluster.markerCount=0;if(cluster==this.poppedUpCluster){this.map.closeInfoWindow()}
if(cluster.onMap){this.map.removeOverlay(cluster.marker);cluster.onMap=false}};Clusterer.MakeCaller=function(func,arg){return function(){func(arg)}};GMarker.prototype.setMap=function(map){this.map=map};GMarker.prototype.addedToMap=function(){this.map=null};GMarker.prototype.origOpenInfoWindow=GMarker.prototype.openInfoWindow;GMarker.prototype.openInfoWindow=function(node,opts){if(this.map!=null){return this.map.openInfoWindow(this.getPoint(),node,opts)}else{return this.origOpenInfoWindow(node,opts)}};GMarker.prototype.origOpenInfoWindowHtml=GMarker.prototype.openInfoWindowHtml;GMarker.prototype.openInfoWindowHtml=function(html,opts){if(this.map!=null){return this.map.openInfoWindowHtml(this.getPoint(),html,opts)}else{return this.origOpenInfoWindowHtml(html,opts)}};GMarker.prototype.origOpenInfoWindowTabs=GMarker.prototype.openInfoWindowTabs;GMarker.prototype.openInfoWindowTabs=function(tabNodes,opts){if(this.map!=null){return this.map.openInfoWindowTabs(this.getPoint(),tabNodes,opts)}else{return this.origOpenInfoWindowTabs(tabNodes,opts)}};GMarker.prototype.origOpenInfoWindowTabsHtml=GMarker.prototype.openInfoWindowTabsHtml;GMarker.prototype.openInfoWindowTabsHtml=function(tabHtmls,opts){if(this.map!=null){return this.map.openInfoWindowTabsHtml(this.getPoint(),tabHtmls,opts)}else{return this.origOpenInfoWindowTabsHtml(tabHtmls,opts)}};GMarker.prototype.origShowMapBlowup=GMarker.prototype.showMapBlowup;GMarker.prototype.showMapBlowup=function(opts){if(this.map!=null){return this.map.showMapBlowup(this.getPoint(),opts)}else{return this.origShowMapBlowup(opts)}};MessageBox=function(map,paren,myvar,mb){this.map=map;this.paren=paren;this.myvar=paren.myvar+"."+myvar;this.eraseMess=null;this.centerMe=null;this.mb=null;if(mb){this.mb=mb}
this.id=this.myvar+"_message"};MessageBox.prototype.hideMess=function(){this.mb.style.visiblity="hidden";this.mb.style.left="-1200px";this.mb.style.top="-1200px"};MessageBox.prototype.centerThis=function(){var c=this.map.getObjCenter();if(!this.mb){this.mb=$(this.id)}
if(this.centerMe){clearTimeout(this.centerMe)}
if(this.mb){var nw=this.mb.clientWidth;if(nw>this.map.getSize().width){nw=parseInt(2*this.map.getSize().width/3,10);this.mb.style.width=nw+"px";this.centerMe=setTimeout(this.myvar+".centerThis()",5);return}
this.mb.style.left=(c.x-(nw/2))+"px";this.mb.style.top=(c.y-20-(this.mb.clientHeight/2))+"px"}else{this.centerMe=setTimeout(this.myvar+".centerThis()",10)}};MessageBox.prototype.showMess=function(val,temp){val=unescape(val);if(this.eraseMess){clearTimeout(this.eraseMess)}
if(!this.mb){this.mb=$(this.id)}
if(this.mb){this.mb.innerHTML="<span>"+val+"</span>";if(temp){this.eraseMess=setTimeout(this.myvar+".hideMess();",temp)}
this.mb.style.left="-1200px";this.mb.style.top="-1200px";this.mb.style.width="";this.mb.style.height="";this.centerMe=setTimeout(this.myvar+".centerThis()",5);this.mb.style.visibility="visible"}else{var d=document.createElement("div");d.innerHTML=val;d.id=this.myvar+"_message";d.style.position="absolute";d.style.backgroundColor=this.style.backgroundColor||"silver";d.style.opacity=this.style.opacity||0.8;d.style.filter="alpha(opacity="+parseInt(d.style.opacity*100,10)+")";d.style.color=this.style.color||"black";d.style.padding=this.style.padding||"6px";d.style.borderWidth=this.style.borderWidth||"3px";d.style.borderColor=this.style.borderColor||"";d.style.backgroundImage=this.style.backgroundImage||"";d.style.borderStyle=this.style.borderStyle||"outset";d.style.visibility="visible";d.style.left="-1200px";d.style.top="-1200px";this.centerMe=setTimeout(this.myvar+".centerThis()",5);d.style.zIndex=1000;document.body.appendChild(d)}};GMap2.prototype.getObjCenter=function(){var obj=this.getContainer();var container=obj;var y=0;var x=0;if(obj.offsetParent){x=obj.offsetLeft;y=obj.offsetTop;obj=obj.offsetParent;while(obj){x+=obj.offsetLeft;y+=obj.offsetTop;obj=obj.offsetParent}
return new GPoint(x+parseInt(this.getSize().width,10)/2,y+parseInt(this.getSize().height,10)/2)}};GeoXml.prototype.loadJSONUrl=function(url,title,latlon,desc,idx){var that=this;GDownloadUrl(url,function(doc){that.parseJSON(doc,title,latlon,desc,idx)})};GeoXml.prototype.loadXMLUrl=function(url,title,latlon,desc,idx){var that=this;that.processing(GXml.parse(this.xmldoc),title,latlon,desc,idx);};GeoXml.prototype.upgradeLayer=function(n){var mt=this.map.getMapTypes();var found=false;for(var i=0;i<mt.length;i++){if(mt[i]==this.baseLayers[n]){found=true;this.map.removeMapType(this.baseLayers[n])}}
if(!found){this.map.addMapType(this.baseLayers[n])}};GeoXml.prototype.makeWMSTileLayer=function(getmapstring,on,title,opac,attr,grouptitle,wmsbounds){var that=this;getmapstring=getmapstring.replace("&amp;","&");var args=getmapstring.split("?");var baseurl=args[0]+"?";var version="1.1.0";var format="image/png";var styles="";var layers="";var queryable=false;var opacity=1;if(typeof opac!="undefined"){opacity=opac}
var bbox="-180,-90,180,90";var pairs=args[1].split("&");var sld="";var servicename="";var atlasname="";var gmcrs="";var epsg;for(var i=0;i<pairs.length;i++){var dstr=pairs[i];var duo=pairs[i].split("=");var dl=duo[0].toLowerCase();switch(dl){case"version":version=duo[1];break;case"bbox":bbox=duo[1];break;case"width":case"height":break;case"service":break;case"servicename":servicename=duo[1];break;case"atlasname":atlasname=duo[1];break;case"styles":styles=duo[1];break;case"layers":layers=duo[1];break;case"format":format=duo[1];break;case"opacity":opacity=parseFloat(duo[1]);break;case"crs":case"srs":epsg=duo[1];break;case"gmcrs":gmcrs=duo[1];break;case"queryable":queryable=duo[1];break;default:if(duo[0]){baseurl+="&"+pairs[i]}
break}}
if(gmcrs){epsg=gmcrs}
var bbn=bbox.split(",");var bb={w:parseFloat(bbn[0]),s:parseFloat(bbn[1]),e:parseFloat(bbn[2]),n:parseFloat(bbn[3])};var lon=(bb.n-bb.s);var z=0;var ex=180;while(ex>=lon){ex=ex/2;z++}
z--;if(z<1){z=1}
if(!attr){attr="Base Map from OGC WMS"}
var cr0=new GCopyright(1,new GLatLngBounds(new GLatLng(bb.s,bb.w),new GLatLng(bb.n,bb.e)),0,attr);var cc0=new GCopyrightCollection("");cc0.addCopyright(cr0);var twms=new GTileLayer(cc0,z,19);twms.s=bb.s;twms.n=bb.n;twms.e=bb.e;twms.w=bb.w;twms.myBaseURL=baseurl;if(servicename){twms.servicename=servicename}
if(atlasname){twms.atlasname=atlasname}
twms.publishdirectory=this.publishdirectory;twms.epsg=epsg;twms.getTileUrl=function(a,b,c){if(typeof(this.myStyles)=="undefined"){this.myStyles=""}
var lULP=new GPoint(a.x*256,(a.y+1)*256);var lLRP=new GPoint((a.x+1)*256,a.y*256);var lUL=G_NORMAL_MAP.getProjection().fromPixelToLatLng(lULP,b,c);var lLR=G_NORMAL_MAP.getProjection().fromPixelToLatLng(lLRP,b,c);var west=lUL.x;var east=lLR.x;var north=lUL.y;var south=lLR.y;var ge=east;var gw=west;var gs=south;var gn=north;if(gn<gs){gs=gn;gn=south}
if(this.epsg!="EPSG:4326"&&this.epsg!="CRS:84"&&this.epsg!="4326"){west=GeoXml.merc2Lon(west);north=GeoXml.merc2Lat(north);east=GeoXml.merc2Lon(east);south=GeoXml.merc2Lat(south)}
var w=Math.abs(east-west);var h=Math.abs(north-south);var s=h/w;h=Math.round((256*s)+0.5);w=256;var sud=south;if(north<south){south=north;north=sud}
if(gs>(this.n)||ge<(this.w)||gn<(this.s)||gw>(this.e)){var retstr=this.publishdirectory+"black.gif"}
var lBbox=west+","+south+","+east+","+north;var lSRS="EPSG:41001";if(typeof this.epsg!="undefined"||this.srs=="4326"){lSRS=this.epsg}
var lURL=this.myBaseURL;if(typeof this.myVersion=="undefined"){this.myVersion="1.1.1"}
var ver=parseFloat(this.myVersion);var arcims=/arcimsproxy/i;if(!this.myBaseURL.match(arcims)){lURL+="&SERVICE=WMS";if(this.myVersion!="1.0.0"){lURL+="&REQUEST=GetMap"}else{lURL+="&REQUEST=Map"}}
if(this.servicename){lURL+="?ServiceName="+this.servicename}
if(this.atlasname){lURL+="&AtlasName="+this.servicename}
lURL+="&VERSION="+this.myVersion;if(this.myLayers){lURL+="&LAYERS="+this.myLayers;lURL+="&STYLES="+this.myStyles}
if(this.mySLD){lURL+="&SLD="+this.mySLD}
lURL+="&FORMAT="+this.myFormat;lURL+="&BGCOLOR=0x000000";lURL+="&TRANSPARENT=TRUE";if(this.myVersion=="1.1.1"||ver<1.3){lURL+="&SRS="+lSRS}else{lURL+="&CRS="+lSRS}
lURL+="&WIDTH="+w;lURL+="&HEIGHT="+h;lURL+="&BBOX="+lBbox;this.requestCount++;return lURL};twms.myFormat=format;twms.myVersion=version;twms.myExtents=bbox;twms.queryable=queryable;twms.opacity=opacity;twms.getOpacity=function(){return this.opacity};if(sld){twms.mySLD=sld}else{twms.myLayers=layers;twms.myStyles=styles}
var ol=new GTileLayerOverlay(twms);ol.bounds=new GLatLngBounds();ol.bounds.extend(new GLatLng(bb.n,bb.e));ol.bounds.extend(new GLatLng(bb.s,bb.w));this.wmscount++;if(this.opts.doMapTypes){var twms2=new GTileLayer(cc0,z,19);twms2.s=bb.s;twms2.n=bb.n;twms2.e=bb.e;twms2.w=bb.w;twms2.myBaseURL=baseurl;twms2.servicename=servicename;twms2.publishdirectory=this.publishdirectory;twms2.getTileUrl=twms.getTileUrl;twms2.myFormat=twms.myFormat;twms2.myVersion=version;twms2.opacity=1;twms2.title=title;if(attr){twms2.attribution=attr}
twms2.getOpacity=function(){return this.opacity};if(sld){twms2.mySLD=sld}else{twms2.myLayers=layers;twms2.myStyles=styles}
twms2.epsg=epsg;var base=new GTileLayer(cc0,z,19);base.s=bb.s;base.n=bb.n;base.e=bb.e;base.w=bb.w;base.dir=this.publishdirectory;base.getTileUrl=function(){return(this.dir+"black.gif")};base.opacity=1;base.title=title;if(attr){base.attribution=attr}
base.getOpacity=function(){return this.opacity};var layer=[twms2,G_HYBRID_MAP.getTileLayers()[1]];var cmap=new GMapType(layer,G_HYBRID_MAP.getProjection(),""+title+"",G_HYBRID_MAP);cmap.bounds=new GLatLngBounds(new GLatLng(bb.s,bb.w),new GLatLng(bb.n,bb.e));if(grouptitle){cmap.grouptitle=grouptitle}
that.baseLayers.push(cmap);that.map.addMapType(cmap);return null}else{return ol}};GeoXml.SEMI_MAJOR_AXIS=6378137;GeoXml.ECCENTRICITY=0.08181919131087181;GeoXml.DEG2RAD=180/(Math.PI);GeoXml.merc2Lon=function(lon){return(lon*GeoXml.DEG2RAD)*GeoXml.SEMI_MAJOR_AXIS};GeoXml.merc2Lat=function(lat){var rad=lat*GeoXml.DEG2RAD;var sinrad=Math.sin(rad);return(GeoXml.SEMI_MAJOR_AXIS*Math.log(Math.tan((rad+Math.PI/2)/2)*Math.pow(((1-GeoXml.ECCENTRICITY*sinrad)/(1+GeoXml.ECCENTRICITY*sinrad)),(GeoXml.ECCENTRICITY/2))))};GeoXml.prototype.toggleLabels=function(on){if(!on){this.removeLabels()}else{this.addLabels()}};GeoXml.prototype.addLabels=function(){this.labels.onMap=true;this.map.addOverlay(this.labels)};GeoXml.prototype.removeLabels=function(){this.labels.onMap=false;this.map.removeOverlay(this.labels)};var useLegacyLocalLoad=true;GeoXml.prototype.DownloadURL=function(fpath,callback,title){if(!fpath){return}
var xmlDoc;var that=this;var cmlurl=fpath;if(!top.standalone&&this.proxy){cmlurl=this.proxy+"url="+escape(cmlurl)}
if(top.standalone||useLegacyLocalLoad){if(cmlurl.substring(2,3)==":"){xmlDoc=new ActiveXObject("Msxml2.DOMDocument.4.0");xmlDoc.validateOnParse=false;xmlDoc.async=true;xmlDoc.load(cmlurl);if(xmlDoc.parseError.errorCode!=0){var myErr=xmlDoc.parseError;alert("GeoXml file appears incorrect\n"+myErr.reason+" at line:"+myErr.line)}else{callback(xmlDoc.doc)}
return}}
var cmlreq;if(!cmlreq&&typeof XMLHttpRequest!="undefined"){cmlreq=new XMLHttpRequest()}else{if(typeof ActiveXObject!="undefined"){cmlreq=new ActiveXObject("Microsoft.XMLHTTP")}}
var here=cmlurl;if(cmlreq.overrideMimeType){cmlreq.overrideMimeType("text/xml")}
cmlreq.open("GET",here,true);cmlreq.onreadystatechange=function(){switch(cmlreq.readyState){case 4:that.mb.showMess(title+" received",2000);if(typeof ActiveXObject!="undefined"){xmlDoc=new ActiveXObject("Microsoft.XMLDOM");xmlDoc.async="false";var response=cmlreq.responseText;callback(response)}else{if(cmlreq.responseXML){that.mb.showMess(title+" received",2000);callback(cmlreq.responseText)}else{if(cmlreq.status==200){var resp=cmlreq.responseText;var sresp=resp.substring(0,400);var isXML=resp.substring(0,5);if(isXML=="<?xml"&&sresp.indexOf("kml")!=-1){that.mb.showMess(title+" response received",2000);callback(resp.responseText)}else{that.mb.showMess("File does not appear to be a valid GeoData"+resp,6000)}}}}
break;case 3:that.mb.showMess("Receiving "+title+"...");break;case 2:that.mb.showMess("Waiting for "+title,2000);break;case 1:that.mb.showMess("Sent request for "+title,2000);break}};try{cmlreq.send(null)}catch(err){if(cmlurl.substring(2,3)==":"&&!useLegacyLocalLoad){useLegacyLocalLoad=true;this.DownloadURL(cmlurl)}}};function mymouseover(i){GEvent.trigger(geoXml.overlayman.markers[i],'mouseover');var pointi=geoXml.overlayman.markers[i].getLatLng();var pointilng=pointi.lng();var pointc=geoXml.map.getCenter();var pointclng=pointc.lng();var bounds=geoXml.map.getBounds();var southWest=bounds.getSouthWest();var northEast=bounds.getNorthEast();var lngSpan=northEast.lng()-southWest.lng();var latSpan=northEast.lat()-southWest.lat();if(pointilng<southWest.lng()||pointilng<pointclng&&pointilng>southWest.lng()){var newc=new GLatLng(pointc.lat(),pointilng-lngSpan/6);geoXml.map.setCenter(newc);}}
$j(document).ready(function(){$j("div.showingooglemap").bind("mouseover",function(event){var mouse_over_element=$j(event.relatedTarget).parents("div.showingooglemap");if($j(mouse_over_element).length>0)
{if($j(mouse_over_element).attr("seq")==$j(this).attr("seq"))
{return;}}
$j(this).addClass("highlightrow");var i=$j(this).attr("seq");mymouseover(i);});$j("div.showingooglemap").bind("mouseout",function(){$j(this).removeClass("highlightrow");});});$j(document).ready(function(){$j("#nearbyclick").click(function(event){if($j("#id_menu_profile #submenu").is(":hidden")){$j("#id_menu_profile #submenu").fadeIn();}else{$j("#id_menu_profile #submenu").fadeOut();}
return false;});});function findValue(li){if(li==null)return alert("No match!");if(!!li.extra)var sValue=li.extra[0];else var sValue=li.selectValue;alert("The value you selected was: "+sValue);}
function selectItem(li){findValue(li);}
function lookupAjax(){var oSuggest=$j("#query")[0].autocompleter;oSuggest.findValue();return false;}
function lookupLocal(){var oSuggest=$j("#query")[0].autocompleter;oSuggest.findValue();return false;}
$j(document).ready(function(){$j("#query").autocomplete('/app/autosuggest/category',{minChars:2,matchContains:false,selectFirst:false,autoFill:false,scroll:true,scrollHeight:240,delay:20,width:300,formatItem:function(row,i,max){return row[2].replace(/.*<br>\.\.\./,'').replace(/ \(\d*\)$/,'');var retString="";if(row[1]=="2"){retString+="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";}
if(row[1]=="3"){retString+="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";}
if(row[1]=="4"){retString+="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";}
if(row[1]=="1"){retString+=row[2];}else{retString+=row[0];}
return retString;},formatResult:function(row){return row[0];}});$j("#location").autocomplete('/app/autosuggest/location',{width:190,onItemSelect:selectItem,onFindValue:findValue,autoFill:true});$j("#termsTitle").toggle(function(){$j("#termslist").show("slow");$j("#termsTitle").html("Hide Categories");},function(){$j("#termslist").hide("slow");$j("#termsTitle").html("View all Categories");});$j('div.read-more> div').hide();$j('div.read-more> a.more').click(function(){$j(this).next().slideToggle('fast');$j(this).toggleClass("less");if($j(this).html()=="less...&nbsp;&nbsp;&nbsp;"){$j(this).html("more...&nbsp;&nbsp;&nbsp;");}else{$j(this).html("less...&nbsp;&nbsp;&nbsp;");}});});