var lineNumCell=0,includeCell=1,urlCell=2,lastModCell=3,changeCell=4,priorityCell=5,rangeCell=6,startRow=0,mapRows=null;
function window_onload(){if(document.getElementById("tblMap")!=null){document.getElementById("spnEditButton").style.display="block";mapRows=document.getElementById("tblMap").getElementsByTagName("tr");for(var a=startRow;a<mapRows.length;a++)mapRows[a].cells[lastModCell].childNodes[0].onkeypress=document.all?Check_IE:Check_NS;var b=new Date;document.getElementById("ddLastModYear").selectedIndex=b.getFullYear()-2009;document.getElementById("ddLastModMonth").selectedIndex=b.getMonth();document.getElementById("ddLastModDay").selectedIndex=
b.getDate()-1;CheckSameDomain();var c=document.getElementById("ddFilterChange").options;b=document.getElementsByName("ddCh");for(var d=0;d<b.length;d++){for(a=0;a<c.length;a++)b[d].options[a]=new Option(c[a].text,c[a].value);b[d].selectedIndex=parseInt(b[d].title)}c=document.getElementById("ddFilterPriority").options;b=document.getElementsByName("ddPr");for(d=0;d<b.length;d++){for(a=0;a<c.length;a++)b[d].options[a]=new Option(c[a].text,c[a].value);a=Math.floor(10-parseFloat(b[d].title)*10);if(!isNaN(a)&&
a<10)b[d].selectedIndex=a}}}function GetCurrentDate(){var a=new Date,b=a.getMonth()+1;if(b<10)b="0"+b;var c=a.getDate();if(c<10)c="0"+c;return a.getFullYear()+"-"+b+"-"+c}
function GoogleSearch(){var a=document.getElementById("txtGoogle").value;window.open("http://www.google.com/custom?domains=www.Blocklayer.com%3Bwww.VisualTrig.com%3Bwww.TarrantIT.com&q="+a+"&sa=Search&client=pub-2954195544990546&forid=1&ie=ISO-8859-1&oe=ISO-8859-1&cof=GALT%3A%23008000%3BGL%3A1%3BDIV%3A%23336699%3BVLC%3A663399%3BAH%3Acenter%3BBGC%3AFFFFFF%3BLBGC%3A336699%3BALC%3A0000FF%3BLC%3A0000FF%3BT%3A000000%3BGFNT%3A0000FF%3BGIMP%3A0000FF%3BFORID%3A1%3B&hl=en")}
function Form1_onsubmit(){setTimeout("DisableButton()",10);return true}function DisableButton(){document.getElementById("btnGetMap").disabled=true}function GoMap(){CreateGoogleMap()}function CreateGoogleMap(){document.getElementById("btnGoMap").disabled=true;document.getElementById("btnGoMap").value="Calculating";document.body.style.cursor="progress";setTimeout("BuildMap()",10)}var mapString="";
function BuildMap(){var a="",b=document.getElementById("cbIncludeLastMod").checked,c=document.getElementById("cbIncludeChanged").checked,d=document.getElementById("cbIncludePriority").checked,e=0,f='<?xml version="1.0" encoding="UTF-8" ?>';f+='\n<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"';f+='\nxsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">';for(var i=/^[0-9]{4}-(((0[13578]|(10|12))-(0[1-9]|[1-2][0-9]|3[0-1]))|(02-(0[1-9]|[1-2][0-9]))|((0[469]|11)-(0[1-9]|[1-2][0-9]|30)))$/,
g=startRow;g<mapRows.length;g++)if(mapRows[g].cells[includeCell].firstChild.checked){e++;var h="\n\t<url>\n\t\t<loc>"+mapRows[g].cells[urlCell].innerHTML+"</loc>";if(b){a=mapRows[g].cells[lastModCell].childNodes[0].value;if(!a.match(i)){document.getElementById("btnGoMap").disabled=false;document.body.style.cursor="default";mapRows[g].cells[lastModCell].childNodes[0].select();mapRows[g].cells[lastModCell].childNodes[0].focus();alert("Date must be format yyyy-mm-dd");return}h+="\n\t\t<lastmod>"+a+"</lastmod>"}if(c)h+=
"\n\t\t<changefreq>"+mapRows[g].cells[changeCell].childNodes[0].value+"</changefreq>";if(d)h+="\n\t\t<priority>"+mapRows[g].cells[priorityCell].childNodes[0].value+"</priority>";h+="\n\t</url>";f+=h}f+="\n</urlset>";document.getElementById("gMap").value=f;document.getElementById("gMap").style.height=e*50+22+"px";document.getElementById("spnMap").style.display="block";document.getElementById("spnEdit").style.display="none";document.getElementById("spnMapButton").style.display="block";document.getElementById("spnEditButton").style.display=
"none";document.getElementById("btnGoMap").disabled=false;document.getElementById("btnGoMap").value="XML SiteMap";document.body.style.cursor="default";document.getElementById("spnInMap").innerHTML=e}
function GoHtmlMap(){var a=window.open("","SiteMap");a.document.open();a.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >\n');a.document.write("<html>\n<head>\n");a.document.write('<style type="text/css">  .lk { font-family: verdana; font-size: 16px; font-weight: bold; } .d {  font-family: verdana; font-size: 12px; } </style>');a.document.write('\n</head>\n<body class="d">');for(var b="",c=startRow;c<mapRows.length;c++)if(mapRows[c].cells[includeCell].firstChild.checked){b=
mapRows[c].cells[urlCell].innerHTML;a.document.write('\n\t<a class="lk" href="'+b+'">');a.document.write(b);a.document.write("</a><br>");a.document.write("\n\t<br><br>")}a.document.write("\n</body>\n</html>");a.document.close();a.focus()}function ShowEdit(){document.getElementById("spnMap").style.display="none";document.getElementById("spnEdit").style.display="block";document.getElementById("spnMapButton").style.display="none";document.getElementById("spnEditButton").style.display="block"}
function DefaultChange(a){if(a=="up")for(a=startRow;a<mapRows.length;a++)mapRows[a].cells[changeCell].firstChild.selectedIndex>0&&mapRows[a].cells[changeCell].firstChild.selectedIndex--;else for(a=startRow;a<mapRows.length;a++)mapRows[a].cells[changeCell].firstChild.selectedIndex<6&&mapRows[a].cells[changeCell].firstChild.selectedIndex++}
function DefaultPriority(a){if(a=="up")for(a=startRow;a<mapRows.length;a++)mapRows[a].cells[priorityCell].firstChild.selectedIndex>0&&mapRows[a].cells[priorityCell].firstChild.selectedIndex--;else for(a=startRow;a<mapRows.length;a++)mapRows[a].cells[priorityCell].firstChild.selectedIndex<10&&mapRows[a].cells[priorityCell].firstChild.selectedIndex++}
function DefaultLastMod(a,b){var c,d;if(a=="up")for(var e=startRow;e<mapRows.length;e++){d=mapRows[e].cells[lastModCell].firstChild;c=d.value.split("-");switch(b){case "year":d.value=GetPart(c[0],1)+"-"+c[1]+"-"+c[2];break;case "month":if(parseInt(c[1])<12)d.value=c[0]+"-"+GetPart(c[1],1)+"-"+c[2];break;case "day":if(parseInt(c[2])<31)d.value=c[0]+"-"+c[1]+"-"+GetPart(c[2],1);break}}else for(e=startRow;e<mapRows.length;e++){d=mapRows[e].cells[lastModCell].firstChild;c=d.value.split("-");switch(b){case "year":d.value=
GetPart(c[0],0)+"-"+c[1]+"-"+c[2];break;case "month":if(c[1]>1)d.value=c[0]+"-"+GetPart(c[1],-1)+"-"+c[2];break;case "day":if(c[2]>1)d.value=c[0]+"-"+c[1]+"-"+GetPart(c[2],0);break}}}function GetPart(a,b){if(a.substr(0,1)=="0")a=a.substr(1,1);var c=b==1?parseInt(a)+1:parseInt(a)-1;return c<10?"0"+c.toString():c.toString()}function GoLink(a){window.open(a.innerHTML)}
function SetPriorities(){var a=document.getElementById("ddFilterPriority").value,b=10-document.getElementById("ddFilterPriority").selectedIndex;if(b<6){alert("Start value must be 0.6 or above to allow cascade\n\rSet start value above 0.5 and values will\n\rcascade down\n\r\n\rTop value + bottom value should = 1.0\r\neg: if top = 0.8 then bottom = 0.2");document.getElementById("ddFilterPriority").focus()}else if(confirm("This action will cascade down\n\rpriority settings from top to bottom\n\r\n\rTop value + bottom value will = 1.0\r\n\r\nSo, with top = "+
a+"  bottom will = 0."+(10-b)+"\n\r\n\rContinue?")){a=0;for(var c=startRow;c<mapRows.length;c++)mapRows[c].cells[includeCell].firstChild.checked&&a++;var d=b;for(c=startRow;c<mapRows.length;c++)if(mapRows[c].cells[includeCell].firstChild.checked){d-=(b-(10-b-1))/a;mapRows[c].cells[priorityCell].firstChild.selectedIndex=10-Math.ceil(d);mapRows[c].cells[priorityCell].firstChild.style.backgroundColor=""}else{mapRows[c].cells[priorityCell].firstChild.selectedIndex=5;mapRows[c].cells[priorityCell].firstChild.backgroundColor=
"darkorange"}}}function ResetPriorities(){if(confirm("Reset all Priorities to 0.5"))for(var a=startRow;a<mapRows.length;a++)mapRows[a].cells[priorityCell].firstChild.selectedIndex=5}function CascadeHelp(){alert("Set all priorities from the first setting down\n\rwith equal increments\n\rFirst setting must be above 0.5\n\rHighest + lowest priority will be = 1.0\n\reg: if first = 0.8 last will = 0.2\n\r\n\rSet first priority and click Casc")}
function Check_IE(){if(event.srcElement.value.length>10)return false;var a=event.keyCode;if(a>45&&a<58||a==45)return true;return false}function Check_NS(a){var b=a.which;if(b>45&&b<58||b==0||b==8||b==45)return true;a.preventDefault()}var hiding=false;
function ToggleUnchecked(a){for(var b=0,c=startRow;c<mapRows.length;c++)if(!mapRows[c].cells[includeCell].firstChild.checked){mapRows[c].style.display=a;b++}if(a=="block"){document.getElementById("hlShowUnchecked").innerHTML="";hiding=false}else{document.getElementById("hlShowUnchecked").innerHTML="Show "+b+" Unchecked";hiding=true}}
function SetLowerCase(){if(confirm("Set all entries to lower case\n\r\n\rContinue?")){document.body.style.cursor="progress";for(var a=0,b=startRow;b<mapRows.length;b++)if(mapRows[b].cells[urlCell].innerHTML!=mapRows[b].cells[urlCell].innerHTML.toLowerCase()){mapRows[b].cells[urlCell].innerHTML=mapRows[b].cells[urlCell].innerHTML.toLowerCase();a++}document.body.style.cursor="default";a>0?alert(a+" entries set to Lower Case"):alert("All entries are Lower Case")}}
function ClearFind(){for(var a=startRow;a<mapRows.length;a++){mapRows[a].cells[urlCell].style.backgroundColor="";mapRows[a].cells[lastModCell].childNodes[0].style.backgroundColor="";mapRows[a].cells[changeCell].childNodes[0].style.backgroundColor="";mapRows[a].cells[priorityCell].childNodes[0].style.backgroundColor=""}ClearRange()}
function FilterFind(){var a=document.getElementById("txtFilter").value.toLowerCase();if(a.length==0)FilterHelp();else{document.body.style.cursor="progress";for(var b=0,c=startRow;c<mapRows.length;c++)if(mapRows[c].cells[urlCell].innerHTML.toLowerCase().indexOf(a)>-1){mapRows[c].cells[urlCell].style.backgroundColor="yellow";if(hiding)mapRows[c].style.display="block";b++}else mapRows[c].cells[urlCell].style.backgroundColor="";document.body.style.cursor="default";alert(b+" entries containing "+a+" found")}}
var filterring=false;
function FilterOut(a){if(!filterring){var b=0;if(document.getElementById("cbEditRange").checked){document.body.style.cursor="progress";filterring=true;for(d=startRow;d<mapRows.length;d++)if(mapRows[d].cells[priorityCell].style.backgroundColor=="yellow"){if(mapRows[d].cells[includeCell].firstChild.checked=a){mapRows[d].cells[includeCell].style.backgroundColor="";if(hiding)mapRows[d].style.display="block"}else mapRows[d].cells[includeCell].style.backgroundColor="orange";b++}a?alert(b+" selected entries are CHECKED"):
alert(b+" selected entries are UNCHECKED")}else{var c=document.getElementById("txtFilter").value.toLowerCase();if(c.length==0){FilterHelp();return}document.body.style.cursor="progress";filterring=true;for(var d=startRow;d<mapRows.length;d++)if(mapRows[d].cells[urlCell].innerHTML.toLowerCase().indexOf(c)>-1){if(mapRows[d].cells[includeCell].firstChild.checked=a){mapRows[d].cells[includeCell].style.backgroundColor="";if(hiding)mapRows[d].style.display="block"}else mapRows[d].cells[includeCell].style.backgroundColor=
"orange";b++}a?alert(b+" entries containing "+c+" are CHECKED"):alert(b+" entries containing "+c+" are UNCHECKED")}document.body.style.cursor="default";filterring=false}}
function FilterHelp(){document.getElementById("txtFilter").style.backgroundColor="red";alert("Enter search terms in the Find textbox and click Find to highlight all Urls containing this word\n\rClick Check or UnCheck to include or exclude all page URLs containing these terms\n\rClick Clear to clear highlights\n\r\n\rSet LastMod, ChangeFrequency and Priority settings in the same way\n\r\n\rTo filter on keywords in initial search\n\rclick 'Show Filters and Settings'\n\rand add comma separated list of filter terms");document.getElementById("txtFilter").style.backgroundColor=
""}
function FilterChange(){if(!filterring){filterring=true;var a=0,b=document.getElementById("ddFilterChange").selectedIndex;if(document.getElementById("cbEditRange").checked){document.body.style.cursor="progress";for(d=startRow;d<mapRows.length;d++)if(mapRows[d].cells[lastModCell].style.backgroundColor=="yellow"){mapRows[d].cells[changeCell].firstChild.selectedIndex=b;mapRows[d].cells[changeCell].firstChild.style.backgroundColor="Dodgerblue";a++}else mapRows[d].cells[changeCell].firstChild.style.backgroundColor="";
alert(a+" selected entries set to Change Frequency "+document.getElementById("ddFilterChange").value)}else{var c=document.getElementById("txtFilter").value.toLowerCase();if(c.length==0){FilterChangeHelp();filterring=false;return}document.body.style.cursor="progress";for(var d=startRow;d<mapRows.length;d++)if(mapRows[d].cells[urlCell].innerHTML.toLowerCase().indexOf(c)>-1){mapRows[d].cells[changeCell].firstChild.selectedIndex=b;mapRows[d].cells[changeCell].firstChild.style.backgroundColor="Dodgerblue";
a++}else mapRows[d].cells[changeCell].firstChild.style.backgroundColor="";alert(a+" entries containing "+c+" set to Change Frequency "+document.getElementById("ddFilterChange").value)}document.body.style.cursor="default";filterring=false}}
function FilterLastMod(){if(!filterring){filterring=true;var a=0,b=document.getElementById("ddLastModYear").value+"-"+document.getElementById("ddLastModMonth").value+"-"+document.getElementById("ddLastModDay").value;if(document.getElementById("cbEditRange").checked){document.body.style.cursor="progress";for(d=startRow;d<mapRows.length;d++)if(mapRows[d].cells[lastModCell].style.backgroundColor=="yellow"){mapRows[d].cells[lastModCell].firstChild.value=b;mapRows[d].cells[lastModCell].firstChild.style.backgroundColor=
"Chartreuse";a++}else mapRows[d].cells[lastModCell].firstChild.style.backgroundColor="";alert(a+" selected entries set to LastMod "+b)}else{var c=document.getElementById("txtFilter").value.toLowerCase();if(c.length==0){FilterLastModHelp();filterring=false;return}document.body.style.cursor="progress";for(var d=startRow;d<mapRows.length;d++)if(mapRows[d].cells[urlCell].innerHTML.toLowerCase().indexOf(c)>-1){mapRows[d].cells[lastModCell].firstChild.value=b;mapRows[d].cells[lastModCell].firstChild.style.backgroundColor=
"Chartreuse";a++}else mapRows[d].cells[lastModCell].firstChild.style.backgroundColor="";alert(a+" entries containing "+c+" set to LastMod "+b)}document.body.style.cursor="default";filterring=false}}
function FilterLastModHelp(){document.getElementById("txtFilter").style.backgroundColor="red";alert("Enter search terms in the Find textbox\n\rSelect Year, Month and Date\n\rfrom dropdowns and click Go\n\r\n\rAll URL entries containing these terms will be\nset to selected LastMod date");document.getElementById("txtFilter").style.backgroundColor=""}
function FilterChangeHelp(){document.getElementById("txtFilter").style.backgroundColor="red";alert("Enter search terms in the Find textbox and click Go\n\r\n\rAll URL entries containing these terms will be\nset to selected Change Frequency");document.getElementById("txtFilter").style.backgroundColor=""}
function FilterPriority(){if(!filterring){filterring=true;var a=0,b=document.getElementById("ddFilterPriority").selectedIndex;if(document.getElementById("cbEditRange").checked){document.body.style.cursor="progress";for(d=startRow;d<mapRows.length;d++)if(mapRows[d].cells[lastModCell].style.backgroundColor=="yellow"){mapRows[d].cells[priorityCell].firstChild.selectedIndex=b;mapRows[d].cells[priorityCell].firstChild.style.backgroundColor="Orange";a++}else mapRows[d].cells[priorityCell].firstChild.style.backgroundColor=
"";alert(a+" selected entries set to Priority "+document.getElementById("ddFilterPriority").value)}else{var c=document.getElementById("txtFilter").value.toLowerCase();if(c.length==0){FilterPriorityHelp();filterring=false;return}document.body.style.cursor="progress";for(var d=startRow;d<mapRows.length;d++)if(mapRows[d].cells[urlCell].innerHTML.toLowerCase().indexOf(c)>-1){mapRows[d].cells[priorityCell].firstChild.selectedIndex=b;mapRows[d].cells[priorityCell].firstChild.style.backgroundColor="Orange";
a++}else mapRows[d].cells[priorityCell].firstChild.style.backgroundColor="";alert(a+" entries containing "+c+" set to Priority "+document.getElementById("ddFilterPriority").value)}document.body.style.cursor="default";filterring=false}}
function FilterPriorityHelp(){document.getElementById("txtFilter").style.backgroundColor="red";alert("Enter search terms in the Find textbox and click Go\n\r\n\rAll URL entries containing these terms will be\nset to selected Priority");document.getElementById("txtFilter").style.backgroundColor=""}function MoveHelp(){alert("Click a URL below to highlight\n\rand mouse over arrow keys to\n\rmove entry up or down in list")}var lastModVisible=true;
function ToggleLastMod(){var a=lastModVisible?"none":"block";document.body.style.cursor="progress";for(var b=startRow;b<mapRows.length;b++)mapRows[b].cells[lastModCell].firstChild.style.display=a;lastModVisible=!lastModVisible;document.body.style.cursor="default"}var changeVisible=true;
function ToggleChange(){document.body.style.cursor="progress";for(var a=changeVisible?"none":"block",b=startRow;b<mapRows.length;b++)mapRows[b].cells[changeCell].firstChild.style.display=a;changeVisible=!changeVisible;document.body.style.cursor="default"}var priorityVisible=true;
function TogglePriority(){document.body.style.cursor="progress";for(var a=priorityVisible?"none":"block",b=startRow;b<mapRows.length;b++)mapRows[b].cells[priorityCell].firstChild.style.display=a;priorityVisible=!priorityVisible;document.body.style.cursor="default"}var moveTimer=null,tempVal="",tempCh=true,tempIndex=0,moveTo=0,moveInc=1;
function MoveRow(a){if(!(rowToMove<startRow||rowToMove>mapRows.length)){if(a==0){moveInc=1;moveTo=rowToMove-1}else{moveInc=-1;moveTo=rowToMove+1}moveTimer=setInterval("MoveUp2()",2)}}
function MoveUp2(){if(moveInc==1&&rowToMove>startRow||moveInc==-1&&rowToMove<mapRows.length-1){mapRows[rowToMove].cells[urlCell].style.backgroundColor=mapRows[moveTo].cells[urlCell].style.backgroundColor;mapRows[moveTo].cells[urlCell].style.backgroundColor="lawngreen";tempCh=mapRows[moveTo].cells[includeCell].firstChild.checked;mapRows[moveTo].cells[includeCell].firstChild.checked=mapRows[rowToMove].cells[includeCell].firstChild.checked;mapRows[rowToMove].cells[includeCell].firstChild.checked=tempCh;
tempVal=mapRows[moveTo].cells[urlCell].innerHTML;mapRows[moveTo].cells[urlCell].innerHTML=mapRows[rowToMove].cells[urlCell].innerHTML;mapRows[rowToMove].cells[urlCell].innerHTML=tempVal;tempVal=mapRows[moveTo].cells[lastModCell].firstChild.value;mapRows[moveTo].cells[lastModCell].firstChild.value=mapRows[rowToMove].cells[lastModCell].firstChild.value;mapRows[rowToMove].cells[lastModCell].firstChild.value=tempVal;tempIndex=mapRows[moveTo].cells[changeCell].firstChild.selectedIndex;mapRows[moveTo].cells[changeCell].firstChild.selectedIndex=
mapRows[rowToMove].cells[changeCell].firstChild.selectedIndex;mapRows[rowToMove].cells[changeCell].firstChild.selectedIndex=tempIndex;tempIndex=mapRows[moveTo].cells[priorityCell].firstChild.selectedIndex;mapRows[moveTo].cells[priorityCell].firstChild.selectedIndex=mapRows[rowToMove].cells[priorityCell].firstChild.selectedIndex;mapRows[rowToMove].cells[priorityCell].firstChild.selectedIndex=tempIndex;rowToMove-=moveInc;moveTo=rowToMove-moveInc;lastRowMoved=rowToMove}else StopMoveRow()}
function StopMoveRow(){clearInterval(moveTimer)}var rowToMove=-1,lastRowMoved=0;function SelectForMove(a){a=document.all?a.parentElement.rowIndex:a.parentNode.rowIndex;if(lastRowMoved>-1)mapRows[lastRowMoved].cells[urlCell].style.backgroundColor="";rowToMove=a+startRow;mapRows[rowToMove].cells[urlCell].style.backgroundColor="lawngreen";lastRowMoved=rowToMove}
function EditUrl(){if(rowToMove==-1)alert("Click Entry to highlight first");else{var a;a=mapRows[0].cells[urlCell].innerHTML;var b,c;if(a.indexOf("www.")>-1){c=a.substr(a.indexOf(".")+1);if(c.indexOf("/")>-1)c=c.substr(0,c.indexOf("/"));b=a.substr(0,a.indexOf(".")+1)+c}else{c=a.substr(a.indexOf("//")+2);if(c.indexOf("/")>-1)c=c.substr(0,c.indexOf("/"));b=a.substr(0,a.indexOf("/")+2)+c}if(a=prompt("Edit URL and click OK, or Cancel to exit",mapRows[rowToMove].cells[urlCell].innerHTML)){c=false;if(a.indexOf(b)!=
0){if(!confirm("The URL you enterred\n\r"+a+"\n\rdoes not appear to be under the same domain as the first entry\n\r"+b+"\n\rGoogle will most likely reject the map with this entry\n\r\n\rContinue?"))return;c=true}if(a.substr(a.length-1)=="/")a=a.substr(0,a.length-1);b=a.toLowerCase();for(var d=0;d<mapRows.length;d++)if(mapRows[d].cells[urlCell].innerHTML.toLowerCase()==b){mapRows[d].cells[urlCell].style.backgroundColor="red";mapRows[d].cells[changeCell].firstChild.focus();alert("The URL you enterred\n\r"+
a+"\n\ris already in the map");mapRows[d].cells[urlCell].style.backgroundColor="";return}mapRows[rowToMove].cells[urlCell].innerHTML=a;if(c)mapRows[rowToMove].cells[urlCell].style.backgroundColor="red"}}}
function CheckSameDomain(){var a=mapRows[0].cells[urlCell].innerHTML;if(a.substr(a.length-1)=="/")a=a.substr(0,a.length-1);var b;if(a.indexOf("www.")>-1){b=a.substr(a.indexOf(".")+1);if(b.indexOf("/")>-1)b=b.substr(0,b.indexOf("/"));b=a.substr(0,a.indexOf(".")+1)+b}else{b=a.substr(a.indexOf("//")+2);if(b.indexOf("/")>-1)b=b.substr(0,b.indexOf("/"));b=a.substr(0,a.indexOf("/")+2)+b}var c=0;b=b.toLowerCase();for(var d=0;d<mapRows.length;d++)if(mapRows[d].cells[urlCell].innerHTML.indexOf(b)!=0){mapRows[d].cells[urlCell].style.backgroundColor=
"red";c++;mapRows[d].cells[lastModCell].firstChild.focus();if(c>30){alert("To many errors\nDomain check cancelled");break}}c>0&&alert(c+" Entries (marked red) do not\n\rappear to be under the same domain\n\r"+b+"\n\ras first entry\n\r"+a)}
function AddEntry(){var a;a=mapRows[0].cells[urlCell].innerHTML;var b,c;if(a.indexOf("www.")>-1){c=a.substr(a.indexOf(".")+1);if(c.indexOf("/")>-1)c=c.substr(0,c.indexOf("/"));b=a.substr(0,a.indexOf(".")+1)+c}else{c=a.substr(a.indexOf("//")+2);if(c.indexOf("/")>-1)c=c.substr(0,c.indexOf("/"));b=a.substr(0,a.indexOf("/")+2)+c}if(a=prompt("Enter new URL",b)){c=false;if(a.indexOf(b)!=0){if(!confirm("The URL you enterred\n\r"+a+"\n\rdoes not appear to be under the same domain as the first entry\n\r"+
b+"\n\rGoogle will most likely reject the map with this entry\n\r\n\rContinue?"))return;c=true}if(a.substr(a.length-1)=="/")a=a.substr(0,a.length-1);b=a.toLowerCase();for(var d=0;d<mapRows.length;d++)if(mapRows[d].cells[urlCell].innerHTML.toLowerCase()==b){mapRows[d].cells[urlCell].style.backgroundColor="red";mapRows[d].cells[lastModCell].firstChild.focus();alert("The URL you enterred\n\r"+a+"\n\ris already in the map");mapRows[d].cells[urlCell].style.backgroundColor="";return}b=document.getElementById("tblMap");
b=b.insertRow(b.rows.length);var e=document.createElement("input");e.setAttribute("type","checkbox");d=mapRows[0].cells[0].cloneNode(true);d.innerHTML=mapRows.length;b.appendChild(d);d=b.insertCell(b.cells.length);d.appendChild(e);e.checked=!c;d=mapRows[0].cells[urlCell].cloneNode(true);d.innerHTML=a;d.style.backgroundColor=c?"red":"lawngreen";b.appendChild(d);a=mapRows[0].cells[lastModCell].firstChild.cloneNode(true);a.setAttribute("value",GetCurrentDate());d=b.insertCell(b.cells.length);d.setAttribute("width",
"90");d.setAttribute("align","center");d.appendChild(a);a=document.getElementById("ddFilterChange").cloneNode(true);a.selectedIndex=3;d=b.insertCell(b.cells.length);d.setAttribute("width","90");d.setAttribute("align","center");d.appendChild(a);a=document.getElementById("ddFilterPriority").cloneNode(true);a.selectedIndex=5;d=b.insertCell(b.cells.length);d.setAttribute("width","90");d.setAttribute("align","center");d.appendChild(a);mapRows=document.getElementById("tblMap").getElementsByTagName("tr");
mapRows[mapRows.length-1].cells[lastModCell].childNodes[0].focus();setTimeout("ClearNew(mapRows.length-1)",2E3)}}function ClearNew(a){mapRows[a].cells[urlCell].style.backgroundColor=""}document.onkeydown=HandleDown;function HandleDown(a){if(a=a?a:event?event:null)switch(a.keyCode){case 37:moveInc=-1;moveTo=rowToMove+1;MoveUp2();break;case 39:moveInc=1;moveTo=rowToMove-1;MoveUp2();break}}
function CheckAllResponses(){document.body.style.cursor="progress";if(confirm("Make a request to each CHECKED\n\rpage and report the response\n\rThis may take a while\n\r\n\rContinue ?")){var a,b;b="";for(var c=0,d=0,e=0;e<mapRows.length;e++)if(mapRows[e].cells[includeCell].firstChild.checked){b=mapRows[e].cells[urlCell].innerHTML;if(window.XMLHttpRequest){a=new XMLHttpRequest;a.open("GET",b,false);a.send(null)}else if(window.ActiveXObject)if(a=new ActiveXObject("Microsoft.XMLHTTP")){a.open("GET",
b,false);a.send()}if(a){if(a.status==200){b="images/OK.gif";d++}else{b="images/Error.gif";mapRows[e].cells[urlCell].style.backgroundColor="red";mapRows[e].cells[includeCell].firstChild.checked=false;mapRows[e].cells[lastModCell].firstChild.focus();c++}var f=document.createElement("img");f.setAttribute("src",b);f.setAttribute("border","0");f.setAttribute("alt",a.status);mapRows[e].cells[rangeCell].appendChild(f)}}document.body.style.cursor="default";alert(d+" pages reported staus 200 = OK\n\r\n\r"+
c+" pages reported errors")}else document.body.style.cursor="default"}
function CheckDuplicates(){var a=mapRows.length;if(a>200)if(!confirm("This may take approx "+Math.floor(a/18)+" seconds\n\nContinue?"))return;document.body.style.cursor="progress";var b=0,c=0;for(a=mapRows.length;c<a;){for(var d=c+1;d<a;d++)if(mapRows[c].cells[urlCell].innerHTML==mapRows[d].cells[urlCell].innerHTML){mapRows[d].cells[urlCell].style.backgroundColor="lightblue";mapRows[d].cells[includeCell].firstChild.checked=false;mapRows[d].cells[lastModCell].firstChild.focus();b++}c++}document.body.style.cursor=
"default";b>0?alert(b+" duplicate pages found and unchecked"):alert("No duplicates found")}function ShowLink(){document.getElementById("divLink").style.left="140px"}function HideLink(){document.getElementById("divLink").style.left="-1000px"}
function RangeEditHelp(){document.getElementById("cbEditRange").style.backgroundColor="red";document.getElementById("cbEditRange").checked=true;CbEditRange_onclick(document.getElementById("cbEditRange"));alert("Check the box to enable editing selections\n\r\n\rIn yellow line below, click start and end of selections to edit\nSet desired LastMod, Change or Priority dropdowns and click Go");document.getElementById("cbEditRange").style.backgroundColor=""}var startMark=-1,endMark=-1;
function Mark(a){if(document.getElementById("cbEditRange").checked){a--;if(startMark==-1){startMark=a;mapRows[a].cells[rangeCell].style.backgroundColor="lawngreen"}else{endMark=a+1;for(a=startMark;a<endMark;a++){mapRows[a].cells[rangeCell].style.backgroundColor="yellow";mapRows[a].cells[priorityCell].style.backgroundColor="yellow";mapRows[a].cells[changeCell].style.backgroundColor="yellow";mapRows[a].cells[lastModCell].style.backgroundColor="yellow";mapRows[a].cells[urlCell].style.backgroundColor=
"yellow";mapRows[a].cells[rangeCell].innerHTML="*"}startMark=-1}}}function ClearRange(){for(var a=0;a<mapRows.length;a++){mapRows[a].cells[priorityCell].style.backgroundColor="";mapRows[a].cells[changeCell].style.backgroundColor="";mapRows[a].cells[lastModCell].style.backgroundColor="";mapRows[a].cells[urlCell].style.backgroundColor="";mapRows[a].cells[rangeCell].innerHTML=""}}
function CbEditRange_onclick(a){for(var b=a.checked?"Yellow":"",c=0;c<mapRows.length;c++)mapRows[c].cells[rangeCell].style.backgroundColor=b;a.checked||ClearRange()}
function StartDemo(){var a=mapRows.length;if(a<5)alert("This map is not large enough\nto properly demonstrate editing");else{var b=mapRows[2].cells[urlCell].innerHTML;b=b.substr(b.lastIndexOf("/")+1,3);document.getElementById("txtFilter").value=b;document.getElementById("txtFilter").style.backgroundColor="red";if(confirm("To edit settings for pages based on a text fragment\nor word in the URL enter the text fragment\nin the Find box\nClick Find to highlite these entries\nClick Uncheck to exclude\nClick Check to include\n\n Continue?")){FilterFind();if(confirm("Click uncheck to uncheck and exclude all\nentries containing this text\n\nClick Check to include\n\nContinue?")){FilterOut(false);
if(confirm("To clear highlights\nclick Clear\n\nContinue?")){ClearFind();FilterOut(true);if(confirm("To edit LastMod, ChangeFrequency or Priority\nfor entries containing this text select\nfrom appropriate top dropdowns and click Go\n\nContinue?")){document.getElementById("ddLastModMonth").selectedIndex=Math.floor(Math.random()*11);document.getElementById("ddLastModMonth").style.backgroundColor="red";document.getElementById("ddLastModDay").selectedIndex=Math.floor(Math.random()*27);document.getElementById("ddLastModDay").style.backgroundColor=
"red";FilterLastMod();document.getElementById("ddFilterChange").selectedIndex=Math.floor(Math.random()*3)+3;document.getElementById("ddFilterChange").style.backgroundColor="red";FilterChange();document.getElementById("ddFilterPriority").selectedIndex=Math.floor(Math.random()*5);document.getElementById("ddFilterPriority").style.backgroundColor="red";FilterPriority();if(confirm("To select independent ranges to edit\ncheck the box under Range at right and click\nin yellow column at start and\nend of ranges to select\n\nSelect LastMod, ChangeFrequency and priority settings\nas before, and click Go to edit\n\nContinue?")){document.getElementById("cbEditRange").checked=
true;CbEditRange_onclick(document.getElementById("cbEditRange"));a=a<20?a-2:Math.floor(Math.random()*12)+3;Mark(2);Mark(a);document.getElementById("ddLastModMonth").selectedIndex=Math.floor(Math.random()*11);document.getElementById("ddLastModDay").selectedIndex=Math.floor(Math.random()*27);FilterLastMod();document.getElementById("ddFilterChange").selectedIndex=Math.floor(Math.random()*3)+3;FilterChange();document.getElementById("ddFilterPriority").selectedIndex=Math.floor(Math.random()*5);FilterPriority();
if(confirm("To clear highlights click Clear\n\nContinue?")){ClearFind();document.getElementById("cbEditRange").checked=false;CbEditRange_onclick(document.getElementById("cbEditRange"))}}}}}}ClearDemo()}}
function ClearDemo(){document.getElementById("txtFilter").value="";document.getElementById("txtFilter").style.backgroundColor="";document.getElementById("ddLastModMonth").style.backgroundColor="";document.getElementById("ddLastModDay").style.backgroundColor="";document.getElementById("ddFilterChange").style.backgroundColor="";document.getElementById("ddFilterPriority").style.backgroundColor="";document.getElementById("cbEditRange").checked=false;CbEditRange_onclick(document.getElementById("cbEditRange"));
ClearFind()}function GetDemo(){document.getElementById("txtUrl").value="http://www.sitemapdoc.com/demomap.xml"}function ShowErrors(){document.getElementById("divErrors").style.left="200px"}function HideErrors(){document.getElementById("divErrors").style.left="-10000px"}var lastRowError=-1,lastCellError=-1;
function GoError(a,b){a--;if(lastRowError>-1)mapRows[lastRowError].cells[lastCellError].style.backgroundColor="";mapRows[a].cells[b].style.backgroundColor="pink";mapRows[a].cells[b].focus();lastRowError=a;lastCellError=b}var showSearch=false;
function ShowSearch(a){if(showSearch){document.getElementById("ifrmSearch").style.display="none";document.getElementById("btnSearch").value="Search";document.getElementById("btnSearch").style.backgroundColor=""}else{var b=a.clientX+document.body.scrollLeft;a=a.clientY+document.body.scrollTop;document.getElementById("ifrmSearch").style.top=a+16+"px";document.getElementById("ifrmSearch").style.left=b-400+"px";document.getElementById("ifrmSearch").style.display="block";document.getElementById("btnSearch").value=
"Hide";document.getElementById("btnSearch").style.backgroundColor="red"}showSearch=!showSearch};