function closemsg(){document.getElementById('edmsg').style.visibility='hidden';}

function togqm(){d=document.getElementById("qmenu");if(d.style.visibility=="hidden")d.style.visibility="visible";else d.style.visibility="hidden"; }
function lo2(){
   dem=document.getElementById("edmsg");
   if(dem.style.visibility!="hidden")
      window.open(siteurl+'inc/timeout','_self');}

function locontf(r,c){}

function locont(){
   dem=document.getElementById("edmsg");
   dem.style.visibility="hidden";
   ajaxSend(siteurl+"edinc/xmlxfer?rtype=hb",{"onComplete":locontf});
   window.setTimeout('lo()',timout);}

function lo(){
   window.setTimeout('lo2()',1000*60*30);
   var d=new Date();
   dem=document.getElementById("edmsg");
   dem.style.visibility="visible";
   fw=document.body.offsetWidth;
   fh=document.body.clientHeight;
   ml=(fw-650)/2;
   mt=(fh-300)/2-100;
   mt=mt+document.body.scrollTop;
   dem.style.left = ml;
   dem.style.top = mt;
   de=document.getElementById("edmsgtxt");
   de.innerHTML="<div style='background-color:#444444;color:#ffffff;padding:5px'><b>"+propSysName+" : SESSION TIMEOUT : SOON</b></div><div style='padding:3px'><P>Your session is about to time out.  To prevent your session from timing out and continue working on your site, click link below.<P>The time is "+d.getHours()+":"+d.getMinutes()+". Your browser has been inactive for 60 minutes.  Sessions timeout after 90 minutes at which point you are automatically logged out of your site editor.  If you are working on your site, be sure to save your work now.</div>";}

function iedtitle1start(){
document.write('<div class="edtitle1"><table border=0 cellspacing=0><tr><td>');}

function iedtitle1stop(){
document.write('</td></tr></table></div>');}

var dmenuov=false;
function showdesignm(){
   d=document.getElementById("dmenu");
   d.style.visibility="visible";}

function hidedesignm(){
   window.setTimeout("dohidedesignm()",300);}

function dohidedesignm(){
   if(dmenuov==false)
      {
      d=document.getElementById("dmenu");
      d.style.visibility="hidden";
      }
}

function ipagetitle(txt){
document.write('<div class="pagetitle1"><table cellpadding=0 border=0 cellspacing=0 width=100%><tr><td class="t2">'+txt+'</td></tr></table></div>');}

function overedbtn(b){
   b.style.backgroundColor="#dfdfdf";
   b.style.borderColor="#000000";}

function outedbtn(b){
   b.style.backgroundColor="";
   b.style.borderColor="";}

function prowover(b,pid){
   if(moving==false && b && b.issel!=true)
      {
      b.style.backgroundColor="#efefef";
      b.style.borderColor="#000000";
      if(b.mdiv==null)
        {
        c=document.getElementById("pdiv"+pid);
        b.mdiv=c;
        }

      b.mdiv.style.visibility="visible";
      }
}

var lastsel=null;

function prowout(b,pid)
{
   if(moving==false && b && b.issel!=true)
      {
      b.style.backgroundColor="";
      b.style.borderColor="";
      if(b.mdiv==null){
        c=document.getElementById("pdiv"+pid);
        b.mdiv=c;}
      b.mdiv.style.visibility="hidden";
      }
}

function clearsel(pid){
   if(lastsel!=null && lastsel!=pid)
      {
      r=document.getElementById("prow"+lastsel);
      r.issel=false;
      prowout(r,pid);
      }
   lastsel=null;
}

var lastpage=null;
var lastparent=null;
var moving=false;

function showmaction(ev,b,parent,pid){
   d=document.getElementById("maction");
   d.style.visibility="visible";
   x=ev.clientX;
   y=ev.clientY;
   d.style.top=(y+document.body.scrollTop)+"px";
   d.style.left=x+"px";
   lastpage=pid;
   lastparent=parent;}

function movepage(to){
   d=document.getElementById("maction");
   d.style.visibility="hidden";
   from=document.getElementById("plist"+lastparent);
   too=document.getElementById("plist"+to);
   e=document.getElementById("prow"+lastpage);
   window.open(thispage+"?mpid="+lastpage+"&fr="+lastparent+"&to="+to,'_self');}

function showgroup(gr){
   window.open(thispage+"?mview="+gr,'_self');}

function rowhighlight(b,clr){
   if(clr==null)
      clr="dfdfdf";
      //clr='b0e6f1'
   b.style.backgroundColor='#'+clr}

function rownormal(b){
   b.style.backgroundColor='';}

function mover(b){}

function mout(b){}

function pup(pid){
   clearsel(pid);

   r=document.getElementById("prow"+pid);
   r.issel=true;
   lastsel=pid;
   r.style.backgroundColor="#b0e6f1";
   if(r.previousSibling!=null)
      r.swapNode(r.previousSibling);
   moving=true;
   window.setTimeout("clearpmove()",2500);}

function pdn(pid)
{
   clearsel(pid);

   r=document.getElementById("prow"+pid);
   r.issel=true;
   lastsel=pid;
   r.style.backgroundColor="#b0e6f1";
   if(r.nextSibling!=null)
      r.swapNode(r.nextSibling);
   moving=true;
   window.setTimeout("clearpmove()",2500);

}

function clearpmove()
{
   r=document.getElementById("prow"+lastsel);
   if(r)
      {
      r.issel=false;
      lastsel=null;
      moving=false;
      prowout(r,lastsel)
      }

}

function goe(u){
   location.href=u;}

function editbtn(txt,url,img,js,bclass){
if(!bclass || bclass==null || bclass.length==0)
   bclass="editbtn";
if(js==false)
   {
   var u="'"+url+"'";
   document.write('<table cellpadding=0 cellspacing=0 border=0><tr><td><div class="'+bclass+'" onClick="goe('+u+');return false;" onMouseOver="overedbtn(this);" onMouseOut="outedbtn(this);"><table cellpadding=0 cellspacing=0 border=0 width=1%><tr><td  width=1% valign=middle><a href="'+url+'" onClick="event.cancelBubble=true"><img src="'+imroot+'/i/t/w/btn/'+img+'" border=0></a></td><td width=99%>&nbsp;<a href="'+url+'" onclick="event.cancelBubble=true">'+txt+'</a>&nbsp;&nbsp;</td></tr></table></div></td></tr></table>');
   }
else
   {
   document.write('<table cellpadding=0 cellspacing=0 border=0><tr><td><div class="'+bclass+'"  onClick="'+url+';return false;" onMouseOver="overedbtn(this);" onMouseOut="outedbtn(this);"><table cellpadding=0 cellspacing=0 border=0 width=1%><tr><td  width=1% valign=middle><a href="" onClick="event.cancelBubble=true;'+url+';return false;"><img src="'+imroot+'/i/t/w/btn/'+img+'" border=0></a></td><td width=99%>&nbsp;<a href="" onClick="event.cancelBubble=true;'+url+';return false;">'+txt+'</a>&nbsp;&nbsp;</td></tr></table></div></td></tr></table>');
   }
}

function editbtnstart(bclass){
if(bclass==null || bclass.length==0)
   bclass="editbtn";

document.write('<table cellpadding=0 cellspacing=0 border=0><tr><td><div class="'+bclass+'" onMouseOver="overedbtn(this)" onMouseOut="outedbtn(this)"><table cellpadding=0 cellspacing=0 border=0><tr><td valign=middle>');
}
function editbtnend(){
document.write('&nbsp;</td></tr></table></div></td></tr></table>');}

function btnback(url){
   document.write('<div class="editback"><table cellpadding=0 cellspacing=0 border=0><tr><td><a href="'+url+'"><img src="'+imroot+'/i/t/w/btn/pagesback.gif" border=0></a></td><td><font size=2>&nbsp;</font><a href="'+url+'">Go back</a></td><td><img src="'+imroot+'/i/t/w/rnddot.gif" width=10 height=1></td></tr></table></div>');}

function ieditdivider(){}

function ieditfooter(){
document.write('<div class="ieditfooter">'+propSysNameLong+'<br><a href="http://'+propHomeLink+'">'+propHomeLink+'</a><p>&nbsp;</center></div>');}

function ajaxSend(url,robj){
function ajback(){
if (ajr.readyState == 4) {
  if (ajr.status == 200) {
    if(ajr.responseText.indexOf("err:")==0)
      {
      if(cobj.onError)
        cobj.onError(ajr,cobj);
      }
    else if (cobj.onComplete)
       cobj.onComplete(ajr,cobj);
    }
  else
    if(cobj.onError)
       cobj.onError(ajr,cobj);
  }
}
var ajr = null;
var cobj = robj;
var td = new Date();
url=url+"&d="+td.getTime();

if (window.XMLHttpRequest) {
ajr = new XMLHttpRequest();
ajr.onreadystatechange = ajback;
ajr.open("GET", url, true);
ajr.send(null);
} else if (window.ActiveXObject) {
ajr = new ActiveXObject("Microsoft.XMLHTTP");
if (ajr) {
ajr.onreadystatechange = ajback;
ajr.open("GET", url, true);
ajr.send();
}}
}

function getParam(window,param){
query=window.location.search;
if(query.length==0)return "";
query=query.substring(1);
var params=query.split("&");
for(var i=0;i<params.length;i++)
{
var pos=params[i].indexOf("=");
var name=params[i].substring(0, pos);
if(name==param)
 return params[i].substring(pos + 1);
}
return null;
}

