/* File: igv.obtain.js. Product: iGeo(tm) CE v1.1.0.2367 */
/* Copyright (c) 2009. nTerraCon, LLC. All rights reserved. */
/* Use of this software governed under various license agreements and Terms of Service. */
/* To learn more, contact nTerraCon, LLC. at info@nterracon.com. */
function Querystring(a){this.params={};if(a==null){a=location.search.substring(1,location.search.length)}if(a.length==0){return}a=a.replace(/\+/g," ");var c=a.split("&");for(var d=0;d<c.length;d++){var f=c[d].split("=");var b=decodeURIComponent(f[0]);var e=(f.length==2)?decodeURIComponent(f[1]):b;this.params[b]=e}}Querystring.prototype.get=function(a,b){var c=this.params[a];return(c!=null)?c:b};Querystring.prototype.contains=function(a){var b=this.params[a];return(b!=null)};var WGx=function(){return{MAX_MRU_FILES:16,MAX_DOCUMENTS_TO_EDIT:8,MAX_WIN_LIST_DOCUMENTS:10,FILE_DIALOG_COMBO_WIDTH:185,ICON_COMBO_WIDTH:160,MAX_GEOTAG_CHUNK_SIZE:1000,ALTITUDE_DEFAULT:1500,RANGE_DEFAULT:1500,ICON_OFFSETY_DEFAULT:-16,map:null,ViewType:{GoogleEarth:1,VirtualEarth:2,WorldWind:3},NodeType:{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},ICON_DEFAULT:"blue.png",IMAGE_WEST_PANEL_HEIGHT:220,IMAGE_EAST_PANEL_HEIGHT:175,db:{},app:{},data:{},JSON:{},menus:{},views:{},utiis:{},panels:{},stores:{},keymaps:{},handlers:{},toolbars:{},listeners:{},renderers:{},templates:{},components:{},geoservices:{},Cookies:{}}}();WGx.Cookies={set:function(c,e,a,h,d,g){var b=new Date();b.setTime(b.getTime());var f=new Date(b.getTime()+(a));document.cookie=c+"="+escape(e)+((a)?";expires="+f.toGMTString():"")+((h)?";path="+h:"")+((d)?";domain="+d:"")+((g)?";secure":"")},get:function(a){var f=document.cookie.split(";");var b="";var d="";var e="";var c=false;for(i=0;i<f.length;i++){b=f[i].split("=");d=b[0].replace(/^\s+|\s+$/g,"");if(d==a){c=true;if(b.length>1){e=unescape(b[1].replace(/^\s+|\s+$/g,""))}return e;break}b=null;d=""}if(!c){return null}},clear:function(a,d,c){var b=this.get(a);if(b!==null){document.cookie=a+"="+((d)?";path="+d:"")+((c)?";domain="+c:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT"}}};WGx.panels={fileDialog:{},main:{north:{},south:{},east:{},west:{},center:{}}};WGx.data={viewType:["Google Earth","Virtual Earth"],documents:[],documentFields:[{title:"title",mapping:"title"},{path:"path",mapping:"path"},{id:"id",mapping:"id"},{type:"type",mapping:"type"},{isnew:"isnew",mapping:"isnew"},{isdirty:"isdirty",mapping:"isdirty"},{istagged:"istagged",mapping:"istagged"},{isgeoenable:"isgeonabled",mapping:"isgeoenabled"},{content:"content",mapping:"content"},{contentID:"contentID",mapping:"contentID"}],geotagFields:[{name:"id"},{name:"name"},{name:"latitude"},{name:"longitude"},{name:"confidence"},{name:"numReferences"}],geotagInDocumentCols:[{id:"id",header:"Id",width:20,dataIndex:"id",hidden:true,sortable:false},{id:"name",header:"Name",width:100,dataIndex:"name",sortable:true},{id:"references",header:"#",width:20,dataIndex:"numReferences",sortable:false},{id:"latitude",renderer:function(a){return WGx.renderers.latitude(a)},header:"Latitude",width:57,dataIndex:"latitude",sortable:true},{id:"longitude",renderer:function(a){return WGx.renderers.longitude(a)},header:"Longitude",width:57,dataIndex:"longitude",sortable:true},{id:"confidence",header:"Confidence",width:20,dataIndex:"confidence",sortable:true}],geotagInDocument:{title:{normal:'<b><div style="height:16px; background: transparent url(images/icon-pos.png) left center no-repeat"><span style="margin:0 0 0 24px">Place Names In Document</span></div></b>',tagging:'<div style="height:16px; background: transparent url(images/geo-tagging.gif) left center no-repeat"><span style="margin:0 0 0 24px">Geo-Tagging Document...</span></div>'}},wgxDemo:{title:{normal:'<b><div style="height:16px; background: transparent url(images/logo_tiny.png) left center no-repeat"><span style="margin:0 0 0 36px"><em style="font-family:Times New Roman">i</em>Geo&trade; - Geo-enriching your world!</span></div></b>'}}};WGx.templates={data:{geotagDetail:['<center><b style="font:bold 16px Georgia,Times New Roman,serif">{name}</b></center><br />','<center><div style="position:relative; top:-12px; font:normal 10px arial,helvetica, sans serif">({latString} {lonString})<br />',"Created {created}<br />by {author}<br />","Occurences in document: {numReferences}</div></center>","{description}<br/>"],itemDetail:['<center><b style="font:bold 16px Georgia,Times New Roman,serif">{text}</b></center><br />',"{data}<br/>"],icons:['<tpl for=".">','<div class="thumb-wrap" id="{name}">','<div class="thumb"><img src="{url}" title="{name}"></div>','<div class="thumb" style="font: normal 8px arial,helvetic,sans serif"><center>{size}</center></div>',"</div>","</tpl>",'<div class="x-clear"></div>']},tpl:{geotagDetail:{},itemDetail:{}}};WGx.utils={getHostName:function(){var a=document.URL.split("/");return a[0]+"//"+a[2]+"/"},createMenuItemText:function(c,a){var d=c.indexOf("&");var b=c.substring(d+1,d+2);c=c.replace("&"+b,String.format("<u>{0}</u>",b));return String.format("<div class='ed-menu-item-wrapper'><div class='ed-menu-item'>{0}</div><div class='ed-menu-key'>{1}</div></div>",c,(a!==""&&a!==null&&a!==undefined)?"Ctrl+"+a:"")},getClassFields:function(b){var a=[];for(prop in b){a[a.length]=prop}return a}};WGx.app.init=function(b,a){if(typeof b==="undefined"){b=""}WGx.usn=b;Ext.QuickTips.init();Ext.BLANK_IMAGE_URL="images/default/s.gif";WGx.task=a;WGx.panels.main.north=WGx.utils.panels.create("north");WGx.panels.main.south=WGx.utils.panels.create("south");WGx.panels.main.west=WGx.utils.panels.create("west");WGx.panels.main.center=WGx.utils.panels.create("center");WGx.views.main=new Ext.Viewport({layout:"border",items:[WGx.panels.main.north,WGx.panels.main.south,WGx.panels.main.west,WGx.panels.main.center],listeners:WGx.listeners.mainWindow});WGx.views.main.show()};WGx.utils.createMenuItemText=function(c,a){var d=c.indexOf("&");var b=c.substring(d+1,d+2);c=c.replace("&"+b,String.format("<u>{0}</u>",b));return String.format("<div class='ed-menu-item-wrapper'><div class='ed-menu-item'>{0}</div><div class='ed-menu-key'>{1}</div></div>",c,(a!==""&&a!==null&&a!==undefined)?"Ctrl+"+a:"")};WGx.utils.gotoLogin=function(){var a=Ext.getCmp("tree-panel-obtain");var b=a.getSelectionModel().getSelectedNode();location.href="http://www.nterracon.com?option=com_user&view=login&igreturn=obtain:"+(b?b.id:"")};WGx.utils.getLogin=function(){WGx.map=WGx.Cookies.get("igeomap");if(WGx.map==null){WGx.Cookies.set("igeomap","GE",1000*3600*24*3600);WGx.map="GE"}var b;if(WGx.usn===""){b="<a href='javascript:WGx.utils.gotoLogin()'>Sign-in</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href='http://www.nterracon.com?option=com_user&task=register'>Register</a>&nbsp;&nbsp;"}else{b=String.format("<span style='font-weight:normal'>{0}</span>&nbsp;&nbsp;|&nbsp;&nbsp;<a href='http://www.nterracon.com/index.php?option=com_jumi&fileid=1&task=igeo&module=myaccount&opt=account'>My Account</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href='http://www.nterracon.com?option=com_user&view=login'>Sign-out</a>&nbsp;&nbsp;",WGx.usn)}var a=(WGx.map==="GE");return String.format('<div class="x-header" style="width:100%"><div style="font-weight:normal;float:left; width:33%"><b>Use:</b>&nbsp;&nbsp;<input type="radio" {1} onclick="WGx.handlers.radio(\'GE\');" id="wgx_ge_radio" name="map" />&nbsp;Google Earth&nbsp;&nbsp;<input onclick="WGx.handlers.radio(\'VE\');" type="radio" id="Wgx_ve_radio" {2} name="map" />&nbsp;Bing Maps</div><div style="float:left;"><center>&nbsp;</div><div style="float:left;width:33%"><center>Learn More</center></div><div style="text-align:right;float:right;width:33%">{0}</div></div>',b,a?"checked":"",a?"":"checked")};WGx.utils.panels={create:function(d){switch(d){case"north":return{region:"north",style:"height:28px",title:WGx.utils.getLogin()};break;case"south":var c="<a href='http://www.nterracon.com' target='_top'>HOME</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href='javascript:WGx.utils.popup(\"privacy\", \"nTerraCon Privacy Policy\")' target='_top'>PRIVACY POLICY</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href='javascript:WGx.utils.popup(\"tou\",\"iGeo(tm) Terms of Service\")' target='_top'>TERMS OF SERVICE</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href='javascript:mailto:admin@nterracton' target='_top'>CONTACT US</a>";return{region:"south",layout:"fit",style:"height:28px",title:String.format('<div class="x-footer" style="width:100%"><div style="float:left;width:33%"><center>&nbsp;</div><div style="float:left;width:33%"><center>{0}</center></div><div style="text-align:right;float:right;width:33%"></div></div>',c)};break;case"west":var a=new Ext.tree.TreePanel({id:"tree-panel-obtain",lines:false,root:{text:'<b><em style="font-family:Times New Roman">i</em>Geo&trade; - Creating a Sense of Place</b>',data:"",expanded:true,icon:"images/my_account.png",url:"html/obtain_home.htm",id:"root",children:[{text:"<b>iGeo&trade; Demonstrations</b>",id:"demo",expanded:false,data:"Click on any item from the list above. Each item will be automatically geo-tagged and geo-enriched. Once you see the green links appear on the document, you can click on any of those green links to fly to that location.",icon:"images/demo.png",url:"html/welcome.htm",children:[{id:"education",text:"<b>Education</b>",icon:"images/school.png",data:"Select an Item from the Education menu.",url:"html/education.htm",children:[{text:"Civil War Lesson",icon:"images/rebel_flag.png",demo:true,url:"civilwar",geotag:false,data:"Bring history alive by allowing your students to visit the places they read about. With WGx Professional you an edit each location, adding audio, video, live webcam footage, test questions and much more. Click on any of the books under the Publishing section to see examples of WGx used this way.",leaf:true},{text:"World War I",icon:"images/wwi.png",demo:true,url:"wwi",geotag:false,data:"Creating engaging lesson plans is as easy as cutting and pasting. This excellent article on the beginnings of World War I came from Project Gutenberg. As a separate item it might prove uninviting. Geo-enabling this article brings it to life for your students.",leaf:true},{text:"Civil Rights Movement",icon:"images/mlk.png",demo:true,url:"struggle",geotag:false,data:"Let your students live recent history. This basic timeline of the Civil Rights Movement allows students to fly to where these events actually took place. Imagine adding video of an MLK speech, or protestors being water-cannoned to one of the place mark icons. It's easy to do with WGx.",leaf:true}]},{id:"books",text:"<b>Book Publishing</b>",url:"html/publishing.htm",icon:"images/publishing.png",data:"Select an item from the Publishing menu.",children:[{text:"Whiskey Gulf",url:"http://www.myigeo.com/books/demos/demo.aspx?book=0",geotag:true,icon:"images/igeo_book.png",data:"<center><em>Whiskey Gulf</em>Clyde Ford<br />(NY, Vanguard: 2009)</center><br /><br />Like <em>Precious Cargo</em> (above) this book is set amongs the islands and waters of the Pacific Northwest. But unlike <em>Precious Cargo</em> the iGeo&trade; visual presentation allows you to see the book floating over the globe for an even more stunning visual effect.",leaf:true},{text:"nTerraCon Bookshelf",icon:"images/igeo_book.png",url:"http://www.myigeo.com/bookviewer/bookshelf.htm",geotag:true,data:' Experience geo-enriched versions of traditional and contemporary classics: <br /><ul style="list-style-position:outside; list-style-type:disc"><li><i>Roots </i>by Alex Haley</li><li><i>The Golden Bough </i>by James Frazer</li><li><i>The Legend of Sleepy Hollow </i>by Washington Irving</li><li><i>The Life and Times of George Washington </i>by John Marshall</li><li><i>The Odyssey </i>by Homer</li></ul>',leaf:true}]},{id:"media",text:"<b>News Media</b>",icon:"images/newspaper.png",url:"html/news_media.htm",data:"Select an item from the News Media menu.",children:[{text:"World News",icon:"images/news_article.png",data:'News happens somewhere. With iGeo&trade; readers of online news can fly-to the locations they read about. iGeo&trade; also allows space for advertisements, giving publishers the opportunity to generate revenue from using iGeo&trade; and targeting ads specifically to the areas that readers are flying-in to. <br /><br /><b>Note two of the context-sensitive features of iGeo&trade; in this demo:</b><br /><br />(1) iGeo&trade; only geo-tags items that are not already hyperlinked, so your hyperlinks stay intact.<br/><br />(2) iGeo&trade; tries to discern meaning from your document so "Portland" as a standalone word does not fly you to Portland, Oregon but to Portland, Maine since that\'s the Portland in this news item.',demo:true,url:"news1",geotag:false,leaf:true},{id:"news2",text:"News Article",icon:"images/news_article.png",demo:true,url:"news2",data:"Here's another news story that talks about places in the news that many people are unfamiliar with. Note how quickly a short news story is geo-tagged and geo-enriched without any work on the part of the content producer.",leaf:true}]},{id:"museum",text:"<b>Museums</b>",icon:"images/museum.png",url:"html/museum.htm",data:"Select an item from the Museum menu.",children:[{text:"Museum Collection",icon:"images/museum.png",data:"Geo-enriching an online collection on exhibition allows museum website visitors to visually locate and explore where cultures live, artifacts were found, and historic events took place.",demo:true,url:"museum",geotag:false,leaf:true}]},{id:"travelrec",text:"<b>Travel & Recreation</b>",icon:"images/travel_rec.png",url:"html/travel_rec.htm",data:"Select an item from the Travel & Recreation menu.",children:[{text:'Online Travel - "Look Before You Book"',icon:"images/travel.png",data:"Who hasn't made an online reservation for a flight, a hotel, or a car? iGeo&trade; gives travel businesses the opportunite to fly their customers to locations. It's a great way to increase interest and enthusiasm among customers and to keep customers coming back to your site. Notice the feature called \"Look Before You Book\" which demonstartes iGeo&trade;'s ability to geo-tag hyperlinks without disturbing the underlying target of the link. Hover your cursor over a city that's not already underlined in green to see this work.",demo:true,url:"travel",geotag:false,leaf:true},{id:"tourdefrance",text:"Tour de France (1985)",icon:"images/tourdefrance.png",demo:true,url:"tourdefrance1985",data:"Here's a geo-enriched web page covering the 1985 Tour de France. Make sure you click on the locations with video icons to see how iGeo&trade; enables you to present a rich multi-media experience to your site visitorse",leaf:true}]},{id:"wildlife",text:"<b>Wildlife Management</b>",icon:"http://www.myigeo.com/demos/images/wildlife_icon.png",url:"html/wildlife.htm",data:"Select an item from the Wildlife Management menu.",children:[{text:"Eagle Count",icon:"http://www.myigeo.com/demos/images/eagle.png",data:"Eagles, bears, wolves, spotted owl. Keep track of the animals you track with iGeo&trade;.",demo:true,url:"eagles",geotag:false,leaf:true}]},{id:"general",text:"<b>General Documents</b>",url:"html/general_documents.htm",icon:"images/documents.png",data:"Select an item from the General Documents menu",children:[{text:"Asset/Facilities Management",icon:"images/nuclear.png",demo:true,url:"nuclear",geotag:false,data:"If you have assets or facilities located over a geographical area, iGeo&trade; can help you manage them by geo-enabling any references. Note in this demo another context-sensitive feature of iGeo&trade;. Locations can be tagged not just by name but also in reference to a distance related to them.",geotag:false,leaf:true},{text:"Public Safety",icon:"images/justice.png",geotag:false,demo:true,url:"crime",data:"Any set of statistics that has a geographical basis can be enlivened with iGeo&trade;. Using iGeo&trade; Professional you can go several steps further than this geo-enriched report. For instance, you could plot a series of cities on the globe, and when a user clicked on the icon for a particular city, the crime statistics for thet city would pop-up.",leaf:true}]}]},{text:"<b>Get iGeo&trade;</b>",id:"getviewer",icon:"images/viewer.png",data:"<b>Community Edition</b> - Free for non-commercial use with some functional limitations.<br /><br /><b>Consumer Edition</b> - Fully functional version of iGeo.&trade;",url:"html/getigeo.htm",children:[{id:"community",text:"Community Edition <b>(Free)</b>",icon:"images/community_edition.png",url:"communityedition.htm",geotag:false,data:"Low traffic website? Want to experiment with iGeo&trade;? Then, the Community Edition is right for you. All you need to do is sign-in first, obtain an iGeo&trade; account key, and you're read to begin exploring a geo-enriched web.",leaf:true},{id:"consumer",text:"Consumer Edition",icon:"images/consumer_edition.png",url:"consumeredition.htm",geotag:false,data:"The iGeo&trade; Consumer Edition is nTerraCon's full-featured edition which allows you to create dynamic, interactive, rich multimedia geo-enriched web pages. Purchase an annual license fee for $99.",leaf:true},{id:"Premium",text:"Premium Edition",url:"Premiumedition.htm",geotag:false,icon:"images/announcement.png",data:"Add a geo-enriched editor to iGeo&trade; and you have nTerraCon's premium Premium Edition.",leaf:true},{id:"svp",text:"Signature Packs",icon:"images/signature_views.png",url:"signatureviews.aspx",geotag:false,data:"",children:[{id:"samples",text:"Signature View Samples",url:"svsamples.htm",geotag:false,icon:"images/demo.png",data:"See samples from the iGeo&trade; signature packs",leaf:true}]},{id:"adsense",text:"Goggle Adsense",icon:"images/google.png",url:"adsense.aspx",geotag:false,data:"",leaf:true}]}]},loader:new Ext.tree.TreeLoader({preloadChildren:true}),region:"center",width:200,autoScroll:true,listeners:WGx.listeners.panels.west.tree});a.getSelectionModel().on("selectionchange",function(f){var e=document.getElementById("wgx_ve_radio");WGx.handlers.tree.itemDetail(f);f.unselect(true)});var b={id:"treeDetail",title:"Details",region:"south",height:175,maxHeight:300,split:true,hideMode:"offsets",bodyStyle:{background:"#ffffff",padding:"7px",width:"200px",font:"normal 12px/1.25em arial, helvetica, sans serif"},autoScroll:true,html:"Select an item to see additional details"};WGx.templates.tpl.itemDetail=new Ext.Template(WGx.templates.data.itemDetail);return new Ext.Panel({region:"west",id:"west-panel",title:"NAVIGATION",margins:"2 0 5 5",split:true,border:false,width:240,minSize:240,maxSize:400,layout:"border",listeners:WGx.listeners.panels.west,items:[a,b]});break;case"center":return centerPanel=new Ext.Panel({hideMode:!Ext.isIE?"nosize":"display",region:"center",border:false,layout:"fit",margins:"0 0 0 0",title:'<em style="font-family:Times New Roman">i</em>Geo&trade; - Geo-enriching your world!',items:[{id:"frame-panel",xtype:"iframepanel",autoScroll:true,defaultSrc:"html/obtain_home.htm"}]});break;default:break}}};WGx.utils.popup=function(a,c){var b=new Ext.Window({title:c,id:a+"Win",closable:true,width:600,height:400,plain:true,modal:true,layout:"fit",items:[{id:a+"-frame-panel",xtype:"iframepanel",autoScroll:true,defaultSrc:String.format("html/{0}.htm",a)}]});b.show()};WGx.JSON=new (function(){var useHasOwn={}.hasOwnProperty?true:false;var pad=function(n){return n<10?"0"+n:n};var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};var fixDate=function(obj){for(property in obj){var type=typeof obj[property];switch(type){case"string":if(obj[property].indexOf("/Date(")>-1){var ms=obj[property].substring(6);ms=ms.substring(0,ms.indexOf(")/"));obj[property]=new Date(parseInt(ms))}break;case"object":fixDate(obj[property]);break}}};var encodeString=function(s){if(/["\\\x00-\x1f]/.test(s)){return'"'+s.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];if(c){return c}c=b.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'"'}return'"'+s+'"'};var encodeArray=function(o){var a=["["],b,i,l=o.length,v;for(i=0;i<l;i+=1){v=o[i];switch(typeof v){case"undefined":case"function":case"unknown":break;default:if(b){a.push(",")}a.push(v===null?"null":WGx.JSON.encode(v));b=true}}a.push("]");return a.join("")};var encodeDate=function(o){var ret='"\\/Date('+o.getTime()+')\\/"';return ret};this.encode=function(o){if(typeof o=="undefined"||o===null){return"null"}else{if(Ext.isArray(o)){return encodeArray(o)}else{if(Ext.isDate(o)){return encodeDate(o)}else{if(typeof o=="string"){return encodeString(o)}else{if(typeof o=="number"){return isFinite(o)?String(o):"null"}else{if(typeof o=="boolean"){return String(o)}else{var a=["{"],b,i,v;for(i in o){if(!useHasOwn||o.hasOwnProperty(i)){v=o[i];switch(typeof v){case"undefined":case"function":case"unknown":break;default:if(b){a.push(",")}a.push(this.encode(i),":",v===null?"null":this.encode(v));b=true}}}a.push("}");return a.join("")}}}}}}};this.decode=function(json){var obj=json;var type=typeof json;if(type=="string"){if(json.indexOf("{")==0){return eval("("+json+")")}else{return eval("('"+json+"')")}}fixDate(obj);return obj};this.fixObjectDates=function(obj){fixDate(obj)};this.convertDateToString=function(obj){return encodeDate(obj)}})();Ext.util.JSON.encode=WGx.JSON.encode;Ext.encode=WGx.JSON.encode;Ext.util.JSON.decode=WGx.JSON.decode;Ext.decode=WGx.JSON.decode;Ext.override(Ext.PagingToolbar,{getPageData:function(){var b=this.store.getTotalCount();var c,a;if(b==0){c="";a=0}else{c=Math.ceil((this.cursor+this.pageSize)/this.pageSize);a=b<this.pageSize?1:Math.ceil(b/this.pageSize)}return{total:b,activePage:c,pages:a}}});Ext.override(Ext.Panel,{setBody:function(a){this.body.dom.innerHTML=a},getBody:function(){return this.body.dom.innerHTML}});
