/* Merged Plone Javascript file
 * This file is dynamically assembled from separate parts.
 * Some of these parts have 3rd party licenses or copyright information attached
 * Such information is valid for that section,
 * not for the entire composite file
 * originating files are separated by - filename.js -
 */

/* - orderablereference.js - */
// http://i70mtncorridorcss.com/portal_javascripts/orderablereference.js?original=1
function oref_top(obj){obj=(typeof obj=="string")?document.getElementById(obj):obj;if(obj.tagName.toLowerCase()!="select"&&obj.length<2)
return false;var elements=new Array();for(var i=0;i<obj.length;i++){if(obj[i].selected){elements[elements.length]=new Array((document.body.innerHTML?obj[i].innerHTML:obj[i].text),obj[i].value,obj[i].style.color,obj[i].style.backgroundColor,obj[i].className,obj[i].id,obj[i].selected)}}
for(i=0;i<obj.length;i++){if(!obj[i].selected){elements[elements.length]=new Array((document.body.innerHTML?obj[i].innerHTML:obj[i].text),obj[i].value,obj[i].style.color,obj[i].style.backgroundColor,obj[i].className,obj[i].id,obj[i].selected)}}
for(i=0;i<obj.length;i++){if(document.body.innerHTML) obj[i].innerHTML=elements[i][0];else obj[i].text=elements[i][0];obj[i].value=elements[i][1];obj[i].style.color=elements[i][2];obj[i].style.backgroundColor=elements[i][3];obj[i].className=elements[i][4];obj[i].id=elements[i][5];obj[i].selected=elements[i][6]}}
function oref_bottom(obj){obj=(typeof obj=="string")?document.getElementById(obj):obj;if(obj.tagName.toLowerCase()!="select"&&obj.length<2)
return false;var elements=new Array();for(var i=0;i<obj.length;i++){if(!obj[i].selected){elements[elements.length]=new Array((document.body.innerHTML?obj[i].innerHTML:obj[i].text),obj[i].value,obj[i].style.color,obj[i].style.backgroundColor,obj[i].className,obj[i].id,obj[i].selected)}}
for(i=0;i<obj.length;i++){if(obj[i].selected){elements[elements.length]=new Array((document.body.innerHTML?obj[i].innerHTML:obj[i].text),obj[i].value,obj[i].style.color,obj[i].style.backgroundColor,obj[i].className,obj[i].id,obj[i].selected)}}
for(i=obj.length-1;i>-1;i--){if(document.body.innerHTML) obj[i].innerHTML=elements[i][0];else obj[i].text=elements[i][0];obj[i].value=elements[i][1];obj[i].style.color=elements[i][2];obj[i].style.backgroundColor=elements[i][3];obj[i].className=elements[i][4];obj[i].id=elements[i][5];obj[i].selected=elements[i][6]}}
function oref_up(obj){var obj_string=obj;obj=(typeof obj=="string")?document.getElementById(obj):obj;if(obj.tagName.toLowerCase()!="select"&&obj.length<2)
return false;var sel=new Array();for(var i=0;i<obj.length;i++){if(obj[i].selected==true){sel[sel.length]=i}}
for(i in sel){if(sel[i]!=0){if(obj[sel[i]-1]){if(!obj[sel[i]-1].selected){var tmp=new Array((document.body.innerHTML?obj[sel[i]-1].innerHTML:obj[sel[i]-1].text),obj[sel[i]-1].value,obj[sel[i]-1].style.color,obj[sel[i]-1].style.backgroundColor,obj[sel[i]-1].className,obj[sel[i]-1].id);if(document.body.innerHTML) obj[sel[i]-1].innerHTML=obj[sel[i]].innerHTML;else obj[sel[i]-1].text=obj[sel[i]].text;obj[sel[i]-1].value=obj[sel[i]].value;obj[sel[i]-1].style.color=obj[sel[i]].style.color;obj[sel[i]-1].style.backgroundColor=obj[sel[i]].style.backgroundColor;obj[sel[i]-1].className=obj[sel[i]].className;obj[sel[i]-1].id=obj[sel[i]].id;if(document.body.innerHTML) obj[sel[i]].innerHTML=tmp[0];else obj[sel[i]].text=tmp[0];obj[sel[i]].value=tmp[1];obj[sel[i]].style.color=tmp[2];obj[sel[i]].style.backgroundColor=tmp[3];obj[sel[i]].className=tmp[4];obj[sel[i]].id=tmp[5];obj[sel[i]-1].selected=true;obj[sel[i]].selected=false}}}}
inout_selectAllWords(obj_string)}
function oref_down(obj){var obj_string=obj;obj=(typeof obj=="string")?document.getElementById(obj):obj;if(obj.tagName.toLowerCase()!="select"&&obj.length<2)
return false;var sel=new Array();for(var i=obj.length-1;i>-1;i--){if(obj[i].selected==true){sel[sel.length]=i}}
for(i in sel){if(sel[i]!=obj.length-1){if(obj[sel[i]+1]){if(!obj[sel[i]+1].selected){var tmp=new Array((document.body.innerHTML?obj[sel[i]+1].innerHTML:obj[sel[i]+1].text),obj[sel[i]+1].value,obj[sel[i]+1].style.color,obj[sel[i]+1].style.backgroundColor,obj[sel[i]+1].className,obj[sel[i]+1].id);if(document.body.innerHTML) obj[sel[i]+1].innerHTML=obj[sel[i]].innerHTML;else obj[sel[i]+1].text=obj[sel[i]].text;obj[sel[i]+1].value=obj[sel[i]].value;obj[sel[i]+1].style.color=obj[sel[i]].style.color;obj[sel[i]+1].style.backgroundColor=obj[sel[i]].style.backgroundColor;obj[sel[i]+1].className=obj[sel[i]].className;obj[sel[i]+1].id=obj[sel[i]].id;if(document.body.innerHTML) obj[sel[i]].innerHTML=tmp[0];else obj[sel[i]].text=tmp[0];obj[sel[i]].value=tmp[1];obj[sel[i]].style.color=tmp[2];obj[sel[i]].style.backgroundColor=tmp[3];obj[sel[i]].className=tmp[4];obj[sel[i]].id=tmp[5];obj[sel[i]+1].selected=true;obj[sel[i]].selected=false}}}}
inout_selectAllWords(obj_string)}
function inout_selectAllWords(theList){myList=document.getElementById(theList);for(var x=0;x<myList.length;x++){myList[x].selected="selected"}}
function inout_addNewKeyword(toList,newText,newValue){theToList=document.getElementById(toList);for(var x=0;x<theToList.length;x++){if(theToList[x].text==newText){return false}}
theLength=theToList.length;theToList[theLength]=new Option(newText);theToList[theLength].value=newValue}
function inout_moveKeywords(fromList,toList,selectThese){theFromList=document.getElementById(fromList);for(var x=0;x<theFromList.length;x++){if(theFromList[x].selected){inout_addNewKeyword(toList,theFromList[x].text,theFromList[x].value)}}
theToList=document.getElementById(fromList);for(var x=theToList.length-1;x>=0 ;x--){if(theToList[x].selected){theToList[x]=null}}
inout_selectAllWords(selectThese)}


/* - poptastic.js - */
// http://i70mtncorridorcss.com/portal_javascripts/poptastic.js?original=1
var newwindow;
function poptastic(url){newwindow=window.open(url,'Help','height=800,width=615,scrollbars=yes');if(window.focus){newwindow.focus()}}


/* - ++resource++seo_custommetatags.js - */
// http://i70mtncorridorcss.com/portal_javascripts/++resource++seo_custommetatags.js?original=1
customMetaTagsFunctions=new Object()
customMetaTagsFunctions.getInputOrSelect=function(node){var inputs=node.getElementsByTagName("input");if(inputs.length>0){return inputs[0]}
var selects=node.getElementsByTagName("select");if(selects.length>0){return selects[0]}
return null}
customMetaTagsFunctions.getWidgetRows=function(currnode){tbody=this.getParentElementById(currnode,"datagridwidget-tbody");return this.getRows(tbody)}
customMetaTagsFunctions.getRows=function(tbody){var rows=new Array()
child=tbody.firstChild;while(child!=null){if(child.tagName!=null){if(child.tagName.toLowerCase()=="tr"){rows=rows.concat(child)}}
child=child.nextSibling}
return rows}
customMetaTagsFunctions.autoInsertRow=function(e){var currnode=window.event?window.event.srcElement:e.currentTarget;var tbody=this.getParentElement(currnode,"TBODY");var rows=this.getRows(tbody);var lastRow=rows[rows.length-1];var thisRow=this.getParentElementById(currnode,"datagridwidget-row");if(rows.length-1==(thisRow.rowIndex)){var newtr=this.createNewRow(lastRow);lastRow.parentNode.insertBefore(newtr,lastRow);this.updateOrderIndex(tbody)}}
customMetaTagsFunctions.addRowAfter=function(currnode){var tbody=this.getParentElementById(currnode,"datagridwidget-tbody");var thisRow=this.getParentElementById(currnode,"datagridwidget-row");var newtr=this.createNewRow(thisRow);thisRow.parentNode.insertBefore(newtr,thisRow);this.updateOrderIndex(tbody)}
customMetaTagsFunctions.addRow=function(id){var tbody=document.getElementById("datagridwidget-tbody-"+id);var rows=this.getRows(tbody);var lastRow=rows[rows.length-1];var oldRows=rows.length;var newtr=this.createNewRow(lastRow);newNode=lastRow.parentNode.insertBefore(newtr,lastRow);this.updateOrderIndex(tbody)}
customMetaTagsFunctions.createNewRow=function(tr){var tbody=this.getParentElementById(tr,"datagridwidget-tbody");var rows=this.getRows(tbody);var lastRow=rows[rows.length-1];var newtr=document.createElement("tr");newtr.setAttribute("id","datagridwidget-row");newtr.setAttribute("class","datagridwidget-row");child=lastRow.firstChild;while(child!=null){newchild=child.cloneNode(true);newtr.appendChild(newchild);child=child.nextSibling}
return newtr}
customMetaTagsFunctions.removeFieldRow=function(node){var row=this.getParentElementById(node,'datagridwidget-row');var tbody=this.getParentElementById(node,'datagridwidget-tbody');tbody.removeChild(row)}
customMetaTagsFunctions.moveRowDown=function(currnode){var tbody=this.getParentElementById(currnode,"datagridwidget-tbody");var rows=this.getWidgetRows(currnode);var row=this.getParentElementById(currnode,"datagridwidget-row");if(row==null){alert("Couldn't find DataGridWidget row");return}
var idx=null
for(var t=0;t<rows.length;t++){if(rows[t]==row){idx=t;break}}
if(idx==null)
return;if(idx+2==rows.length){var nextRow=rows.item[0]
this.shiftRow(row,nextRow)} else{var nextRow=rows[idx+1]
this.shiftRow(nextRow,row)}
this.updateOrderIndex(tbody)}
customMetaTagsFunctions.moveRowUp=function(currnode){var tbody=this.getParentElementById(currnode,"datagridwidget-tbody");var rows=this.getWidgetRows(currnode);var row=this.getParentElementById(currnode,"datagridwidget-row");if(row==null){alert("Couldn't find DataGridWidget row");return}
var idx=null
for(var t=0;t<rows.length;t++){if(rows[t]==row){idx=t;break}}
if(idx==null)
return;if(idx==0){var previousRow=rows[rows.length-1]
this.shiftRow(row,previousRow)} else{var previousRow=rows[idx-1];this.shiftRow(row,previousRow)}
this.updateOrderIndex(tbody)}
customMetaTagsFunctions.shiftRow=function(bottom,top){bottom.parentNode.insertBefore(bottom,top)}
customMetaTagsFunctions.updateOrderIndex=function(tbody){var xre=new RegExp(/^orderindex__/)
var idx=0;var cell;var rows=this.getRows(tbody);for(var i=0;i<rows.length-1;i++){for(var c=0;(cell=rows[i].getElementsByTagName('INPUT').item(c));c++){if(cell.getAttribute('id')){if(xre.exec(cell.id)){cell.value=idx}}
this.updateRadioButtonGroupName(this.getParentElement(cell,"TR"),idx);idx++}}}
customMetaTagsFunctions.updateRadioButtonGroupName=function(row,newIndex){var cell;var xre=new RegExp(/^radio/)
var xre2=new RegExp(/^checkbox/)
for(var c=0;(cell=row.getElementsByTagName('INPUT').item(c));c++){if(cell.getAttribute('type')){var type=cell.getAttribute('type');if(xre.exec(type)||xre2.exec(type)){var name=cell.getAttribute("NAME")
if(name==null) continue;var baseLabel=name.substring(0,name.lastIndexOf("."));cell.setAttribute("NAME",baseLabel+"."+newIndex)}}}}
customMetaTagsFunctions.getParentElement=function(currnode,tagname){tagname=tagname.toUpperCase();var parent=currnode.parentNode;while(parent.tagName.toUpperCase()!=tagname){parent=parent.parentNode;if(parent.tagName.toUpperCase()=="BODY")
return null}
return parent}
customMetaTagsFunctions.getParentElementById=function(currnode,id){id=id.toLowerCase();var parent=currnode.parentNode;while(true){var parentId=parent.getAttribute("id");if(parentId!=null){if(parentId.toLowerCase().substring(0,id.length)==id) break}
parent=parent.parentNode;if(parent.tagName.toUpperCase()=="BODY")
return null}
return parent}
