﻿
function setimage( which, what ) {
        document.images[which].src = what;
}

function settext ( whichid, whattext ) {
        document.getElementById(whichid).innerHTML=whattext;
}

function changeloc( URL_List ) {
        var URL = URL_List.options[URL_List.selectedIndex].value;
        if ( URL != 0 && URL != '0' ) {
                // URL += '.html';
           window.location.href = URL;
   }
}

function showlogo() {
        var logoDiv = document.getElementById('headerlogo');
        logoDiv.className = logoDiv.className.replace('hide','');
}
function hidelogo() {
        var logoDiv = document.getElementById('headerlogo');
        logoDiv.className+='hide';
}

function show(which) {
  if (document.all && document.getElementById) {
    for(i=1; i< which.childNodes.length; i++) {
      node = which.childNodes[i];
      if( node.nodeName=="UL" ) {
        node.className+="drop";
      }
    }
  }
}
function hide(which) {
  if (document.all && document.getElementById) {
    for(i=1; i< which.childNodes.length; i++) {
      node = which.childNodes[i];
      if( node.nodeName=="UL" ) {
        node.className=node.className.replace("drop","");
      }
    }
  }
}


String.prototype.trim=function () {
   return this.replace(/^\s+|\s+$/g,"")
}
String.prototype.dblTrim=function () {
   return this.replace(/^\s{2,}|\s{2,}$/g," ")
}
// end 222
var wp_is_ie = document.all? true: false
function openDialog(url, modal,name1, width, height, features) {
        try {
                var editor = obj
        } catch (e) {
                var editor = this
                wp_current_obj = this
        }
        if (!features) {
                features = ''
        }
        if (wp_is_ie) {
                var nWidth = width + 6
                var nHeight = height + 25
                var params = 'dialogWidth:'+nWidth+'px;dialogHeight:'+ nHeight + 'px;help:no;'
                features = features.replace(/\,/gi, ';')
                features = features.replace(/\=/gi, ':')
                features = features.replace(/scrollbars/gi, 'scroll')
                features = features.replace(/left/gi, 'dialogLeft')
                features = features.replace(/top/gi, 'dialogTop')
                features = features.replace(/width/gi, 'dialogWidth')
                features = features.replace(/height/gi, 'dialogHeight')
                if ((features.search('scroll')) == -1) {
                        params += "scroll:no;"
                }
                if (features.search('status') == -1) {
                        params += "status:no;"
                }
                params += features
                if (modal == 'modeless') {
                        var win = window.showModelessDialog(url, window, params)
                } else {
                        var win = window.showModalDialog(url, window, params)
                }
                if (editor.id) {
                        if (document.getElementById(editor.id + "_editFrame")) {
                                editor.edit_object.focus()
                        }
                }
        } else {
                var name = url.split('?');
                var params = ''
                if (features.search('left') == -1) {
                        params = "left="+((screen.width/2)-(width/2))+","
                }
                if (features.search('top') == -1) {
                        params += "top="+((screen.height/2)-(height/2))+","
                }
                if (modal == 'modeless') {
                        var win = window.open(url, name1, "dependent=yes,width="+width+"px,height="+height+"px,"+features+","+params)
                } else {
                        var win = window.open(url, name1, "modal=yes,width="+width+"px,height="+height+"px,"+features+","+params)
                }
                win.focus();
        }
        return win
}

function cOn(td){
if(document.getElementById||(document.all && !(document.getElementById))){
td.style.border="1px dotted #FF6000";
window.status = '';
return true;
}
}
function cOut(td){
if(document.getElementById||(document.all && !(document.getElementById))){
td.style.border="1px dotted #FFFFFF";
window.status = '';
return true;
}
}

function wOpen(src, width, height)
 {
  document.getElementById("newpm").style.display="block";
  document.getElementById("newpm").style.width=width+20;
  document.getElementById("newpm").style.height=height;
  document.getElementById("frame").src=src;
  document.getElementById("frame").width=width;
  document.getElementById("frame").height=height;
  document.getElementById("newpm").style.top=20;
  self.scrollTo(0,0);

 }

