/*
 *  md5.js 1.0b 27/06/96
 *
 * Javascript implementation of the RSA Data Security, Inc. md5
 * Message-Digest Algorithm.
 *
 * Copyright (c) 1996 Henri Torgemane. All Rights Reserved.
 *
 * Permission to use, copy, modify, and distribute this software
 * and its documentation for any purposes and without
 * fee is hereby granted provided that this copyright notice
 * appears in all copies.
 *
 * Of course, this soft is provided "as is" without express or implied
 * warranty of any kind.
 *
 *
 * Modified with german comments and some information about collisions.
 * (Ralf Mieke, ralf@miekenet.de, http://mieke.home.pages.de)
 */

/**
*	Create an md5-hash of the given object/string.
*	<p>
*	md5.js 1.0b 27/06/96
*<br />&nbsp;<br />
*	Javascript implementation of the RSA Data Security, Inc. md5
*	Message-Digest Algorithm.
*<br />&nbsp;<br />
*	Copyright (c) 1996 Henri Torgemane. All Rights Reserved.
*<br />&nbsp;<br />
*	Permission to use, copy, modify, and distribute this software
*	and its documentation for any purposes and without
*	fee is hereby granted provided that this copyright notice
*	appears in all copies.
*<br />&nbsp;<br />
*	Of course, this soft is provided "as is" without express or implied
*	warranty of any kind.
*	Modified with german comments and some information about collisions.
*<br />
*	(Ralf Mieke, ralf&#64;miekenet.de, http://mieke.home.pages.de)
*	</p>
*<br />&nbsp;<br />
*	<b>Package:</b> com.map24.core
*
*	@param msg						The message to crate the hashvalue above.
*	@return							The md5-hash of the given object/string.
*	@type string
*/
function md5(msg)
{
 var l,s,k,ka,kb,kc,kd;

 md5_init();
 for (k=0;k<msg.length;k++) {
   l=msg.charAt(k);
   md5_update(md5_ascii.lastIndexOf(l));
 }
 md5_finish();
 ka=kb=kc=kd=0;
 for (i=0;i<4;i++) ka+=md5_shl(md5_digestBits[15-i], (i*8));
 for (i=4;i<8;i++) kb+=md5_shl(md5_digestBits[15-i], ((i-4)*8));
 for (i=8;i<12;i++) kc+=md5_shl(md5_digestBits[15-i], ((i-8)*8));
 for (i=12;i<16;i++) kd+=md5_shl(md5_digestBits[15-i], ((i-12)*8));
 s=md5_hexa(kd)+md5_hexa(kc)+md5_hexa(kb)+md5_hexa(ka);
 return s;
}

/**
*	@private
*/
function md5_array(n) {
  for(i=0;i<n;i++) this[i]=0;
  this.length=n;
}


/* Einige grundlegenden Funktionen m?ssen wegen
 * Javascript Fehlern umgeschrieben werden.
 * Man versuche z.B. 0xffffffff >> 4 zu berechnen..
 * Die nun verwendeten Funktionen sind zwar langsamer als die Originale,
 * aber sie funktionieren.
 */
/**
*	@private
*/
function md5_integer(n) { return n%(0xffffffff+1); }

/**
*	@private
*/
function md5_shr(a,b) {
  a=md5_integer(a);
  b=md5_integer(b);
  if (a-0x80000000>=0) {
    a=a%0x80000000;
    a>>=b;
    a+=0x40000000>>(b-1);
  } else
    a>>=b;
  return a;
}

/**
*	@private
*/
function md5_shl1(a) {
  a=a%0x80000000;
  if (a&0x40000000==0x40000000)
  {
    a-=0x40000000;
    a*=2;
    a+=0x80000000;
  } else
    a*=2;
  return a;
}

/**
*	@private
*/
function md5_shl(a,b) {
  a=md5_integer(a);
  b=md5_integer(b);
  for (var i=0;i<b;i++) a=md5_shl1(a);
  return a;
}

/**
*	@private
*/
function md5_and(a,b) {
  a=md5_integer(a);
  b=md5_integer(b);
  var t1=(a-0x80000000);
  var t2=(b-0x80000000);
  if (t1>=0)
    if (t2>=0)
      return ((t1&t2)+0x80000000);
    else
      return (t1&b);
  else
    if (t2>=0)
      return (a&t2);
    else
      return (a&b);
}

/**
*	@private
*/
function md5_or(a,b) {
  a=md5_integer(a);
  b=md5_integer(b);
  var t1=(a-0x80000000);
  var t2=(b-0x80000000);
  if (t1>=0)
    if (t2>=0)
      return ((t1|t2)+0x80000000);
    else
      return ((t1|b)+0x80000000);
  else
    if (t2>=0)
      return ((a|t2)+0x80000000);
    else
      return (a|b);
}

/**
*	@private
*/
function md5_xor(a,b) {
  a=md5_integer(a);
  b=md5_integer(b);
  var t1=(a-0x80000000);
  var t2=(b-0x80000000);
  if (t1>=0)
    if (t2>=0)
      return (t1^t2);
    else
      return ((t1^b)+0x80000000);
  else
    if (t2>=0)
      return ((a^t2)+0x80000000);
    else
      return (a^b);
}

/**
*	@private
*/
function md5_not(a) {
  a=md5_integer(a);
  return (0xffffffff-a);
}

/* Beginn des Algorithmus */

var md5_state = new md5_array(4);
var md5_count = new md5_array(2);
    md5_count[0] = 0;
    md5_count[1] = 0;
var md5_buffer = new md5_array(64);
var md5_transformBuffer = new md5_array(16);
var md5_digestBits = new md5_array(16);

var md5_S11 = 7;
var md5_S12 = 12;
var md5_S13 = 17;
var md5_S14 = 22;
var md5_S21 = 5;
var md5_S22 = 9;
var md5_S23 = 14;
var md5_S24 = 20;
var md5_S31 = 4;
var md5_S32 = 11;
var md5_S33 = 16;
var md5_S34 = 23;
var md5_S41 = 6;
var md5_S42 = 10;
var md5_S43 = 15;
var md5_S44 = 21;

/**
*	@private
*/
function md5_F(x,y,z) {
    return md5_or(md5_and(x,y),md5_and(md5_not(x),z));
}

/**
*	@private
*/
function md5_G(x,y,z) {
    return md5_or(md5_and(x,z),md5_and(y,md5_not(z)));
}

/**
*	@private
*/
function md5_H(x,y,z) {
    return md5_xor(md5_xor(x,y),z);
}

/**
*	@private
*/
function md5_I(x,y,z) {
    return md5_xor(y ,md5_or(x , md5_not(z)));
}

/**
*	@private
*/
function md5_rotateLeft(a,n) {
    return md5_or(md5_shl(a, n),(md5_shr(a,(32 - n))));
}

/**
*	@private
*/
function md5_FF(a,b,c,d,x,s,ac) {
    a = a+md5_F(b, c, d) + x + ac;
    a = md5_rotateLeft(a, s);
    a = a+b;
    return a;
}

/**
*	@private
*/
function md5_GG(a,b,c,d,x,s,ac) {
    a = a+md5_G(b, c, d) +x + ac;
    a = md5_rotateLeft(a, s);
    a = a+b;
    return a;
}

/**
*	@private
*/
function md5_HH(a,b,c,d,x,s,ac) {
    a = a+md5_H(b, c, d) + x + ac;
    a = md5_rotateLeft(a, s);
    a = a+b;
    return a;
}

/**
*	@private
*/
function md5_II(a,b,c,d,x,s,ac) {
    a = a+md5_I(b, c, d) + x + ac;
    a = md5_rotateLeft(a, s);
    a = a+b;
    return a;
}

/**
*	@private
*/
function md5_transform(buf,offset) {
    var a=0, b=0, c=0, d=0;
    var x = md5_transformBuffer;

    a = md5_state[0];
    b = md5_state[1];
    c = md5_state[2];
    d = md5_state[3];

    for (i = 0; i < 16; i++) {
        x[i] = md5_and(buf[i*4+offset],0xff);
        for (j = 1; j < 4; j++) {
            x[i]+=md5_shl(md5_and(buf[i*4+j+offset] ,0xff), j * 8);
        }
    }

    /* Runde 1 */
    a = md5_FF ( a, b, c, d, x[ 0], md5_S11, 0xd76aa478); /* 1 */
    d = md5_FF ( d, a, b, c, x[ 1], md5_S12, 0xe8c7b756); /* 2 */
    c = md5_FF ( c, d, a, b, x[ 2], md5_S13, 0x242070db); /* 3 */
    b = md5_FF ( b, c, d, a, x[ 3], md5_S14, 0xc1bdceee); /* 4 */
    a = md5_FF ( a, b, c, d, x[ 4], md5_S11, 0xf57c0faf); /* 5 */
    d = md5_FF ( d, a, b, c, x[ 5], md5_S12, 0x4787c62a); /* 6 */
    c = md5_FF ( c, d, a, b, x[ 6], md5_S13, 0xa8304613); /* 7 */
    b = md5_FF ( b, c, d, a, x[ 7], md5_S14, 0xfd469501); /* 8 */
    a = md5_FF ( a, b, c, d, x[ 8], md5_S11, 0x698098d8); /* 9 */
    d = md5_FF ( d, a, b, c, x[ 9], md5_S12, 0x8b44f7af); /* 10 */
    c = md5_FF ( c, d, a, b, x[10], md5_S13, 0xffff5bb1); /* 11 */
    b = md5_FF ( b, c, d, a, x[11], md5_S14, 0x895cd7be); /* 12 */
    a = md5_FF ( a, b, c, d, x[12], md5_S11, 0x6b901122); /* 13 */
    d = md5_FF ( d, a, b, c, x[13], md5_S12, 0xfd987193); /* 14 */
    c = md5_FF ( c, d, a, b, x[14], md5_S13, 0xa679438e); /* 15 */
    b = md5_FF ( b, c, d, a, x[15], md5_S14, 0x49b40821); /* 16 */

    /* Runde 2 */
    a = md5_GG ( a, b, c, d, x[ 1], md5_S21, 0xf61e2562); /* 17 */
    d = md5_GG ( d, a, b, c, x[ 6], md5_S22, 0xc040b340); /* 18 */
    c = md5_GG ( c, d, a, b, x[11], md5_S23, 0x265e5a51); /* 19 */
    b = md5_GG ( b, c, d, a, x[ 0], md5_S24, 0xe9b6c7aa); /* 20 */
    a = md5_GG ( a, b, c, d, x[ 5], md5_S21, 0xd62f105d); /* 21 */
    d = md5_GG ( d, a, b, c, x[10], md5_S22,  0x2441453); /* 22 */
    c = md5_GG ( c, d, a, b, x[15], md5_S23, 0xd8a1e681); /* 23 */
    b = md5_GG ( b, c, d, a, x[ 4], md5_S24, 0xe7d3fbc8); /* 24 */
    a = md5_GG ( a, b, c, d, x[ 9], md5_S21, 0x21e1cde6); /* 25 */
    d = md5_GG ( d, a, b, c, x[14], md5_S22, 0xc33707d6); /* 26 */
    c = md5_GG ( c, d, a, b, x[ 3], md5_S23, 0xf4d50d87); /* 27 */
    b = md5_GG ( b, c, d, a, x[ 8], md5_S24, 0x455a14ed); /* 28 */
    a = md5_GG ( a, b, c, d, x[13], md5_S21, 0xa9e3e905); /* 29 */
    d = md5_GG ( d, a, b, c, x[ 2], md5_S22, 0xfcefa3f8); /* 30 */
    c = md5_GG ( c, d, a, b, x[ 7], md5_S23, 0x676f02d9); /* 31 */
    b = md5_GG ( b, c, d, a, x[12], md5_S24, 0x8d2a4c8a); /* 32 */

    /* Runde 3 */
    a = md5_HH ( a, b, c, d, x[ 5], md5_S31, 0xfffa3942); /* 33 */
    d = md5_HH ( d, a, b, c, x[ 8], md5_S32, 0x8771f681); /* 34 */
    c = md5_HH ( c, d, a, b, x[11], md5_S33, 0x6d9d6122); /* 35 */
    b = md5_HH ( b, c, d, a, x[14], md5_S34, 0xfde5380c); /* 36 */
    a = md5_HH ( a, b, c, d, x[ 1], md5_S31, 0xa4beea44); /* 37 */
    d = md5_HH ( d, a, b, c, x[ 4], md5_S32, 0x4bdecfa9); /* 38 */
    c = md5_HH ( c, d, a, b, x[ 7], md5_S33, 0xf6bb4b60); /* 39 */
    b = md5_HH ( b, c, d, a, x[10], md5_S34, 0xbebfbc70); /* 40 */
    a = md5_HH ( a, b, c, d, x[13], md5_S31, 0x289b7ec6); /* 41 */
    d = md5_HH ( d, a, b, c, x[ 0], md5_S32, 0xeaa127fa); /* 42 */
    c = md5_HH ( c, d, a, b, x[ 3], md5_S33, 0xd4ef3085); /* 43 */
    b = md5_HH ( b, c, d, a, x[ 6], md5_S34,  0x4881d05); /* 44 */
    a = md5_HH ( a, b, c, d, x[ 9], md5_S31, 0xd9d4d039); /* 45 */
    d = md5_HH ( d, a, b, c, x[12], md5_S32, 0xe6db99e5); /* 46 */
    c = md5_HH ( c, d, a, b, x[15], md5_S33, 0x1fa27cf8); /* 47 */
    b = md5_HH ( b, c, d, a, x[ 2], md5_S34, 0xc4ac5665); /* 48 */

    /* Runde 4 */
    a = md5_II ( a, b, c, d, x[ 0], md5_S41, 0xf4292244); /* 49 */
    d = md5_II ( d, a, b, c, x[ 7], md5_S42, 0x432aff97); /* 50 */
    c = md5_II ( c, d, a, b, x[14], md5_S43, 0xab9423a7); /* 51 */
    b = md5_II ( b, c, d, a, x[ 5], md5_S44, 0xfc93a039); /* 52 */
    a = md5_II ( a, b, c, d, x[12], md5_S41, 0x655b59c3); /* 53 */
    d = md5_II ( d, a, b, c, x[ 3], md5_S42, 0x8f0ccc92); /* 54 */
    c = md5_II ( c, d, a, b, x[10], md5_S43, 0xffeff47d); /* 55 */
    b = md5_II ( b, c, d, a, x[ 1], md5_S44, 0x85845dd1); /* 56 */
    a = md5_II ( a, b, c, d, x[ 8], md5_S41, 0x6fa87e4f); /* 57 */
    d = md5_II ( d, a, b, c, x[15], md5_S42, 0xfe2ce6e0); /* 58 */
    c = md5_II ( c, d, a, b, x[ 6], md5_S43, 0xa3014314); /* 59 */
    b = md5_II ( b, c, d, a, x[13], md5_S44, 0x4e0811a1); /* 60 */
    a = md5_II ( a, b, c, d, x[ 4], md5_S41, 0xf7537e82); /* 61 */
    d = md5_II ( d, a, b, c, x[11], md5_S42, 0xbd3af235); /* 62 */
    c = md5_II ( c, d, a, b, x[ 2], md5_S43, 0x2ad7d2bb); /* 63 */
    b = md5_II ( b, c, d, a, x[ 9], md5_S44, 0xeb86d391); /* 64 */

    md5_state[0] +=a;
    md5_state[1] +=b;
    md5_state[2] +=c;
    md5_state[3] +=d;

}
/* Mit der Initialisierung von Dobbertin:
   md5_state[0] = 0x12ac2375;
   md5_state[1] = 0x3b341042;
   md5_state[2] = 0x5f62b97c;
   md5_state[3] = 0x4ba763ed;
   gibt es eine Kollision:

   begin 644 Message1
   M7MH=JO6_>MG!X?!51$)W,CXV!A"=(!AR71,<X`Y-IIT9^Z&8L$2N'Y*Y:R.;
   39GIK9>TF$W()/MEHR%C4:G1R:Q"=
   `
   end

   begin 644 Message2
   M7MH=JO6_>MG!X?!51$)W,CXV!A"=(!AR71,<X`Y-IIT9^Z&8L$2N'Y*Y:R.;
   39GIK9>TF$W()/MEHREC4:G1R:Q"=
   `
   end
*/
/**
*	@private
*/
function md5_init() {
    md5_count[0]=md5_count[1] = 0;
    md5_state[0] = 0x67452301;
    md5_state[1] = 0xefcdab89;
    md5_state[2] = 0x98badcfe;
    md5_state[3] = 0x10325476;
    for (i = 0; i < md5_digestBits.length; i++)
        md5_digestBits[i] = 0;
}

/**
*	@private
*/
function md5_update(b) {
    var index,i;

    index = md5_and(md5_shr(md5_count[0],3) , 0x3f);
    if (md5_count[0]<0xffffffff-7)
      md5_count[0] += 8;
    else {
      md5_count[1]++;
      md5_count[0]-=0xffffffff+1;
      md5_count[0]+=8;
    }
    md5_buffer[index] = md5_and(b,0xff);
    if (index  >= 63) {
        md5_transform(md5_buffer, 0);
    }
}

/**
*	@private
*/
function md5_finish() {
    var bits = new md5_array(8);
    var        padding;
    var        i=0, index=0, padLen=0;

    for (i = 0; i < 4; i++) {
        bits[i] = md5_and(md5_shr(md5_count[0],(i * 8)), 0xff);
    }
    for (i = 0; i < 4; i++) {
        bits[i+4]=md5_and(md5_shr(md5_count[1],(i * 8)), 0xff);
    }
    index = md5_and(md5_shr(md5_count[0], 3) ,0x3f);
    padLen = (index < 56) ? (56 - index) : (120 - index);
    padding = new md5_array(64);
    padding[0] = 0x80;
    for (i=0;i<padLen;i++)
      md5_update(padding[i]);
    for (i=0;i<8;i++)
      md5_update(bits[i]);

    for (i = 0; i < 4; i++) {
        for (j = 0; j < 4; j++) {
            md5_digestBits[i*4+j] = md5_and(md5_shr(md5_state[i], (j * 8)) , 0xff);
        }
    }
}

/* Ende des md5 Algorithmus */


/**
*	@private
*/
function md5_hexa(n) {
 var hexa_h = "0123456789abcdef";
 var hexa_c="";
 var hexa_m=n;
 for (hexa_i=0;hexa_i<8;hexa_i++) {
   hexa_c=hexa_h.charAt(Math.abs(hexa_m)%16)+hexa_c;
   hexa_m=Math.floor(hexa_m/16);
 }
 return hexa_c;
}


/**
*	@private
*/
var md5_ascii="01234567890123456789012345678901" +
          " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ"+
          "[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";


/*
Copyright (c) 2005 JSON.org

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The Software shall be used for Good, not Evil.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

/*
    The global object JSON contains two methods.

    JSON.stringify(value) takes a JavaScript value and produces a JSON text.
    The value must not be cyclical.

    JSON.parse(text) takes a JSON text and produces a JavaScript value. It will
    throw a 'JSONError' exception if there is an error.
*/
var JSON = {
    copyright: '(c)2005 JSON.org',
    license: 'http://www.crockford.com/JSON/license.html',
/*
    Stringify a JavaScript value, producing a JSON text.
*/
    stringify: function (v) {
        var a = [];

/*
    Emit a string.
*/
        function e(s) {
            a[a.length] = s;
        }

/*
    Convert a value.
*/
        function g(x) {
            var c, i, l, v;

            switch (typeof x) {
            case 'object':
                if (x) {
                    if (x instanceof Array) {
                        e('[');
                        l = a.length;
                        for (i = 0; i < x.length; i += 1) {
                            v = x[i];
                            if (typeof v != 'undefined' &&
                                    typeof v != 'function') {
                                if (l < a.length) {
                                    e(',');
                                }
                                g(v);
                            }
                        }
                        e(']');
                        return;
                    } else if (typeof x.valueOf == 'function') {
                        e('{');
                        l = a.length;
                        for (i in x) {
                            v = x[i];
                            if (typeof v != 'undefined' &&
                                    typeof v != 'function' &&
                                    (!v || typeof v != 'object' ||
                                        typeof v.valueOf == 'function')) {
                                if (l < a.length) {
                                    e(',');
                                }
                                g(i);
                                e(':');
                                g(v);
                            }
                        }
                        return e('}');
                    }
                }
                e('null');
                return;
            case 'number':
                e(isFinite(x) ? +x : 'null');
                return;
            case 'string':
                l = x.length;
                e('"');
                for (i = 0; i < l; i += 1) {
                    c = x.charAt(i);
                    if (c >= ' ') {
                        if (c == '\\' || c == '"') {
                            e('\\');
                        }
                        e(c);
                    } else {
                        switch (c) {
                        case '\b':
                            e('\\b');
                            break;
                        case '\f':
                            e('\\f');
                            break;
                        case '\n':
                            e('\\n');
                            break;
                        case '\r':
                            e('\\r');
                            break;
                        case '\t':
                            e('\\t');
                            break;
                        default:
                            c = c.charCodeAt();
                            e('\\u00' + Math.floor(c / 16).toString(16) +
                                (c % 16).toString(16));
                        }
                    }
                }
                e('"');
                return;
            case 'boolean':
                e(String(x));
                return;
            default:
                e('null');
                return;
            }
        }
        g(v);
        return a.join('');
    },
/*
    Parse a JSON text, producing a JavaScript value.
*/
    parse: function (text) {
        return (/^(\s+|[,:{}\[\]]|"(\\["\\\/bfnrtu]|[^\x00-\x1f"\\]+)*"|-?\d+(\.\d*)?([eE][+-]?\d+)?|true|false|null)+$/.test(text)) &&
            eval('(' + text + ')');
    }
};

Rf = function(){}


Rf.init = function(){
	try{
		Rf.Layout.initDHTMLAPI();
		
		Rf.Session.rfAuth = new Rf.CAuth({divID:"rfLogin"});
		
		Rf.Session.rfTaube = new Rf.CTaube();
		
		Rf.Session.rfTicker = new Rf.CTicker({divID:"rfTicker"});
		
		Rf.Session.mainContent = new Rf.CContent({divID:"rfContents", auth:Rf.Session.rfAuth});
		Rf.Session.mainContent.RegisteredModules["news"] = {label:"News", classname:"CNews"};
		Rf.Session.mainContent.RegisteredModules["termine"] = {label:"Termine", classname:"CDates"};
		Rf.Session.mainContent.RegisteredModules["club"] = {label:"Verein", classname:"CClub"};
		Rf.Session.mainContent.RegisteredModules["ballschule"] = {label:"Ballschule", classname:"CBallschule"};
		Rf.Session.mainContent.RegisteredModules["fees"] = {label:"Beitr&auml;ge", classname:"CFees"};
		Rf.Session.mainContent.RegisteredModules["bilder"] = {label:"Bilder", classname:"CImageGallery"};
		Rf.Session.mainContent.RegisteredModules["anfahrt"] = {label:"Anfahrt", classname:"CDirections"};
		//Rf.Session.mainContent.RegisteredModules["board"] = {label:"Forum", classname:"CBoard"};
		Rf.Session.mainContent.RegisteredModules["links"] = {label:"Links", classname:"CLinks"};
		Rf.Session.mainContent.RegisteredModules["impressum"] = {label:"Impressum", classname:"CImpressum"};
		Rf.Session.mainContent.initMainNavi({divID:"rfMainNavi"});
		Rf.Session.mainContent.createSIB();
		
		
		Rf.Session.mainContent.checkSiteDimensions();
		window.onresize = Rf.Session.mainContent.checkSiteDimensions;
		
		Rf.Session.mainContent.show({cI:"news"});
		
		setTimeout("Rf.loadMap24()", 2000);
	}
	catch(e){
		setTimeout("Rf.init()", 250);
	}
}

Rf.Map24ApiLoaded = false;
Rf.loadMap24 = function(){	
	Map24.loadApi( ["core_api"] , Rf.map24ApiLoaded );
}

  
//Callback function called when the API is loaded. The map can now be shown. 
Rf.map24ApiLoaded = function(){ 
    Rf.Map24ApiLoaded = true;
    //Map24.Debug.enable( true, Map24.E_ALL_DEBUG );
}

Rf.dg = function(id){
	if(document.getElementById(id)){
		return document.getElementById(id);
	}
	else{
		return false;
	}
}

Rf.dc = function(tagname, classname, id, width, height){
//	try{
	var newElement =  document.createElement(tagname);
//	}
//	catch(e){
//		return false;
//	}
	if(typeof classname == 'string'){
		newElement.className = classname;
	}
	if((typeof id == 'string' && id != '') || typeof id == 'number'){
		newElement.id = id;
	}
	if(typeof width == 'number' && width > -1){
		newElement.style.width = width.toString()+'px';
	}
	if(typeof height == 'number' && height > -1){
		newElement.style.height = height.toString()+'px';
	}
	return newElement;
}

Rf.dcModuleDIV = function(){
	var newElement =  Rf.dc("div");
	newElement.style.display = "none";
	newElement.style.position = "relative";
	newElement.style.top = "0px";
	newElement.style.left = "0px";
	newElement.style.width = "100%";
	newElement.style.height = "100%";
	return newElement;
}

Rf.dcModuleSubDIV = function(){
	var newElement =  Rf.dc("div");
	newElement.style.display = "none";
	newElement.style.position = "relative";
	newElement.style.top = "0px";
	newElement.style.left = "0px";
	newElement.style.width = "100%";
	newElement.style.height = "100%";
	return newElement;
}

Rf.dcDiv = function(top, left, width, height){
	var newElement =  Rf.dc("div");
	newElement.style.position = "absolute";
	newElement.style.top = top+"px";
	newElement.style.left = left+"px";
	//newElement.style.width = "100%";
	//newElement.style.height = "100%";
	if(!Rf.empty(width)){
		newElement.style.width = width+"px";
	}
	if(!Rf.empty(height)){
		newElement.style.height = height+"px";
	}
	return newElement;
}

Rf.setVisibility = function(id, value){
	if(Rf.empty(value)){
		value = 'block';
	}
	dg(id).style.display = value;
}

Rf.setDisplay = function(id, style){
	dg(id).style.display = style;
}

//
Rf.isset = function(param){
	if(param && typeof param != 'undefined' && param != null){
		return true;
	}
	else{
		return false;
	}	
}

Rf.isNumeric = function(param){
	if(param && typeof param == 'number'){
		return true;
	}
	else{
		return false;
	}	
}

Rf.isTrue = function(param){
	if(typeof param == 'boolean' && param == true){
		return true;
	}
	else{
		return false;
	}	
}

Rf.isString = function(param){
	if(typeof param == 'string'){
		return true;
	}
	else{
		return false;
	}	
}

Rf.callFunction = function(func, params){
	var thisFunction = eval(func);
	thisFunction.apply(null, [params]);
}

Rf.callCallback = function(aH){
	var callbackParamsHash = {};
	if(isString(aH.callbackParams)){
		callbackParamsHash = JSON.parse(aH.callbackParams);
	}
	else if(typeof aH.callbackParams == 'object'){
		callbackParamsHash = aH.callbackParams;
	}
	callFunction(aH.callback, callbackParamsHash);
}

if (!Array.prototype.push) {
	Array.prototype.push = function() {
		for (var i = 0; i < arguments.length; i++) {this[this.length] = arguments[i];}
		return this.length;
	};
}

if (!Array.prototype.pop) {
	Array.prototype.pop = function(number) {
		var returnArray = null;
		var returnVal = null;
		if(typeof number!='number' || number<0){number=0;}
		if(this.length < number){returnArray = this; this.length = 0; return returnArray;}
		else{
			if(number>1){
				returnArray = array();
				for(var i=1; i<=number; i++){
					returnArray.push(this[(this.length-i)]);
				}
				this.length = this.length - number;
				return returnArray;
			}
			else{
				returnVal = this[(this.length-1)];
				this.length--;
				return returnVal;
			}
		}
	};
}
/*
if (!Array.prototype.extract) {
	Array.prototype.extract = function(arrayElement) {
		var foundFlag = false;
		for(var i=0; i<this.length; i++){
			if(this[i] == arrayElement){
				foundFlag = true;
			}
			if(typeof foundFlag == 'boolean' && foundFlag == true && (i+1) < this.length){
				this[i] = this[(i+1)];
			}
		}
		if(typeof foundFlag == 'boolean' && foundFlag == true){
			this.length = this.length - 1;
			return true;
		}
		else{
			return false;
		}
	};
}
*/
Rf.in_array = function(searchFor, arrayToSearch){
	for(var obj in arrayToSearch){
		if(arrayToSearch[obj] == searchFor){return true;}
	}
	return false;
}

//document.url
Rf.splitURL = function( url ){
	var result = new Array();
	var tmp = url.split("?", 2);
	result.push( tmp[0] );
	var url_args = {};
	if( tmp.length > 1 ) {
		var args = tmp[1].split("&");
		var arg = null;
		for( var i=0; i < args.length; i++ ) {
			arg = args[i].split("=",2);
			if( arg.length == 1 ) {
				url_args[arg[0]] = null;
			} else
			if( arg.length == 2 ) {
				url_args[arg[0]] = arg[1];
			}
			arg = null;
		}
	}
	result.push( url_args );
	return result;
}
/*
function dump(obj){
	alert(obj_dump(obj));
}

function var_dump(obj) {
   if(typeof obj == "object") {
      return "Type: "+typeof(obj)+((obj.constructor) ? "\nConstructor: "+obj.constructor : "")+"\nValue: " + obj;
   } else {
      return "Type: "+typeof(obj)+"\nValue: "+obj;
   }
}//end function var_dump

function obj_dump(obj) {
	var returnstring = '\n';
   	for(var item in obj){
   		if(typeof obj[item] == 'object'){
			returnstring += obj_dump(obj[item])+'\n';
   		}
   		else{
   			returnstring += var_dump(obj[item])+'\n';
   		}
   	}
   	return returnstring;
}//end function var_dump
*/
/*
var testhash = {};
testhash['tor'] = 'bla'
testhash['tor2'] = 'blub'

alert(dump(testhash));
*/
/*
var DEBUG = true;

var DumpDefaultMaximalRecursions = 1;

var DumpFunctions = false;

var DumpWindow = null;

function dump( obj, div, maxrecursions, tabchar ) {
	if( !DEBUG ) return;
	if( typeof tabchar != "string" ) tabchar ="\t";
	if( typeof maxrecursions != "number" ) maxrecursions = DumpDefaultMaximalRecursions;
	var s = dump_type(obj, "", maxrecursions, tabchar);
	if( typeof div == "string" ) {
		var debugArea = document.getElementById( div );
		if( debugArea ) debugArea.innerHTML = html_entity_decode( document.getElementById(div).innerHTML)+"<xmp>"+s+"</xmp>";
	} else {
		var myXMP = document.createElement("xmp");
		var myText = document.createTextNode(s);
		myXMP.appendChild( myText );

		if( DumpWindow == null ) {
			DumpWindow = window.open( "", "Map24AJAXSDKDebug", "top=5,left=550,width=800,height=600,resizeable=1,scrollbars=1" ); 
			DumpWindow.document.open("text/html");
			DumpWindow.document.writeln("<html><head><title>Dump page</title></head><body><div id=\"debug\"></div></body></html>");
			DumpWindow.document.close();
		}

		if( navigator.userAgent.search(/Opera/)>=0 || navigator.appName=="Microsoft Internet Explorer" ) {
			var tmp = DumpWindow.document.getElementById("debug");
			if( navigator.userAgent.search(/Opera/) ) {
				tmp.innerHTML = tmp.innerHTML + "<xmp>"+s+"</xmp>";
			} else
				tmp.innerHTML = html_entity_decode(tmp.innerHTML) + "<xmp>"+s+"</xmp>";
		} else {
			DumpWindow.document.getElementById("debug").appendChild( myXMP );
 		}
 		try{
			DumpWindow.focus();
		}
		catch(e){}
	}
}

function dump_type( obj, tabs, maxrecursions, tabchar ) {
	var s = "";
	switch( typeof obj ) {
	case "function":	if( DumpFunctions ) s = "function()\r\n";
						break;
	case "undefined":	s = "undefined\r\n"; break;
	case "null":		s = "null\r\n"; break;
	case "number":		s = "number("+obj+")\r\n"; break;
	case "boolean":		s = (obj?"true":"false")+"\r\n"; break;
	case "string":		s = "\""+obj+"\"\r\n"; break;
	case "object":		s = dump_object(obj, tabs, maxrecursions, tabchar, 1); break;
	default:
		s = "native object\r\n";
	}
	return s;
}

function dump_object( obj, tabs, maxrecursions, tabchar, recursion_deepth) {
	var members = 0;
	tabs += tabchar;
	var s = "";
	var objectname = "object";
	for( var key in obj )
	{
		members++;
		if( key == "channel" ) {
			continue;
		}
		if( key == "_class" ) {
			objectname = obj[key];
			continue;
		}
		switch( typeof obj[key] ) {
		case "function":	if( DumpFunctions ) s += tabs+"[\""+key+"\"] => function()\r\n";
							break;
		case "undefined":	s += tabs+"[\""+key+"\"] => undefined\r\n"; break;
		case "null":		s += tabs+"[\""+key+"\"] => null\r\n"; break;
		case "number":		s += tabs+"[\""+key+"\"] => number("+obj[key]+")\r\n"; break;
		case "boolean":		s += tabs+"[\""+key+"\"] => "+(obj[key]?"true":"false")+"\r\n"; break;
		case "string":		s += tabs+"[\""+key+"\"] => \""+obj[key]+"\"\r\n"; break;
		case "object":
			if( obj[key] == null ) {
				s += tabs+"[\""+key+"\"] => null\r\n"; break;
			} else
			switch( key ) {
			case "Parent":
			case "parent":
				s += tabs+"[\""+key+"\"] => {... skiped, reference to parent object ...}\r\n";
				break;
			case "ownerElement":
				s += tabs+"[\""+key+"\"] => {... skiped, high possibility of beeing already displayed ...}\r\n"; break;
			case "previousSibling":
			case "nextSibling":
				s += tabs+"[\""+key+"\"] => {... same as childNodes of parent, therefore skiped ...}\r\n"; break;
			case "parentNode":
			case "parentBox":
			case "offsetParent":
				s += tabs+"[\""+key+"\"] => {... parent already displayed or not interessting ...}\r\n"; break;
			case "firstChild":
			case "lastChild":
				s += tabs+"[\""+key+"\"] => {... see childNodes ...}\r\n"; break;
			default:
				try {
					if( recursion_deepth <= maxrecursions)
						s += tabs+"[\""+key+"\"] => "+dump_object( obj[key], tabs, maxrecursions, tabchar, (recursion_deepth+1) );
					else
						s += tabs+"[\""+key+"\"] => object(?)\r\n";
					break;
				} catch( e ) {
					s += tabs+"[\""+key+"\"] => native object\r\n";
				}
			}
			break;
		default:
			s += tabs+"[\""+key+"\"] => native object\r\n";
		}
	}
	if( tabs.length > 0 ) tabs = tabs.substr(0, tabs.length-tabchar.length);
	return objectname+"("+members+") {\n"+s+tabs+"}\r\n";
}
*/

Rf.empty = function( value ) {
	if( value == null ) return true;
	switch( typeof value ) {
	case "undefined":
	case "null":
		return true;
	case "number":
		return (value == 0);
	case "boolean":
		return (value == false);
	case "string":
		value = Rf.trim(value);
		if( value.length <= 0 ) return true;
		if( value == "0" ) return true;
		if( value == "+0" ) return true;
		if( value == "-0" ) return true;
		return false;
	}
	return false;
}

Rf.trim = function( text ) {
	if( typeof text != "string" ) return text;
	return text.replace(/\n$/i,"").replace(/\r$/i,"").replace(/^ /i,"").replace(/ $/i,"");
}


Rf.e = function(arg){
	alert(arg);
}

Rf.makeUniqueId = function( len ) {
	if( typeof len == "undefined" ) len = 32;
	if( (typeof len != "number") || (len<=0) || (len>256) ) throw new Map24.Exception.InvalidArgument("The given parameter 'len' is no number, less then 1 or greater then 256!",len,"Map24","makeUniqueId" );
	var unique_id = "";
	while( unique_id.length < len )
		unique_id += ""+((new Date()).getTime())+""+Math.random();
	if( unique_id.length != len ) unique_id = unique_id.substr(0,len);
	return unique_id;
}

Rf.urlencode = function( string ) {
	if( typeof string != "string" ) return string;
	return escape(string);
}

Rf.urldecode = function( string ) {
	if( typeof string != "string" ) return string;
	var r = [];
	var decode_array = {
		'0':0, '1':1, '2':2, '3':3, '4':4, '5':5, '6':6, '7':7,
		'8':8, '9':9, 'a':10, 'b':11, 'c':12, 'd':13, 'e':14, 'f':15
	}
	var c = null;
	for( var i=0; i < string.length; i++ ) {
		c = string.charAt(i);
		if( c=='+' )
			r[r.length++] = ' ';
		else
		if( c=='%' ) {
			if( string.length > i+2 ) {
				var a = decode_array[string.charAt(i+1).toLowerCase()];
				var b = decode_array[string.charAt(i+2).toLowerCase()];
				if( typeof a=="number" && typeof b=="number" ) {
					r[r.length++] = String.fromCharCode( a<<4 + b );
				}
				i+=2;
			}
		} else
			r[r.length++] = c;
	}
	return r.join("");
}

Rf.appendUrl = function( url, args, url_encode ) {
	if( typeof url != "string" ) return url;
	if( typeof url_encode != "boolean" ) url_encode = true;
	if( typeof args != "string" ) {
		var s = "";
		for( var key in args ) {
			if(typeof args[key] != "function"){
				if( url_encode == true )
					s += "&"+key+"="+Rf.urlencode(args[key]);
				else
					s += "&"+key+"="+args[key];
			}
		}
		args = s.substr(1);
	}

	// remove introducing & and ?
	if( args.length <= 0 ) return url;
	while( args.length > 0 && (args.charAt(0)=="?" || args.charAt(0)=="&") ) args = args.substr(1);
	var hasQuestionMark = (url.indexOf("?") >= 0);
	if( hasQuestionMark )
		url += "&"+args;
	else
		url += "?"+args;
	return url;
}

//
Rf.dump = function (obj){
	var request = new rfLoading.Request();
	request.Data = obj.toJSONString();
	request.onSuccess = function() { 
		alert( this.Response ); 
	}
	request.onError = function() { alert("b"); } 
	request.onTimeout = function() { alert("c"); } 
	var conn = new rfLoading.ConnectHTTPXML({ServiceUrl: "backend/rfDump.php"}); 
	conn.sendRequest( request ); 
}

Rf.setError = function(content){
	if(!Rf.dg("rfError")){
		Rf.Session.rfError = Rf.dcDiv(150, 466);
		Rf.Session.rfError.style.width = "160px";
		Rf.Session.rfError.style.display = "none";
		Rf.Session.rfError.style.zIndex = "1000";
		Rf.Session.rfError.style.border = "4px solid #CC0000";
		Rf.Session.rfError.style.backgroundColor = "#EEEEEE";
		Rf.Session.rfError.style.padding = "10px 10px 10px 10px";
		Rf.Session.rfError.id = "rfError";
		
		var table = Rf.dc("table");
		table.cellpadding = "0";
		table.cellspacing = "0";
		table.border = "0";
		table.style.width = "100%";
		Rf.Session.rfError.appendChild(table);
		
			var tbody = Rf.dc("tbody");
			table.appendChild(tbody);
			
				var tr = Rf.dc("tr");
				tbody.appendChild(tr);
			
					var td = Rf.dc("td");
					td.style.textAlign = "center";
					td.style.fontWeight = "bold";
					tr.appendChild(td);
					Rf.Session.rfErrorContent = td;
					
				var tr = Rf.dc("tr");
				tbody.appendChild(tr);
			
					var td = Rf.dc("td");
					td.style.textAlign = "center";
					td.style.paddingTop = "10px";
					td.style.height = "16px";
					tr.appendChild(td);
		
						var okButton = Rf.dc("span");
						okButton.style.backgroundColor = "#CC0000";
						okButton.style.color = "#FFFFFF";
						okButton.style.fontWeight = "bold";
						okButton.style.padding = "3px 6px 3px 6px";
						okButton.style.cursor = "pointer";
						okButton.style.cursor = "hand";
						okButton.innerHTML = "OK";
						okButton.onclick = function(){
							Rf.hideError();
						};
						td.appendChild(okButton);
						
		document.getElementsByTagName("body")[0].appendChild(Rf.Session.rfError);
	}
	Rf.Session.rfErrorContent.innerHTML = content;
	Rf.Session.rfError.style.display = "";
}

Rf.setMessage = function(content){
	if(!Rf.dg("rfMessage")){
		Rf.Session.rfError = Rf.dcDiv(150, 466);
		Rf.Session.rfError.style.width = "160px";
		Rf.Session.rfError.style.display = "none";
		Rf.Session.rfError.style.zIndex = "1000";
		Rf.Session.rfError.style.border = "4px solid #000000";
		Rf.Session.rfError.style.backgroundColor = "#EEEEEE";
		Rf.Session.rfError.style.padding = "10px 10px 10px 10px";
		Rf.Session.rfError.id = "rfMessage";
		
		var table = Rf.dc("table");
		table.cellpadding = "0";
		table.cellspacing = "0";
		table.border = "0";
		table.style.width = "100%";
		Rf.Session.rfError.appendChild(table);
		
			var tbody = Rf.dc("tbody");
			table.appendChild(tbody);
			
				var tr = Rf.dc("tr");
				tbody.appendChild(tr);
			
					var td = Rf.dc("td");
					td.style.textAlign = "center";
					td.style.fontWeight = "bold";
					tr.appendChild(td);
					Rf.Session.rfErrorContent = td;
					
				var tr = Rf.dc("tr");
				tbody.appendChild(tr);
			
					var td = Rf.dc("td");
					td.style.textAlign = "center";
					td.style.paddingTop = "10px";
					td.style.height = "16px";
					tr.appendChild(td);
		
						var okButton = Rf.dc("span");
						okButton.style.backgroundColor = "#000000";
						okButton.style.color = "#FFFFFF";
						okButton.style.fontWeight = "bold";
						okButton.style.padding = "3px 6px 3px 6px";
						okButton.style.cursor = "pointer";
						okButton.style.cursor = "hand";
						okButton.innerHTML = "OK";
						okButton.onclick = function(){
							Rf.hideError();
						};
						td.appendChild(okButton);
						
		document.getElementsByTagName("body")[0].appendChild(Rf.Session.rfError);
	}
	Rf.Session.rfErrorContent.innerHTML = content;
	Rf.Session.rfError.style.display = "";
}

Rf.dcTable = function(){
	var table = Rf.dc("table");
	table.cellpadding = "0";
	table.cellspacing = "0";
	table.border = "0";
	table.style.width = "100%";
	table.style.margin = "0px";
	table.style.padding = "0px";
	
	return table;
}

Rf.hideError = function(){
	if(!Rf.empty(Rf.Session.rfError)){
		Rf.Session.rfError.style.display = "none";
	}
}

Rf.getReadableDateTime = function(dbDate, weekdayId){
	var dateTimeArray = dbDate.split(" ");
	var dateArray = dateTimeArray[0].split("-");
	var timeArray = dateTimeArray[1].split(":");
	var dateTimeString = dateArray[2]+"."+dateArray[1]+"."+dateArray[0]+" "+timeArray[0]+":"+timeArray[1];
	if(typeof parseInt(weekdayId) == "number"){
		dateTimeString = Rf.Config.weekdays[parseInt(weekdayId)]+", "+dateTimeString;
	}
	return dateTimeString;
}

Rf.getComparableDateTime = function(dbDate){
	var dateTimeArray = dbDate.split(" ");
	var dateArray = dateTimeArray[0].split("-");
	var timeArray = dateTimeArray[1].split(":");
	var dateTimeString = dateArray[0]+""+dateArray[1]+""+dateArray[2]+""+timeArray[0]+""+timeArray[1];
	return parseInt(dateTimeString);
}

Rf.getDateTimeArray = function(datetimeString){
	var dateTimeArray = datetimeString.split(" ");
	var dateArray = dateTimeArray[0].split("-");
	var timeArray = dateTimeArray[1].split(":");
	for(var i=0; i<dateArray.length; i++){
		dateArray[i] = parseInt(dateArray[i]);
	}
	for(var i=0; i<timeArray.length; i++){
		dateArray.push(parseInt(timeArray[i]));
	}
	return dateArray;
}

Rf.getReadableDate = function(dbDate, weekdayId){
	var dateTimeArray = dbDate.split(" ");
	var dateArray = dateTimeArray[0].split("-");
	var dateString = dateArray[2]+"."+dateArray[1]+"."+dateArray[0];
	if(typeof weekdayId != "undefined" && typeof parseInt(weekdayId) == "number"){
		dateString = Rf.Config.weekdays[parseInt(weekdayId)]+", "+dateString;
	}
	return dateString;
}

Rf.getReadableDateTime = function(dbDate, weekdayId){
	var dateTimeArray = dbDate.split(" ");
	var dateArray = dateTimeArray[0].split("-");
	var timeArray = dateTimeArray[1].split(":");
	var dateString = dateArray[2]+"."+dateArray[1]+"."+dateArray[0]+"&nbsp;&nbsp;"+timeArray[0]+":"+timeArray[1]+" Uhr";
	if(typeof parseInt(weekdayId) == "number"){
		dateString = Rf.Config.weekdays[parseInt(weekdayId)]+", "+dateString;
	}
	return dateString;
}

Rf.getReadableTimeShort = function(dbDate){
	var dateTimeArray = dbDate.split(" ");
	var dateArray = dateTimeArray[0].split("-");
	var timeArray = dateTimeArray[1].split(":");
	var timeString = timeArray[0]+":"+timeArray[1];
	return timeString;
}

Rf.getReadableDateTimeFlex = function(dbDate, weekdayId){
	var dateTimeArray = dbDate.split(" ");
	var dateArray = dateTimeArray[0].split("-");
	var timeArray = dateTimeArray[1].split(":");
	var dateString = dateArray[2]+"."+dateArray[1]+"."+dateArray[0];
	if(timeArray[0] != "00" || timeArray[1] != "00"){
		dateString += "&nbsp;&nbsp;"+timeArray[0]+":"+timeArray[1]+" Uhr";
	}
	if(typeof parseInt(weekdayId) == "number"){
		dateString = Rf.Config.weekdays[parseInt(weekdayId)]+", "+dateString;
	}
	return dateString;
}

Rf.getReadableDateShort = function(dbDate, weekdayId){
	var dateTimeArray = dbDate.split(" ");
	var dateArray = dateTimeArray[0].split("-");
	var dateString = dateArray[2]+"."+dateArray[1]+"."+dateArray[0];
	if(typeof parseInt(weekdayId) == "number"){
		dateString = Rf.Config.weekdays[parseInt(weekdayId)].substr(0,2)+", "+dateString;
	}
	return dateString;
}

Rf.getIMGButton = function(imageURL){
	var div = Rf.dc("div");
	div.style.position = "absolute";
	div.style.top = "0px";
	div.style.left = "0px";
	div.style.width = "20px";
	div.style.height = "20px";
	div.style.cursor = "pointer";
	div.style.cursor = "hand";
	div.style.backgroundImage = "url('images/common/bgimgbutton_std.gif')";
	div.onmouseover = function(){
		this.style.backgroundImage = "url('images/common/bgimgbutton_ov.gif')";
		//Rf.setInfo
	};
	div.onmouseout = function(){
		this.style.backgroundImage = "url('images/common/bgimgbutton_std.gif')";
	};
		var img = Rf.dc("img");
		img.src = imageURL;
		img.style.position = "absolute";
		img.style.top = "2px";
		img.style.left = "2px";
		img.style.width = "16px";
		img.style.height = "16px";
		div.appendChild(img);
	return div;
}

Rf.getPopUpForm = function(width, label){
	var leftSize = 484;
	leftSize = leftSize - (width/2);
	var div = Rf.dc("div");
	div.className = "popupForm";
	div.style.left = leftSize+"px";
	div.style.width = width+"px";
	div.style.display = "none";
	div.style.zIndex = "1000";
	
	var labelDiv = Rf.dc("div");
	labelDiv.style.position = "relative";
	labelDiv.style.top = "0px";
	labelDiv.style.left = "0px";
	labelDiv.style.padding = "5px 4px 9px 6px";
	labelDiv.style.backgroundColor = "#000000";
	labelDiv.style.fontWeight = "bold";
	labelDiv.style.color = "#FFFFFF";
	labelDiv.style.width = "auto";
	labelDiv.innerHTML = label;
	div.appendChild(labelDiv);
	
	var closeButton = Rf.getIMGButton("images/common/cancel.png");
	closeButton.style.top = "3px";
	closeButton.style.right = "3px";
	closeButton.style.left = "";
	closeButton.popupForm = div;
	//closeButton.style.zIndex = 1;
	closeButton.onclick = function(){
		this.popupForm.style.display = "none";
	};
	div.appendChild(closeButton);
	div.closeButton = closeButton;
	return div;
}

//dist in meters
Rf.getHumanDistance = function(dist){
	var res = "";
	if(dist >= 1000){
		dist = Math.round((dist/1000*10))/10;
		res = dist + " km";
		res = res.replace(".", ",");
	}
	else{
		res = dist + " m";
	}
	return res;
}

//time in seconds
Rf.getHumanTime = function(time){
	var res = "";
	if(time<60){
		res = "< 1 min";
	}
	else if(time <3600){
		res = Math.round(time/60)+" min";
	}
	else{
		var h = parseInt(time/3600);
		var min = Math.round((time%3600)/60);
		res = h+" h, "+min+" min";
	}
	return res;
}

//divID
Rf.CAuth = function(aH){
	this.userId = 0;
	this.username = "";
	this.password = "";
	this.password_raw = "";
	this.divID = aH.divID;
	this.createLoginForm(aH);
	this.createChangeForm();
	this.createLogoutForm(aH);
	this.showContainer({name:"loginForm"});
}

/*
 * <table cellpadding="0" cellspacing="0" border="0"><tbody>
		<tr>
		<td style="padding-left:12px; padding-right:13px; padding-bottom:4px;">
			<input type="text" id="rfLoginName" value="Benutzername" style="width:120px;"/>
		</td>
		</tr>
		<tr>
		<td style="padding-left:12px; padding-right:13px; padding-bottom:4px;">
			<input type="password" id="rfLoginPassword" value="Passwort" style="width:120px;"/>
		</td>
		</tr>
		<tr>
		<td style="padding-left:80px; padding-right:13px;">
			<div class="button" style="width:50px;" onclick="rfUser.login();">Login</div>
		</td>
		</tr>
		</tbody></table>
 * */

Rf.CAuth.prototype.divID = null;
Rf.CAuth.prototype.loggedIn = false;
Rf.CAuth.prototype.userId = null;
Rf.CAuth.prototype.name = null;
Rf.CAuth.prototype.firstname = null;
Rf.CAuth.prototype.email = null;
Rf.CAuth.prototype.username = null;
Rf.CAuth.prototype.password = null;
Rf.CAuth.prototype.password_raw = null;

Rf.CAuth.prototype.containers = {};
Rf.CAuth.prototype.containers.loginForm = null;

Rf.CAuth.prototype.nodes = {};
Rf.CAuth.prototype.nodes.inputfieldUsername = null;
Rf.CAuth.prototype.nodes.iputfieldPassword = null;
Rf.CAuth.prototype.nodes.textError = null;

//divID
Rf.CAuth.prototype.createLoginForm = function(aH){
	this.containers.loginForm = Rf.dc("div");
	this.containers.loginForm.style.display = "none";
	this.containers.loginForm.id = "rfauth_LoginForm";
/*	
	this.nodes.textError = Rf.dc("div");
	this.nodes.textError.style.position = "absolute";
	this.nodes.textError.style.top = "6px";
	this.nodes.textError.style.left = "10px";
	this.nodes.textError.style.width = "280px";
	this.nodes.textError.style.color = "#AA0000";
	this.nodes.textError.id = "rfauth_textError";
*/
	this.nodes.inputfieldUsername = Rf.dc("input");
	this.nodes.inputfieldUsername.style.top = "0px";
	this.nodes.inputfieldUsername.id = "rfauth_InputfieldUsername";
	this.nodes.inputfieldUsername.className = "rfAuth_inputfield";
	this.nodes.inputfieldUsername.type = "text";
	this.nodes.inputfieldUsername.value = "Benutzername";

	this.nodes.inputfieldPassword = Rf.dc("input");
	this.nodes.inputfieldPassword.style.top = "26px";
	this.nodes.inputfieldPassword.id = "rfauth_InputfieldPassword";
	this.nodes.inputfieldPassword.className = "rfAuth_inputfield";
	this.nodes.inputfieldPassword.type = "password";
	this.nodes.inputfieldPassword.value = "Passwort";
	

	this.nodes.submitLogin = Rf.dc("div");
	this.nodes.submitLogin.style.top = "52px";
	this.nodes.submitLogin.style.left = "79px";
	this.nodes.submitLogin.id = "rfauth_SubmitLogin";
	this.nodes.submitLogin.className = "rfAuth_submit";
	this.nodes.submitLogin.innerHTML = "Login";
	this.nodes.submitLogin.auth = this;
	this.nodes.submitLogin.onclick = function(){this.auth.login();};
	
//	this.containers.loginForm.appendChild(this.nodes.textError);
	this.containers.loginForm.appendChild(this.nodes.inputfieldUsername);
	this.containers.loginForm.appendChild(this.nodes.inputfieldPassword);
	this.containers.loginForm.appendChild(this.nodes.submitLogin);
	Rf.dg(this.divID).appendChild(this.containers.loginForm);
}

Rf.CAuth.prototype.createChangeForm = function(aH){
	this.containers.changeForm = Rf.dc("div");
	this.containers.changeForm.style.display = "none";
	this.containers.changeForm.style.zIndex = "200";
	this.containers.changeForm.id = "rfauth_ChangeForm";
	
	this.nodes.changeText = Rf.dc("div");
	this.nodes.changeText.className = "rfAuth_inputformLabel";
	this.nodes.changeText.style.top = "20px";
	this.nodes.changeText.style.left = "20px";
	this.nodes.changeText.innerHTML = "Du kannst nun deine Daten &auml;ndern...";
	
	this.nodes.changeLabelUsername = Rf.dc("div");
	this.nodes.changeLabelUsername.className = "rfAuth_inputformLabel";
	this.nodes.changeLabelUsername.style.top = "50px";
	this.nodes.changeLabelUsername.style.left = "20px";
	this.nodes.changeLabelUsername.innerHTML = "Benutzername:";

	this.nodes.changeInputUsername = Rf.dc("input");
	this.nodes.changeInputUsername.style.top = "68px";
	this.nodes.changeInputUsername.style.left = "20px";
	this.nodes.changeInputUsername.id = "rfauth_InputfieldUsername";
	this.nodes.changeInputUsername.className = "rfAuth_inputfield";
	this.nodes.changeInputUsername.type = "text";

	this.nodes.changeLabelPassword = Rf.dc("div");
	this.nodes.changeLabelPassword.style.top = "100px";
	this.nodes.changeLabelPassword.style.left = "20px";
	this.nodes.changeLabelPassword.className = "rfAuth_inputformLabel";
	this.nodes.changeLabelPassword.innerHTML = "Passwort:";
	
	this.nodes.changeInputPassword = Rf.dc("input");
	this.nodes.changeInputPassword.style.top = "118px";
	this.nodes.changeInputPassword.style.left = "20px";
	this.nodes.changeInputPassword.id = "rfauth_InputfieldPassword";
	this.nodes.changeInputPassword.className = "rfAuth_inputfield";
	this.nodes.changeInputPassword.type = "password";
	
	this.nodes.changeLabelPassword2 = Rf.dc("div");
	this.nodes.changeLabelPassword2.style.top = "100px";
	this.nodes.changeLabelPassword2.style.left = "160px";
	this.nodes.changeLabelPassword2.className = "rfAuth_inputformLabel";
	this.nodes.changeLabelPassword2.innerHTML = "Passwort (Wdh.):";
	
	this.nodes.changeInputPassword2 = Rf.dc("input");
	this.nodes.changeInputPassword2.style.top = "118px";
	this.nodes.changeInputPassword2.style.left = "160px";
	this.nodes.changeInputPassword2.id = "rfauth_InputfieldPassword2";
	this.nodes.changeInputPassword2.className = "rfAuth_inputfield";
	this.nodes.changeInputPassword2.type = "password";
	
	this.nodes.changeLabelFirstname = Rf.dc("div");
	this.nodes.changeLabelFirstname.style.top = "150px";
	this.nodes.changeLabelFirstname.style.left = "20px";
	this.nodes.changeLabelFirstname.className = "rfAuth_inputformLabel";
	this.nodes.changeLabelFirstname.innerHTML = "Vorname:";
	
	this.nodes.changeInputFirstname = Rf.dc("input");
	this.nodes.changeInputFirstname.style.top = "168px";
	this.nodes.changeInputFirstname.style.left = "20px";
	this.nodes.changeInputFirstname.id = "rfauth_InputfieldFirstname";
	this.nodes.changeInputFirstname.className = "rfAuth_inputfield";
	this.nodes.changeInputFirstname.type = "text";
	
	this.nodes.changeLabelName = Rf.dc("div");
	this.nodes.changeLabelName.style.top = "150px";
	this.nodes.changeLabelName.style.left = "160px";
	this.nodes.changeLabelName.className = "rfAuth_inputformLabel";
	this.nodes.changeLabelName.innerHTML = "Name:";
	
	this.nodes.changeInputName = Rf.dc("input");
	this.nodes.changeInputName.style.top = "168px";
	this.nodes.changeInputName.style.left = "160px";
	this.nodes.changeInputName.id = "rfauth_InputfieldName";
	this.nodes.changeInputName.className = "rfAuth_inputfield";
	this.nodes.changeInputName.type = "text";
	
	this.nodes.changeLabelEmail = Rf.dc("div");
	this.nodes.changeLabelEmail.style.top = "200px";
	this.nodes.changeLabelEmail.style.left = "20px";
	this.nodes.changeLabelEmail.className = "rfAuth_inputformLabel";
	this.nodes.changeLabelEmail.innerHTML = "e-Mail:";
	
	this.nodes.changeInputEmail = Rf.dc("input");
	this.nodes.changeInputEmail.style.top = "218px";
	this.nodes.changeInputEmail.style.left = "20px";
	this.nodes.changeInputEmail.id = "rfauth_InputfieldEmail";
	this.nodes.changeInputEmail.className = "rfAuth_inputfield";
	this.nodes.changeInputEmail.type = "text";
	
	this.nodes.changeSubmit = Rf.dc("div");
	this.nodes.changeSubmit.style.top = "266px";
	this.nodes.changeSubmit.style.left = "98px";
	this.nodes.changeSubmit.id = "rfauth_SubmitChangeData";
	this.nodes.changeSubmit.className = "rfAuth_submit";
	this.nodes.changeSubmit.innerHTML = "Daten speichern";
	this.nodes.changeSubmit.auth = this;
	this.nodes.changeSubmit.onclick = function(){this.auth.changeData();};
	
	this.containers.changeForm.appendChild(this.nodes.changeText);
	this.containers.changeForm.appendChild(this.nodes.changeLabelUsername);
	this.containers.changeForm.appendChild(this.nodes.changeInputUsername);
	this.containers.changeForm.appendChild(this.nodes.changeLabelPassword);
	this.containers.changeForm.appendChild(this.nodes.changeInputPassword);
	this.containers.changeForm.appendChild(this.nodes.changeLabelPassword2);
	this.containers.changeForm.appendChild(this.nodes.changeInputPassword2);
	this.containers.changeForm.appendChild(this.nodes.changeLabelFirstname);
	this.containers.changeForm.appendChild(this.nodes.changeInputFirstname);
	this.containers.changeForm.appendChild(this.nodes.changeLabelName);
	this.containers.changeForm.appendChild(this.nodes.changeInputName);
	this.containers.changeForm.appendChild(this.nodes.changeLabelEmail);
	this.containers.changeForm.appendChild(this.nodes.changeInputEmail);
	this.containers.changeForm.appendChild(this.nodes.changeSubmit);
	
	document.getElementsByTagName("body")[0].appendChild(this.containers.changeForm);
}

//divID
Rf.CAuth.prototype.createLogoutForm = function(aH){
	this.containers.logoutForm = Rf.dc("div");
	this.containers.logoutForm.style.position = "absolute";
	this.containers.logoutForm.style.top = "0px";
	this.containers.logoutForm.style.right = "0px";
	this.containers.logoutForm.style.display = "none";
	this.containers.logoutForm.style.height = "60px";
	this.containers.logoutForm.id = "rfauth_LogoutForm";
	
	var table = Rf.dc("table");
	table.style.height = "100%";
	table.style.width = "100%";
	var tbody = Rf.dc("tbody");
	table.appendChild(tbody);
	var tr = Rf.dc("tr");
	tbody.appendChild(tr);
	var td = Rf.dc("td");
	td.style.textAlign = "center";
	td.style.verticalAlign = "middle";
	tr.appendChild(td);
	
	this.nodes.submitLogout = Rf.dc("div");
	this.nodes.submitLogout.id = "rfauth_SubmitLogout";
	this.nodes.submitLogout.className = "rfAuth_submit";
	this.nodes.submitLogout.auth = this;
	this.nodes.submitLogout.onclick = function(){this.auth.logout();};
	td.appendChild(this.nodes.submitLogout);
	
	var span = Rf.dc("span");
	span.innerHTML = "Logout";
	this.nodes.submitLogout.appendChild(span);
	var br = Rf.dc("br");
	this.nodes.submitLogout.appendChild(br);
	var span = Rf.dc("span");
	span.innerHTML = "(";
	this.nodes.submitLogout.appendChild(span);
	
	this.nodes.submitLogoutName = Rf.dc("span");
	this.nodes.submitLogout.appendChild(this.nodes.submitLogoutName);
	
	var span = Rf.dc("span");
	span.innerHTML = ")";
	this.nodes.submitLogout.appendChild(span);

	this.containers.logoutForm.appendChild(table);
	
	Rf.dg(aH.divID).appendChild(this.containers.logoutForm);
}

//name
Rf.CAuth.prototype.showContainer = function(aH){
	for(var key in this.containers){
		if(typeof this.containers[key] != "function"){
			this.containers[key].style.display = "none";
		}
	}
	
	switch(aH.name){
		case "logoutForm":{
			this.containers["logoutForm"].style.display = "";
			this.containers["loginForm"].style.display = "none";
			break;
		}
		case "loginForm":{
			this.containers["loginForm"].style.display = "";
			this.containers["logoutForm"].style.display = "none";
			break;
		}
		case "changeForm":{
			this.containers["changeForm"].style.display = "";
			break;
		}
		default:{
			break;
		}
	}
	
	
}

//node
Rf.CAuth.prototype.showNode = function(aH){
	aH.node.style.display = "";
}

//node
Rf.CAuth.prototype.hideNode = function(aH){
	aH.node.style.display = "none";
}

Rf.CAuth.prototype.logout = function(){
	this.loggedIn = false;
	this.userId = 0;
	this.name = null;
	this.firstname = null;
	this.email = null;
	this.username = "";
	this.password = "";
	this.showContainer({name:"loginForm"});
	this.nodes.submitLogoutName.innerHTML = "";
	Rf.Session.mainContent.reset();
}

Rf.CAuth.prototype.login = function(){
	if(this.nodes.inputfieldUsername.value == "" || this.nodes.inputfieldUsername.value == "Benutzername"){
		Rf.setError("Kein Benutzername angegeben!");
		return false;
	}
	if(this.nodes.inputfieldPassword.value == "" || this.nodes.inputfieldPassword.value == "Passwort"){
		Rf.setError("Kein Passwort angegeben!");
		return false;
	}
	
	var request = new Rf.Loading.CRequest();
	request.Data = {
		action:"login",
		username:this.nodes.inputfieldUsername.value,
		password:md5(this.nodes.inputfieldPassword.value)
	};
	request.auth = this;
	request.onSuccess = function() {
		if(!Rf.empty(this.Response.error)){
			Rf.setError(this.Response.error);
		}
		else{
			this.auth.loggedIn = true;
			this.auth.userId = this.Response.userdata.id;
			this.auth.name = this.Response.userdata.name;
			this.auth.firstname = this.Response.userdata.firstname;
			this.auth.email = this.Response.userdata.email;
			this.auth.username = this.Response.userdata.username;
			this.auth.password = this.Data.password;
			this.auth.password_raw = this.auth.nodes.inputfieldPassword.value;
			if(this.Response.userdata.requireuserchange == 1){
				this.auth.nodes.changeInputUsername.value = this.auth.username;
				this.auth.nodes.changeInputPassword.value = this.auth.nodes.inputfieldPassword.value;
				this.auth.nodes.changeInputPassword2.value = this.auth.nodes.inputfieldPassword.value;
				this.auth.nodes.changeInputFirstname.value = this.auth.firstname;
				this.auth.nodes.changeInputName.value = this.auth.name;
				this.auth.nodes.changeInputEmail.value = this.auth.email;
				this.auth.showContainer({name:"changeForm"});
			}
			else{
				this.auth.nodes.submitLogoutName.innerHTML = this.auth.firstname+" "+this.auth.name;
				this.auth.showContainer({name:"logoutForm"});
				Rf.Session.mainContent.reset();
			}
		}
	}
	request.onError = function() { alert("b"); } 
	request.onTimeout = function() { alert("c"); } 
	var conn = new Rf.Loading.CConnectHTTPXML({ServiceUrl: "backend/rfAuth.php"}); 
	conn.sendRequest( request );
}


Rf.CAuth.prototype.changeData = function(){
	if(this.nodes.changeInputUsername.value == ""){
		Rf.setError("Kein Benutzername angegeben!");
		return false;
	}
	if(this.nodes.changeInputPassword.value != this.nodes.changeInputPassword2.value){
		Rf.setError("Passw&ouml;rter nicht identisch!");
		return false;
	}
	if(this.nodes.changeInputPassword.value == ""){
		Rf.setError("Kein Passwort angegeben!");
		return false;
	}
	
	this.username = this.nodes.changeInputUsername.value;
	this.password = md5(this.nodes.changeInputPassword.value);
	this.password_raw = this.nodes.changeInputPassword.value;
	this.firstname = this.nodes.changeInputFirstname.value;
	this.name = this.nodes.changeInputName.value;
	this.email = this.nodes.changeInputEmail.value;
	
	var request = new Rf.Loading.CRequest();
	request.auth = this;
	request.Data = {
		action:"changeData",
		id:this.userId,
		username:this.username,
		password:this.password,
		name:this.name,
		firstname:this.firstname,
		email:this.email
	};
	request.onSuccess = function() {
		if(!Rf.empty(this.Response.error)){
			Rf.setError(this.Response.error);
		}
		else{
			this.auth.nodes.submitLogoutName.innerHTML = this.auth.firstname+" "+this.auth.name;
			this.auth.showContainer({name:"logoutForm"});
			Rf.Session.mainContent.reset();
		}
	}
	request.onError = function() { alert("b"); } 
	request.onTimeout = function() { alert("c"); } 
	var conn = new Rf.Loading.CConnectHTTPXML({ServiceUrl: "backend/rfAuth.php"}); 
	conn.sendRequest( request );
}
//divID 
Rf.CContent = function(aH){
	this.Nodes = {};
	this.RegisteredModules = {};
	this.LoadedModules = {};
	this.NaviItemDivs = {};
	this.RfAuth = aH.auth;
	
	if(Rf.CContent._Instances == null){
		Rf.CContent._Instances = [];
	}
	
	this.InstanceId = Rf.CContent._Instances.length;
	Rf.CContent._Instances.push(this);

	
	this.SiteIndicatorsDIV = Rf.dc("div");
	this.SiteIndicatorsDIV.style.position = "absolute";
	this.SiteIndicatorsDIV.style.top = "49px";
	this.SiteIndicatorsDIV.style.left = "187px";
	this.SiteIndicatorsDIV.style.height = "107px";
	
		var line = Rf.dc("div");
		line.style.position = "relative";
		line.style.top = "91px";
		line.style.left = "0px";
		line.style.width = "100%";
		line.style.height = "3px";
		line.style.lineHeight = "0px";
		line.style.lineHeight = "100px";
		line.style.fontSize = "0px";
		line.style.backgroundColor = "#AA0000";
		this.SiteIndicatorsDIV.appendChild(line);
	document.getElementsByTagName("body")[0].appendChild(this.SiteIndicatorsDIV);

	this.WholeContentDIV = Rf.dc("div");
	this.WholeContentDIV.style.position = "relative";
	this.WholeContentDIV.style.top = "0px";
	this.WholeContentDIV.style.left = "0px";
	this.WholeContentDIV.style.overflow = "hidden";
	
	this.OuterDIV = Rf.dc("div");
	this.OuterDIV.style.position = "absolute";
	this.OuterDIV.style.top = "0px";
	this.OuterDIV.style.left = "0px";
	this.OuterDIV.style.overflow = "auto";
	//this.OuterDIV.style.width = "100%";

						this.DIV = Rf.dc("div");
						this.DIV.style.position = "absolute";
						this.DIV.style.top = "0px";
						this.DIV.style.left = "0px";
						//this.DIV.style.width = "95%";
						this.OuterDIV.appendChild(this.DIV);
						
				
	//this.Div.style.zIndex = "100";
	//this.Div.style.top = "0px";
	//this.Div.style.left = "0px";
	this.WholeContentDIV.appendChild(this.OuterDIV);
	Rf.dg(aH.divID).appendChild(this.WholeContentDIV);
	//this.createSiteIndicator();

}
Rf.CContent.prototype.InstanceId = null;
Rf.CContent._Instances = null;

Rf.CContent.prototype.RegisteredModules = null;
Rf.CContent.prototype.LoadedModules = null;

Rf.CContent.prototype.CurrentActiveModule = null;

Rf.CContent.prototype.NaviItemDivs = null;

Rf.CContent.prototype.DivWidth = 0;
Rf.CContent.prototype.DivHeight = 0;
Rf.CContent.prototype.Div = null;

Rf.CContent.prototype.UserID = 0;

Rf.CContent.prototype.RfAuth = null;

Rf.CContent.prototype.Nodes = null;

Rf.CContent.DateImagesActive = {	TENNIS: "images/common/sport_tennis1.gif",
							WORK: "images/common/wrench1.gif",
							FOOD: "images/common/food1.gif"
};

Rf.CContent.DateImagesDisabled = {	TENNIS: "images/common/sport_tennis0.gif",
							WORK: "images/common/wrench0.gif",
							FOOD: "images/common/food0.gif"
};

//{Rf.CModule} module, name
Rf.CContent.prototype.show = function(aH){
	aH.cI = aH.cI.toLowerCase();
	var cIArray = aH.cI.split("|");
	
	//workaround FF
	this.OuterDIV.style.overflow = "hidden";

	if(!Rf.empty(this.RegisteredModules[cIArray[0]])){
		if(!Rf.empty(this.LoadedModules[cIArray[0]])){
			this.setActiveModule({name: cIArray[0]});
		}
		else{
			this.setActiveModule({name: cIArray[0]});
			this.LoadedModules[cIArray[0]] = new Rf[this.RegisteredModules[cIArray[0]]["classname"]]({content:this});
		}
	}

	for(var moduleName in this.LoadedModules){
		this.LoadedModules[moduleName].disable();
	}
	
	//workaround FF
	setTimeout("Rf.CContent.setOverflow("+this.InstanceId+", 'auto')", 10);
	
	this.LoadedModules[cIArray[0]].enable();
	this.LoadedModules[cIArray[0]].showPart({cI:aH.cI});
	
	
}
/*
Rf.CContent.prototype.createSiteIndicator = function(){
	this.Nodes.SiteIndicatorDIV = Rf.dc("div");
	this.Nodes.SiteIndicatorDIV.style.position = "absolute";
	this.Nodes.SiteIndicatorDIV.style.top = "110px";
	this.Nodes.SiteIndicatorDIV.style.left = "146px";
	this.Nodes.SiteIndicatorDIV.style.overflow = "hidden";
	this.Nodes.SiteIndicatorDIV.style.width = "160px";
	this.Nodes.SiteIndicatorDIV.style.height = "35px";
		this.Nodes.SiteIndicatorIMGDIV = Rf.dc("div");
		this.Nodes.SiteIndicatorIMGDIV.style.position = "absolute";
		this.Nodes.SiteIndicatorIMGDIV.style.top = "0px";
		this.Nodes.SiteIndicatorIMGDIV.style.left = "-30px";
		//this.Nodes.SiteIndicatorIMGDIV.style.left = "-166px";
		this.Nodes.SiteIndicatorIMGDIV.innerHTML = "<img src=\"images/common/site_indicator.gif\" style=\"width:180px; height:35px\" />";
		this.Nodes.SiteIndicatorLabelDIV = Rf.dc("div");
		this.Nodes.SiteIndicatorLabelDIV.style.position = "absolute";
		this.Nodes.SiteIndicatorLabelDIV.style.top = "9px";
		this.Nodes.SiteIndicatorLabelDIV.style.right = "40px";
		this.Nodes.SiteIndicatorLabelDIV.style.color = "#DDDDDD";
		this.Nodes.SiteIndicatorLabelDIV.style.fontWeight = "bold";
		this.Nodes.SiteIndicatorLabelDIV.style.fontSize = "14px";
		this.Nodes.SiteIndicatorLabelDIV.style.fontFamily = "Arial";
		//this.Nodes.SiteIndicatorLabelDIV.style.width = "160px";
		this.Nodes.SiteIndicatorLabelDIV.innerHTML = "News";
	this.Nodes.SiteIndicatorDIV.appendChild(this.Nodes.SiteIndicatorIMGDIV);
	this.Nodes.SiteIndicatorDIV.appendChild(this.Nodes.SiteIndicatorLabelDIV);
	
	document.getElementsByTagName("body")[0].appendChild(this.Nodes.SiteIndicatorDIV);
}
*/
/*
Rf.CContent.showMainContent = function(aH){
	var pageArray = aH.page.split("_", 2);
	
	aH.url = __HTTP_SOURCE__+'modules/RFContent/maincontents/'+pageArray[0]+'.js';
	aH.callback = 'RFContent.replaceMainContentArea';
	aH.callbackParams = {};
	aH.callbackParams.mainContentDivId = rfConfig.mainContentDivId;
	
	if(isString(pageArray[1])){
		aH.callbackParams.page = pageArray[1];
	}
	rfLoading.requireJScript(aH);

	//dg(rfConfig.mainContentDivId).innerHTML = content;
}

Rf.CContent.replaceMainContentArea = function(aH){
	var content = '';
	content = RFContent[pageArray[0]].generate(aH);
	dg(aH.mainContentDivId).innerHTML = aH.content;
}

Rf.CContent.show = function(contentpart){
	if(!dg('rfMainContent_'+contentpart)){
		rfLoading.requireJScriptFile({file:'./contentparts/'+contentpart+'.js', callback:'Rf.CContent.init_'+contentpart});
	}
	else{
		setVisibility('rfMainContent_'+contentpart, 'block');
	}
}

Rf.CContent.hide = function(contentpart){
	if(!dg('rfMainContent_'+contentpart)){
		rfLoading.requireJScriptFile({file:'./contentparts/'+contentpart+'.js', callback:'Rf.CContent.init_'+contentpart});
	}
	else{
		setVisibility('rfMainContent_'+contentpart, 'none');
	}
}

Rf.CContent.createMainContentNode = function(id){
	var newNode = dc('div', '', id);
	newNode.name = 'rfMainContentNode';
	newNode.style.display = 'none';
	dg('rfMainContent').appendChild(newNode);
}
*/
//divID
Rf.CContent.prototype.initMainNavi = function(aH){
	var output = '';
	for(var moduleName in this.RegisteredModules){
		this.NaviItemDivs[moduleName] = Rf.dc("div", "rfMainNavi_std");
		if(this.CurrentActiveModule == moduleName){
			this.NaviItemDivs[moduleName].className = "rfMainNavi_act";
		}
		this.NaviItemDivs[moduleName].RfContent = this;
		this.NaviItemDivs[moduleName].moduleName = moduleName;
		this.NaviItemDivs[moduleName].onclick = function(){
			this.RfContent.show({cI:this.moduleName});
		};
		this.NaviItemDivs[moduleName].onmouseover = function(){
			if(this.moduleName == this.RfContent.CurrentActiveModule){
				this.className = "rfMainNavi_act";
			}
			else{
				this.className = "rfMainNavi_ov";	
			}
		};
		this.NaviItemDivs[moduleName].onmouseout = function(){
			if(this.moduleName == this.RfContent.CurrentActiveModule){
				this.className = "rfMainNavi_act";
			}
			else{
				this.className = "rfMainNavi_std";	
			}
		};
		this.NaviItemDivs[moduleName].innerHTML = this.RegisteredModules[moduleName].label;
		Rf.dg(aH.divID).appendChild(this.NaviItemDivs[moduleName]);
	}
	/*i<rfConfig.mainContents.length; i++){
		this.NaviItems[]
		output += '<div onclick="Rf.CContent.show(\''+rfConfig.mainContents[i].NAME+'\')" id="rfMainNavi_'+rfConfig.mainContents[i].NAME+'" class="rfMainNavi_std" onmouseover="rfDom.setMainNaviClass(\'rfMainNavi_'+rfConfig.mainContents[i].NAME+'\', \'ov\');" onmouseout="rfDom.setMainNaviClass(\'rfMainNavi_'+rfConfig.mainContents[i].NAME+'\', \'std\');">'+rfConfig.mainContents[i].LABEL+'</div>';
	}
	* */
	//dg(aH.divID).innerHTML += output;
}

//divID
Rf.CContent.prototype.createSIB = function(aH){
	this.Nodes.SIBContentDIV = Rf.dc("div");
	this.Nodes.SIBContentDIV.style.position = "absolute";
	this.Nodes.SIBContentDIV.style.top = "8px";
	this.Nodes.SIBContentDIV.style.left = "400px";
	this.Nodes.SIBContentDIV.style.width = "195px";
	this.WholeContentDIV.appendChild(this.Nodes.SIBContentDIV);
	
	
	this.Nodes.SIBEventsDIV = Rf.dc("div");
	this.Nodes.SIBEventsDIV.style.position = "relative";
	this.Nodes.SIBEventsDIV.style.top = "0px";
	this.Nodes.SIBEventsDIV.style.left = "0px";
	//this.Nodes.SIBEventsDIV.style.height = "100px";
	this.Nodes.SIBEventsDIV.style.width = "195px";
	this.Nodes.SIBEventsDIV.style.backgroundImage = "url('images/common/sib_dates_middle.png')";
	
	this.Nodes.SIBEventsDIVContent = Rf.dc("div");
	this.Nodes.SIBEventsDIVContent.style.position = "relative";
	this.Nodes.SIBEventsDIVContent.style.overflow = "hidden";
	this.Nodes.SIBEventsDIVContent.style.top = "42px";
	this.Nodes.SIBEventsDIVContent.style.left = "10px";
	this.Nodes.SIBEventsDIVContent.style.width = "171px";
	
	var top = Rf.dc("div");
	top.style.position = "absolute";
	top.style.top = "0px";
	top.style.left = "0px";
	top.style.width = "195px";
	top.style.height = "39px";
	top.innerHTML = "<img src=\"images/common/sib_dates_top2.png\" style=\"width:195px; height:39px;\" />";
	
		var topLabel = Rf.dc("div");
		topLabel.style.position = "absolute";
		topLabel.style.top = "8px";
		topLabel.style.left = "13px";
		topLabel.style.color = "#AA0000";
		topLabel.style.fontWeight = "bold";
		topLabel.style.lineHeight = "14px";
		//topLabel.style.width = "150px";
		//topLabel.style.height = "26px";
		topLabel.innerHTML = "N&auml;chste Events";
		top.appendChild(topLabel);
		
	var bottom = Rf.dc("div");
	bottom.style.position = "absolute";
	bottom.style.bottom = "0px";
	bottom.style.left = "0px";
	bottom.style.width = "195px";
	bottom.style.height = "7px";
	bottom.innerHTML = "<img src=\"images/common/sib_dates_bottom.png\" style=\"width:195px; height:7px;\" />";
	
	this.Nodes.SIBEventsDIV.appendChild(this.Nodes.SIBEventsDIVContent);
	this.Nodes.SIBEventsDIV.appendChild(top);
	this.Nodes.SIBEventsDIV.appendChild(bottom);
	
	this.Nodes.SIBContentDIV.appendChild(this.Nodes.SIBEventsDIV);
	
	
	
	this.Nodes.SIBOpeningtimesDIV = Rf.dc("div");
	this.Nodes.SIBOpeningtimesDIV.style.position = "relative";
	this.Nodes.SIBOpeningtimesDIV.style.top = "18px";
	this.Nodes.SIBOpeningtimesDIV.style.left = "0px";
	this.Nodes.SIBOpeningtimesDIV.style.height = "96px";
	this.Nodes.SIBOpeningtimesDIV.style.width = "195px";
	this.Nodes.SIBOpeningtimesDIV.style.backgroundImage = "url('images/common/openingtimes_middle.gif')";
/*
	var top = Rf.dc("div");
	top.style.position = "absolute";
	top.style.top = "-1px";
	top.style.left = "0px";
	top.style.width = "195px";
	top.style.height = "11px";
	top.innerHTML = "<img src=\"images/common/openingtimes_top.gif\" style=\"width:195px; height:11px;\" />";
	this.Nodes.SIBOpeningtimesDIV.appendChild(top);
	
	var bottom = Rf.dc("div");
	bottom.style.position = "absolute";
	bottom.style.bottom = "0px";
	bottom.style.left = "0px";
	bottom.style.width = "195px";
	bottom.style.height = "15px";
	bottom.innerHTML = "<img src=\"images/common/openingtimes_bottom.gif\" style=\"width:195px; height:15px;\" />";
	this.Nodes.SIBOpeningtimesDIV.appendChild(bottom);
	
	var label = Rf.dc("div");
	label.style.position = "absolute";
	label.style.top = "6px";
	label.style.left = "12px";
	label.style.color = "#444444";
	label.style.fontWeight = "bold";
	label.style.lineHeight = "14px";
	label.style.width = "170px";
	//topLabel.style.height = "26px";
	label.innerHTML = "Clubhaus-&Ouml;ffnungszeiten";
	this.Nodes.SIBOpeningtimesDIV.appendChild(label);
	
	var text = Rf.dc("div");
	text.style.position = "absolute";
	text.style.top = "30px";
	text.style.left = "10px";
	text.style.color = "#444444";
	text.style.width = "170px";
	text.style.textAlign = "center";
	text.style.lineHeight = "14px";
	//text.innerHTML = "zur kalten Jahreszeit:<br/>jeden Freitag<br/>ab 19 Uhr";
	text.innerHTML = "freitags ab 19 Uhr<br/>sowie bei Medenspielen und Events";
	this.Nodes.SIBOpeningtimesDIV.appendChild(text);
	
	
	
	
	this.Nodes.SIBContentDIV.appendChild(this.Nodes.SIBOpeningtimesDIV);
*/	
	
	this.Nodes.SIBGamesDIV = Rf.dc("div");
	this.Nodes.SIBGamesDIV.style.position = "relative";
	this.Nodes.SIBGamesDIV.style.top = "12px";
	this.Nodes.SIBGamesDIV.style.left = "0px";
	//this.Nodes.SIBGamesDIV.style.height = "100px";
	this.Nodes.SIBGamesDIV.style.width = "195px";
	this.Nodes.SIBGamesDIV.style.backgroundImage = "url('images/common/sib_dates_middle.png')";
	
	this.Nodes.SIBGamesDIVContent = Rf.dc("div");
	this.Nodes.SIBGamesDIVContent.style.position = "relative";
	this.Nodes.SIBGamesDIVContent.style.overflow = "hidden";
	this.Nodes.SIBGamesDIVContent.style.top = "42px";
	this.Nodes.SIBGamesDIVContent.style.left = "10px";
	this.Nodes.SIBGamesDIVContent.style.width = "171px";
	
	var top = Rf.dc("div");
	top.style.position = "absolute";
	top.style.top = "0px";
	top.style.left = "0px";
	top.style.width = "195px";
	top.style.height = "39px";
	top.innerHTML = "<img src=\"images/common/sib_dates_top2.png\" style=\"width:195px; height:39px;\" />";
	
		var topLabel = Rf.dc("div");
		topLabel.style.position = "absolute";
		topLabel.style.top = "8px";
		topLabel.style.left = "13px";
		topLabel.style.color = "#AA0000";
		topLabel.style.fontWeight = "bold";
		topLabel.style.lineHeight = "14px";
		//topLabel.style.width = "150px";
		//topLabel.style.height = "26px";
		topLabel.innerHTML = "N&auml;chste Medenspiele";
		top.appendChild(topLabel);
		
	var bottom = Rf.dc("div");
	bottom.style.position = "absolute";
	bottom.style.bottom = "0px";
	bottom.style.left = "0px";
	bottom.style.width = "195px";
	bottom.style.height = "7px";
	bottom.innerHTML = "<img src=\"images/common/sib_dates_bottom.png\" style=\"width:195px; height:7px;\" />";
	
	this.Nodes.SIBGamesDIV.appendChild(this.Nodes.SIBGamesDIVContent);
	this.Nodes.SIBGamesDIV.appendChild(top);
	this.Nodes.SIBGamesDIV.appendChild(bottom);
	
	this.Nodes.SIBContentDIV.appendChild(this.Nodes.SIBGamesDIV);
	
	this.fillSIBContent();
}

Rf.CContent.prototype.fillSIBContent = function(aH){
	var request = new Rf.Loading.CRequest();
	request.rfContent = this;
	request.Data = {
		action:"getSIBContents"
	};
	
	request.onSuccess = function() {
		if(!Rf.empty(this.Response.error)){
			Rf.setError(this.Response.error);
		}
		else{
			this.rfContent.Nodes.SIBEventsDIVContent.innerHTML = "";
			this.rfContent.Nodes.SIBGamesDIVContent.innerHTML = "";
			
			var eventsExist = false;
			var events = this.Response.events;
			var eventItemCounter = 0;
			for(var date in events){
				
				for(var i=0; i<events[date].length; i++){
					eventsExist = true;
					var sibItem = Rf.dc("div");
					sibItem.style.position = "relative";
					sibItem.style.width = "100%";
					sibItem.style.paddingTop = "12px";
					sibItem.style.cursor = "pointer";
					sibItem.style.cursor = "hand";
					sibItem.rfContent = this.rfContent;
					sibItem.infoBox = null;
					sibItem.thisEvent = events[date][i];
					sibItem.eventItemCounter = eventItemCounter;
					sibItem.onmouseover = function(e){
						if(typeof this.thisEvent.content != "string"){
							this.thisEvent.content = "";
						}
						this.style.backgroundColor = "#EEEEEE";
						var width = Rf.Layout.getInsideWindowWidth()-520;
						if(width < 478){
							width = 478;
						}
						var dateFrom = Rf.getReadableDateTimeFlex(this.thisEvent.datefrom, this.thisEvent.weekdayfrom);
						var dateTo = null;
						if(this.thisEvent.dateto != null){
							var dateTo = Rf.getReadableDateTimeFlex(this.thisEvent.dateto, this.thisEvent.weekdayto);
						}
						var content = "<div style=\"position:relative;width:100%;height:100%\">";
						content += "<div style=\"position:relative;top:0px;left:0px;font-weight:bold;color:#AA0000;\">"+dateFrom+"</div>";
						if(dateTo != null){
							content += "<div style=\"position:relative;top:0px;right:0px;height:4px;line-height:0px;font-size:0px\"></div>";
							content += "<div style=\"position:relative;top:0px;left:0px;color:#AA0000\">bis "+dateTo+"</div>";
						}
						
						content += "<div style=\"position:relative;top:0px;right:0px;height:7px;line-height:0px;font-size:0px\"></div>";
						content += "<div style=\"position:relative;top:0px;left:0px;text-align:left;line-height:15px;font-weight:bold;\">"+this.thisEvent.headline+"</div>";
						
						content += "<div style=\"position:relative;top:0px;right:0px;height:4px;line-height:0px;font-size:0px\"></div>";
						content += "<div style=\"position:relative;top:0px;right:0px;text-align:left;line-height:15px;\">"+this.thisEvent.content.replace(/\n|\r\n/g, "<br />")+"</div>";
						
						content += "<div style=\"position:absolute;top:0px;right:40px;width:16px;height:16px;\"><img src=\"";
						if(this.thisEvent.category_tennis == "1"){
							content += Rf.CContent.DateImagesActive.TENNIS;
						}
						else{
							content += Rf.CContent.DateImagesDisabled.TENNIS;
						}
						content += "\" style=\"width:16px;height:16px;\" /></div>";
						content += "<div style=\"position:absolute;top:0px;right:20px;width:16px;height:16px;\"><img src=\"";
						if(this.thisEvent.category_food == "1"){
							content += Rf.CContent.DateImagesActive.FOOD;
						}
						else{
							content += Rf.CContent.DateImagesDisabled.FOOD;
						}
						content += "\" style=\"width:16px;height:16px;\" /></div>";
						content += "<div style=\"position:absolute;top:0px;right:0px;width:16px;height:16px;\"><img src=\"";
						if(this.thisEvent.category_work == "1"){
							content += Rf.CContent.DateImagesActive.WORK;
						}
						else{
							content += Rf.CContent.DateImagesDisabled.WORK;
						}
						content += "\" style=\"width:16px;height:16px;\" /></div>";
						
						content += "</div>";
						//Rf.Info.show(e, content, (208+(this.eventItemCounter*40)), null, null, (width));
						this.infoBox = Rf.Info.showAppended(e, content, 2, null, null, -323, this.rfContent.Nodes.SIBEventsDIV, this.infoBox);
					}
					sibItem.onmouseout = function(){
						this.style.backgroundColor = "#FFFFFF";
						Rf.Info.hideAppended(this.infoBox);
					}
					sibItem.innerHTML = events[date][i].headline.substr(0,25);
					if(events[date][i].headline.length > 25){
						sibItem.innerHTML += "..";
					}
					
						var sibItemDate = Rf.dc("div");
						sibItemDate.style.position = "absolute";
						sibItemDate.style.top = "0px";
						sibItemDate.style.left = "0px";
						sibItemDate.style.color = "#AA0000";
						sibItemDate.innerHTML = Rf.getReadableDate(events[date][i].datefrom, events[date][i].weekdayfrom);
						
						sibItem.appendChild(sibItemDate);
					
					this.rfContent.Nodes.SIBEventsDIVContent.appendChild(sibItem);
					
					var sibPH = Rf.dc("div");
					sibPH.style.position = "relative";
					sibPH.style.top = "0px";
					sibPH.style.left = "0px";
					sibPH.style.width = "100%";
					sibPH.style.height = "6px";
					sibPH.style.lineHeight = "0px"
					sibPH.style.fontSize = "0px"
					sibPH.style.margin = "0px"
					sibPH.style.padding = "0px"
					this.rfContent.Nodes.SIBEventsDIVContent.appendChild(sibPH);
					
					eventItemCounter++;
				}
				
			}
			
			if(eventsExist == false){
				var span = Rf.dc("div");
				span.style.width = "100%";
				span.style.textAlign = "center";
				span.style.paddingTop = "12px";
				span.style.lineHeight = "14px";
				span.innerHTML = "Zur Zeit keine Events geplant.";
				
				this.rfContent.Nodes.SIBEventsDIVContent.appendChild(span);
			}
			
			var gamesExist = false;
			var games = this.Response.games;
			var gameItemPosX = 0;
			for(var date in games){
				var sibDateBlock = Rf.dc("div");
				sibDateBlock.style.position = "relative";
				sibDateBlock.style.width = "100%";
				sibDateBlock.style.height = "18px";
				sibDateBlock.style.color = "#AA0000";
				sibDateBlock.innerHTML = Rf.getReadableDate(date, games[date][0].weekday);;
				this.rfContent.Nodes.SIBGamesDIVContent.appendChild(sibDateBlock);
				
				gameItemPosX += 20;
				
				for(var i=0; i<games[date].length; i++){
					gamesExist = true;
					var sibItem = Rf.dc("div");
					sibItem.style.position = "relative";
					sibItem.style.width = "100%";
					sibItem.style.height = "18px";
					sibItem.style.cursor = "pointer";
					sibItem.style.cursor = "hand";
					sibItem.style.overflow = "visible";
					sibItem.thisGame = games[date][i];
					sibItem.rfContent = this.rfContent;
					sibItem.infoBox = null;
					sibItem.onmouseover = function(e){
						this.style.backgroundColor = "#EEEEEE";
						var width = Rf.Layout.getInsideWindowWidth()-520;
						if(width < 478){
							width = 478;
						}
						var date = Rf.getReadableDateTimeFlex(this.thisGame.date, this.thisGame.weekday);

						var content = "<div style=\"position:relative;width:100%;height:100%\">";
						content += "<div style=\"position:relative;top:0px;left:0px;font-weight:bold;color:#AA0000;\">"+date+"</div>";
						
						content += "<div style=\"position:relative;top:0px;right:0px;height:7px;line-height:0px;font-size:0px\"></div>";
						content += "<div style=\"position:relative;top:0px;left:0px;text-align:left;line-height:15px;font-weight:bold;\">"+this.thisGame.team+"</div>";
						
						var begegnung = "";
						if(this.thisGame.homeflag == "1"){
							begegnung += "TC Kirrberg "+this.thisGame.teamnumber+" - ";
							begegnung += this.thisGame.adversary+" "+this.thisGame.adversarynumber;
						}
						else{
							begegnung += this.thisGame.adversary+" "+this.thisGame.adversarynumber+" - ";
							begegnung += "TC Kirrberg "+this.thisGame.teamnumber;
						}
						
						content += "<div style=\"position:relative;top:0px;right:0px;height:4px;line-height:0px;font-size:0px\"></div>";
						content += "<div style=\"position:relative;top:0px;right:0px;text-align:left;line-height:15px;\">"+begegnung+"</div>";
												
						if(this.thisGame.homeflag == "0"){
							content += "<div style=\"position:relative;top:0px;right:0px;height:4px;line-height:0px;font-size:0px\"></div>";
							content += "<div style=\"position:relative;top:0px;right:0px;text-align:left;line-height:15px;\"><i>Austragungsort: "+this.thisGame.place+"</i></div>";
						}
						
						if(this.thisGame.info != "" && this.thisGame.info != null){
							content += "<div style=\"position:relative;top:0px;right:0px;height:4px;line-height:0px;font-size:0px\"></div>";
							content += "<div style=\"position:relative;top:0px;right:0px;text-align:left;line-height:15px;\">"+this.thisGame.info+"</div>";
						}
						content += "</div>";
						this.infoBox = Rf.Info.showAppended(e, content, 2, null, null, -323, this.rfContent.Nodes.SIBGamesDIV, this.infoBox);
					}
					sibItem.onmouseout = function(){
						this.style.backgroundColor = "#FFFFFF";
						Rf.Info.hideAppended(this.infoBox);
					}
					sibItem.innerHTML = "<span style=\"color:#AA0000\">&nbsp;"+Rf.getReadableTimeShort(games[date][i].date)+"</span>";
					
						var teamDiv = Rf.dc("div");
						teamDiv.style.position = "absolute";
						teamDiv.style.top = "0px";
						teamDiv.style.left = "42px";
						//teamDiv.style.width = "20px";
						teamDiv.style.height = "20px";
						teamDiv.innerHTML = games[date][i].team.substr(0,26);
						if(games[date][i].team.length > 26){
							sibItem.innerHTML += "...";
						}
						sibItem.appendChild(teamDiv);
						
						var placeDiv = Rf.dc("div");
						placeDiv.style.position = "absolute";
						placeDiv.style.top = "0px";
						placeDiv.style.right = "0px";
						//placeDiv.style.width = "20px";
						placeDiv.style.height = "20px";
						placeDiv.style.fontWeight = "bold";
						placeDiv.innerHTML = "H";
						if(games[date][i].homeflag == 0){
							placeDiv.innerHTML = "A";
						}
						sibItem.appendChild(placeDiv);
					/*
						var sibItemDate = Rf.dc("div");
						sibItemDate.style.position = "absolute";
						sibItemDate.style.top = "0px";
						sibItemDate.style.left = "0px";
						sibItemDate.innerHTML = games[date][i].date;
						
						sibItem.appendChild(sibItemDate);
					*/
			
					this.rfContent.Nodes.SIBGamesDIVContent.appendChild(sibItem);

					gameItemPosX += 20;
				}
				
				var sibPH = Rf.dc("div");
				sibPH.style.position = "relative";
				sibPH.style.top = "0px";
				sibPH.style.left = "0px";
				sibPH.style.width = "100%";
				sibPH.style.height = "3px";
				sibPH.style.lineHeight = "0px"
				sibPH.style.fontSize = "0px"
				sibPH.style.margin = "0px"
				sibPH.style.padding = "0px"
				this.rfContent.Nodes.SIBGamesDIVContent.appendChild(sibPH);
				
				gameItemPosX += 3;
			}
			
			if(gamesExist == false){
				var span = Rf.dc("div");
				span.style.width = "100%";
				span.style.textAlign = "center";
				span.style.paddingTop = "12px";
				span.style.lineHeight = "14px";
				span.innerHTML = "Zur Zeit finden keine Medenspiele statt.";
				
				this.rfContent.Nodes.SIBGamesDIVContent.appendChild(span);
			}
			
		}
	}	
	request.onError = function() {  } 
	request.onTimeout = function() {  } 
	var conn = new Rf.Loading.CConnectHTTPXML({ServiceUrl: "backend/rfSIB.php"}); 
	conn.sendRequest( request );
	/*
	this.Fcontent.push("bla");
	this.Fcontent.push("test");
	this.Fcontent.push("it");
	*/
}

//type
Rf.CContent.prototype.setAllMainNaviItems = function(aH){
	for(var moduleName in this.NaviItemDivs){
		if(aH.type == "standard"){
			this.NaviItemDivs[moduleName].className = "rfMainNavi_std";
		}
		else if(aH.type == "over"){
			this.NaviItemDivs[moduleName].className = "rfMainNavi_ov";
		}
		else if(aH.type == "active"){
			this.NaviItemDivs[moduleName].className = "rfMainNavi_act";
		}
	}
}

//name
Rf.CContent.prototype.setActiveModule = function(aH){
	this.CurrentActiveModule = aH.name;
	for(var moduleName in this.NaviItemDivs){
		if(aH.name == moduleName){
			this.NaviItemDivs[moduleName].className = "rfMainNavi_act";
		}
		else{
			this.NaviItemDivs[moduleName].className = "rfMainNavi_std";
		}
	}
}

//
Rf.CContent.prototype.reset = function(aH){
	this.DIV.innerHTML = "";
	this.LoadedModules = {};
	this.show({cI:this.CurrentActiveModule});
}

Rf.CContent.setOverflow = function(instanceId, overflow) {
	var rfContent = Rf.CContent._Instances[instanceId];
	rfContent.OuterDIV.style.overflow = overflow;
}

Rf.CContent.setContentDimensions = function(instanceId, newHeight, newWidth, space) {
	var rfContent = Rf.CContent._Instances[instanceId];
	//if(!Rf.empty(rfContent)){
	var sibWidth = 195;
	
	rfContent.WholeContentDIV.style.width = (newWidth+2)+"px";
	rfContent.WholeContentDIV.style.height = (newHeight)+"px";
	rfContent.OuterDIV.style.height = (newHeight)+"px";
	rfContent.OuterDIV.style.width = (newWidth-sibWidth-14)+"px";
	rfContent.DIV.style.width = (newWidth-sibWidth-44-space)+"px";
	
	var DIVleftOffset = 0;
	if(space > 0){
		DIVleftOffset += parseInt((space/2));
	}
	rfContent.DIV.style.left = DIVleftOffset+"px";
	
	rfContent.SiteIndicatorsDIV.style.width = (newWidth-sibWidth-28)+"px";
	//Rf.dg("rfTopNavi").style.width = (newWidth-sibWidth-183)+"px";
	//}
	Rf.dg("rfContents").style.height = newHeight+"px";
	
	var sibInfosHeight = (newHeight-30)/2; //-148
	rfContent.Nodes.SIBContentDIV.style.left = (newWidth-sibWidth+0)+"px";
	rfContent.Nodes.SIBContentDIV.style.height = (newHeight)+"px";
	rfContent.Nodes.SIBEventsDIV.style.height = sibInfosHeight+"px";
	rfContent.Nodes.SIBEventsDIVContent.style.height = (sibInfosHeight-49)+"px";
	rfContent.Nodes.SIBGamesDIV.style.height = sibInfosHeight+"px";
	rfContent.Nodes.SIBGamesDIVContent.style.height = (sibInfosHeight-49)+"px";
}


Rf.CContent.prototype.checkSiteDimensions = function(){
	/*var rfContent = Rf.Session.mainContent;

	if(!Rf.empty(rfContent.OuterDIV)){
		var currentContentHeight = Rf.Layout.getObjectHeight(rfContent.OuterDIV);
		//alert(Rf.Layout.getObjectHeight(rfContent.OuterDIV) + " " + Rf.Layout.getObjectHeight(rfContent.TABLE) + " " +Rf.Layout.getObjectHeight(rfContent.TD) + " " +Rf.Layout.getObjectHeight(rfContent.DIV));
	}
	else{
		var currentContentHeight = null;
	}
	*/
	var currentWindowWidth = Rf.Layout.getInsideWindowWidth();
	
	var currentWindowHeight = Rf.Layout.getInsideWindowHeight();
	//alert(currentWindowHeight);
//alert(currentContentHeight + " " +currentWindowHeight);
	var mainContentHeight = currentWindowHeight - Rf.Config.headerHeightAbs - Rf.Config.FooterHeightAbs - Rf.Config.SeperatorsHeightAbs;
	if(mainContentHeight < Rf.Config.mainContentHeightMin){
		mainContentHeight = Rf.Config.mainContentHeightMin; 
	}
	var mainContentWidth = currentWindowWidth-196;
	var calculatedSpace = 0;
	
	if(mainContentWidth < 801){
		mainContentWidth = 801;
	}
	
	if(mainContentWidth > Rf.Session.maxContentWidth){
		calculatedSpace = mainContentWidth-Rf.Session.maxContentWidth;
		//mainContentWidth = 1001; 
	}

	setTimeout("Rf.CContent.setContentDimensions("+Rf.Session.mainContent.InstanceId+", "+mainContentHeight+", "+mainContentWidth+", "+calculatedSpace+");", 10);//Rf.Layout.setHeight('rfSibContentTable', "+currentContentHeight+");
}

Rf.CContentPart = function(aH){
}
Rf.CContentPart.prototype.registeredContentParts = null;
// 
Rf.CContentBox = function(aH){
	this.Color = aH.Color;
	this.HeaderLeftText = aH.HeaderLeftText;
	this.HeaderRightText = aH.HeaderRightText;
	
	this.buildNode();
}

Rf.CContentBox.prototype.Node = null;
Rf.CContentBox.prototype.ContentNode = null;
Rf.CContentBox.prototype.Color = null;
Rf.CContentBox.prototype.HeaderLeftText = null;
Rf.CContentBox.prototype.HeaderRightText = null;



//
Rf.CContentBox.prototype.appendContent = function(node){
	/*var div = new Rf.dc("div");
	div.style.width = "auto";
	div.style.padding = "0px";
	div.style.height = "30px";
	div.style.backgroundColor ="#AA0000";
	
	this.ContentNode.appendChild(div);
	
var div = new Rf.dc("span");
	div.style.width = "90%";
	div.style.height = "10px";
	div.style.backgroundColor ="#00a000";
	

	
	div.appendChild(node);*/
	this.ContentNode.appendChild(node);
}

Rf.CContentBox.prototype.buildNode = function(){
	this.Node = new Rf.dc("div");
	this.Node.style.position = "relative";
	this.Node.style.top = "0px";
	this.Node.style.left = "0px";
	this.Node.style.width = "100%";
	this.Node.style.lineHeight = "0px";
	this.Node.style.fontSize = "0px";
	
		var monthContainer = Rf.dc("div");
		monthContainer.style.position = "relative";
		monthContainer.className = "RfContentBoxContainer";
		monthContainer.style.borderColor = "#"+this.Color.toUpperCase();
				
			//top corners
			var round = Rf.dc("div");
			round.style.position = "absolute";
			round.style.top = "0px";
			round.style.left = "-2px";
			round.style.width = "11px";
			round.style.height = "11px";
			round.style.zIndex = "1";
			round.innerHTML = "<img src=\"images/common/round_"+this.Color.toLowerCase()+"_tl.gif\" style=\"width:11px;height:11px;\" />";
			monthContainer.appendChild(round);
			var round = Rf.dc("div");
			round.style.position = "absolute";
			round.style.top = "0px";
			round.style.right = "-2px";
			round.style.width = "11px";
			round.style.height = "11px";
			round.style.zIndex = "1";
			round.innerHTML = "<img src=\"images/common/round_"+this.Color.toLowerCase()+"_tr.gif\" style=\"width:11px;height:11px;\" />";
			monthContainer.appendChild(round);
				
			//bottom corners
			var round = Rf.dc("div");
			round.style.position = "absolute";
			round.style.bottom = "0px";
			round.style.left = "-2px";
			round.style.width = "11px";
			round.style.height = "11px";
			round.style.borderWidth = "0px";
			round.style.borderStyle = "none";
			round.style.zIndex = "1";
			round.innerHTML = "<img src=\"images/common/round_"+this.Color.toLowerCase()+"_bl.gif\" style=\"width:11px;height:11px;border-width:0px;border-style:none;\" />";
			monthContainer.appendChild(round);
			var round = Rf.dc("div");
			round.style.position = "absolute";
			round.style.bottom = "0px";
			round.style.right = "-2px";
			round.style.width = "11px";
			round.style.height = "11px";
			round.style.borderWidth = "0px";
			round.style.borderStyle = "none";
			round.style.zIndex = "1";
			round.innerHTML = "<img src=\"images/common/round_"+this.Color.toLowerCase()+"_br.gif\" style=\"width:11px;height:11px;border-width:0px;border-style:none;\" />";
			monthContainer.appendChild(round);
				
			var monthLabel = Rf.dc("div");
			monthLabel.style.position = "relative";
			monthLabel.style.lineHeight = "0px";
			monthLabel.style.fontSize = "0px";
			monthLabel.className = "RfContentBoxHeader";
			monthLabel.style.backgroundColor = "#"+this.Color.toUpperCase();
			//monthLabel.innerHTML += "<strong>"+this.HeaderLeftText+"</strong>";
			
				var leftHeader = Rf.dc("div");
				leftHeader.style.position = "absolute";
				leftHeader.style.top = "7px";
				leftHeader.style.left = "9px";
				leftHeader.style.zIndex = "2";
				leftHeader.style.height = "14px";
				leftHeader.style.lineHeight = "14px";
				leftHeader.innerHTML = "<strong>"+this.HeaderLeftText+"</strong>";
				monthLabel.appendChild(leftHeader);
				
				var rightHeader = Rf.dc("div");
				rightHeader.style.position = "absolute";
				rightHeader.style.top = "7px";
				rightHeader.style.right = "9px";
				rightHeader.style.zIndex = "2";
				rightHeader.style.height = "14px";
				rightHeader.style.lineHeight = "14px";
				rightHeader.innerHTML = this.HeaderRightText;
				monthLabel.appendChild(rightHeader);
			
			monthContainer.appendChild(monthLabel);
			
			var t = Rf.dc("table");
			t.cellpadding = "0";
			t.cellspacing = "0";
			t.border = "0";
			t.style.margin = "0px";
			t.style.padding = "0px";
			var tb = Rf.dc("tbody");
			/*
				var tr = Rf.dc("tr");
					var td = Rf.dc("td");
					tr.appendChild(td);
					var td = Rf.dc("td");
					tr.appendChild(td);
					var td = Rf.dc("td");
					tr.appendChild(td);
				tb.appendChild(tr)
				*/
				var tr = Rf.dc("tr");
					var td = Rf.dc("td");
					td.style.width = "9px";
					td.innerHTML = "<img src=\"images/common/space.gif\" style=\"width:9px;height:1px;\" />";
					tr.appendChild(td);
					this.ContentNode = Rf.dc("td");
					this.ContentNode.style.width = "100%";
					tr.appendChild(this.ContentNode);
					var td = Rf.dc("td");
					td.style.width = "9px";
					td.innerHTML = "<img src=\"images/common/space.gif\" style=\"width:9px;height:1px;\" />";
					tr.appendChild(td);
				tb.appendChild(tr);
				/*
				var tr = Rf.dc("tr");
					var td = Rf.dc("td");
					tr.appendChild(td);
					var td = Rf.dc("td");
					tr.appendChild(td);
					var td = Rf.dc("td");
					tr.appendChild(td);
				tb.appendChild(tr);
				*/
			t.appendChild(tb);
			
			/*
			this.ContentNode = Rf.dc("div");
			this.ContentNode.style.position = "relative";
			this.ContentNode.className = "RfContentBoxContent";
			*/
			//top space
			var dummy = Rf.dc("div");
			dummy.style.position = "relative";
			dummy.style.top = "0px";
			dummy.style.left = "0px";
			dummy.style.width = "100%";
			dummy.style.height = "8px";
			dummy.style.lineHeight = "0px";
			dummy.style.fontSize = "0px";
			dummy.style.borderWidth = "0px";
			dummy.style.borderStyle = "none";
			this.ContentNode.appendChild(dummy);
			
		monthContainer.appendChild(t);
				
	this.Node.appendChild(monthContainer);
		
	//seperator
	var dummy = Rf.dc("div");
	dummy.style.position = "relative";
	dummy.style.top = "0px";
	dummy.style.left = "0px";
	dummy.style.width = "100%";
	dummy.style.height = "12px";
	dummy.style.lineHeight = "0px";
	dummy.style.fontSize = "0px";
	dummy.style.borderWidth = "0px";
	dummy.style.borderStyle = "none";
	this.Node.appendChild(dummy);
}

//
Rf.CContentBox.prototype.getNode = function(){
	//bottom space
	var dummy = Rf.dc("div");
	dummy.style.position = "relative";
	dummy.style.top = "0px";
	dummy.style.left = "0px";
	dummy.style.width = "100%";
	dummy.style.height = "10px";
	dummy.style.lineHeight = "0px";
	dummy.style.fontSize = "0px";
	dummy.style.borderWidth = "0px 0px 0px 0px";
	dummy.style.borderStyle = "none";
	this.ContentNode.appendChild(dummy);
					
	//border line
	var dummy = Rf.dc("div");
	dummy.style.position = "absolute";
	dummy.style.bottom = "0px";
	dummy.style.left = "0px";
	dummy.style.width = "100%";
	dummy.style.height = "2px";
	dummy.style.lineHeight = "2px";
	dummy.style.fontSize = "2px";
	dummy.style.borderWidth = "0px 0px 0px 0px";
	dummy.style.borderStyle = "none";
	dummy.style.backgroundColor = "#"+this.Color.toUpperCase();
	this.ContentNode.appendChild(dummy);
	
	return this.Node;
};Rf.CModule = function(aH){
	this.RegisteredSubMenuItems = {};
	this.SubMenuItemDivs = {};
	this.SubPartDIVs = {};
	this.Nodes = {};
	
	this.InstanceId = Rf.CModule.Instances.length;
	Rf.CModule.Instances[Rf.CModule.Instances.length] = this;
}

Rf.CModule.prototype.InstanceId = null;

Rf.CModule.prototype.RfContent = null;

Rf.CModule.prototype.RfAuth = null;

Rf.CModule.prototype.DIV = null;
Rf.CModule.prototype.SubPartDIVs = null;
Rf.CModule.prototype.Nodes = null;

Rf.CModule.prototype.SubMenuDiv = null;
Rf.CModule.prototype.SubMenuItemDivs = null;
Rf.CModule.prototype.RegisteredSubMenuItems = null;

Rf.CModule.prototype.SiteIndicator = null;

Rf.CModule.prototype.buildSubMenu = function(){
	for(var menuItem in this.SubPartDIVs){
		//this.subPages[menuItem];
	}
}
//
Rf.CModule.prototype.showPart = function(aH){
	alert(aH.cI);
}

//
Rf.CModule.prototype.disable = function(aH){
	this.DIV.style.display = "none";
	this.SiteIndicator.style.display = "none";
	this.SubMenuDiv.style.display = "none";
}

Rf.CModule.prototype.enable = function(aH){
	this.DIV.style.display = "";
	this.SiteIndicator.style.display = "";
	this.SubMenuDiv.style.display = "";
}
//
/*
Rf.CModule.prototype.disable = function(aH){
	this.hideAllSubDIVs();
}
*/

//name
Rf.CModule.prototype.show = function(aH){
	this.RfContent.checkSiteDimensions();
	for(var subPartName in this.SubPartDIVs){
		if(subPartName == aH.name){
			this.SubPartDIVs[subPartName].style.display = "block";
		}
		else{
			this.SubPartDIVs[subPartName].style.display = "none";
		}
	}
	this.DIV.style.display = "block";
}

//
Rf.CModule.prototype.hideAllSubDIVs = function(aH){
	for(var subPartName in this.SubPartDIVs){
		this.SubPartDIVs[subPartName].style.display = "none";
	}
}

// ModuleName
Rf.CModule.prototype.createSiteIndicator = function(aH){
	this.SiteIndicator = Rf.dc("div");
	this.SiteIndicator.style.position = "absolute";
	this.SiteIndicator.style.top = "64px";
	this.SiteIndicator.style.right = "5px";
	this.SiteIndicator.style.fontSize = "20px";
	this.SiteIndicator.style.lineHeight = "20px";
	this.SiteIndicator.style.fontWeight = "bold";
	this.SiteIndicator.style.color = "#444444";
	this.SiteIndicator.innerHTML = aH.ModuleName;
	//Rf.dg("rfTopNavi").appendChild(this.SiteIndicator);
	this.RfContent.SiteIndicatorsDIV.appendChild(this.SiteIndicator);
}

// ModuleName
Rf.CModule.prototype.createSubMenu = function(aH){
	this.SubMenuDiv = Rf.dc("div");
	this.SubMenuDiv.style.position = "absolute";
	this.SubMenuDiv.style.top = "0px";
	this.SubMenuDiv.style.left = "80px";
	
	var left = 0;
	for(var item in this.RegisteredSubMenuItems){
		this.SubMenuItemDivs[item] = Rf.dc("div");
		this.SubMenuItemDivs[item].style.position = "absolute";
		this.SubMenuItemDivs[item].style.backgroundImage = "url('_general/buttons/1_griff.png')";
		this.SubMenuItemDivs[item].style.top = "0px";
		this.SubMenuItemDivs[item].style.left = left+"px";
		this.SubMenuItemDivs[item].style.width = "76px";
		this.SubMenuItemDivs[item].style.height = "40px";
		this.SubMenuItemDivs[item].style.padding = "46px 0px 0px 0px";
		this.SubMenuItemDivs[item].style.textAlign = "center";
		this.SubMenuItemDivs[item].style.overflow = "hidden";
		this.SubMenuItemDivs[item].style.color = "#000000";
		this.SubMenuItemDivs[item].innerHTML = this.RegisteredSubMenuItems[item].label;
		this.SubMenuItemDivs[item].style.cursor = "pointer";
		this.SubMenuItemDivs[item].style.cursor = "hand";
		this.SubMenuItemDivs[item].Module = this;
		this.SubMenuItemDivs[item].SubMenuItem = item;
		this.SubMenuItemDivs[item].onclick = function(){
			this.Module.showPart({cI:"|"+this.SubMenuItem});
		}
		this.SubMenuDiv.appendChild(this.SubMenuItemDivs[item]);
		left += 80;
	}
	
	this.RfContent.SiteIndicatorsDIV.appendChild(this.SubMenuDiv);
}

//Item
Rf.CModule.prototype.chooseSubMenuItem = function(aH){
	var itemCounter = 0;
	for(var item in this.RegisteredSubMenuItems){
		if((typeof aH.Item == "undefined" && itemCounter == 0) || (typeof aH.Item != "undefined" && item == aH.Item)){
			this.SubMenuItemDivs[item].style.backgroundImage = "url('_general/buttons/2_griff.png')";
			this.SubMenuItemDivs[item].style.color = "#FFFFFF";
		}
		else{
			this.SubMenuItemDivs[item].style.backgroundImage = "url('_general/buttons/1_griff.png')";
			this.SubMenuItemDivs[item].style.color = "#000000";
		}
		itemCounter++;
	}
}


Rf.CModule.Instances = [];

;Rf.Config = function (){}

Rf.Config.mainContentHeightMin = 280;
Rf.Config.headerHeightAbs = 160;
Rf.Config.FooterHeightAbs = 50;
Rf.Config.SeperatorsHeightAbs = 1;

Rf.Config.SIBContentWidthAbs = 200;

Rf.Config.modules = new Array();

Rf.Config.modules['rfDates'] = new Array();
Rf.Config.modules['rfDates']['requiredScripts'] = new Array();
Rf.Config.modules['rfDates']['requiredScripts'][0] = './jscript/utils/rfInfo.js';
Rf.Config.modules['rfDates']['requiredScripts'][1] = './jscript/prototype/prototype.js';
Rf.Config.modules['rfDates']['requiredScripts'][2] = './modules/RFContent/client/RFContent.js';
Rf.Config.modules['rfDates']['callbackFunction'] = new Array('initRFContent()');

Rf.Config.modules['rfNews'] = new Array();
Rf.Config.modules['rfNews']['requiredScripts'] = new Array();
Rf.Config.modules['rfNews']['requiredScripts'][0] = './modules/rfNews/client/rfNews.js';
Rf.Config.modules['rfNews']['callbackFunction'] = 'rfNews.init';
Rf.Config.modules['rfNews']['callbackParams'] = {divId:'rfMainContent_news'};

Rf.Config.modules['rfImageGallery'] = new Array();
Rf.Config.modules['rfImageGallery']['requiredScripts'] = new Array();
Rf.Config.modules['rfImageGallery']['requiredScripts'][2] = './modules/RFImageGallery/client/RFImageGallery.js';
Rf.Config.modules['rfImageGallery']['callbackFunction'] = new Array('initRFImageGallery()');

Rf.Config.mainContentDivId = 'rfMainContent';

Rf.Config.mainContents = new Array();
//Rf.Config.mainContents[Rf.Config.mainContents.length] = {NAME:'home', SOURCE:'./contentparts/home.js', LABEL:'Home', SUBS:new Array()};
Rf.Config.mainContents[Rf.Config.mainContents.length] = {NAME:'news', SOURCE:'./contentparts/news.js', LABEL:'News', SUBS:new Array()};
Rf.Config.mainContents[Rf.Config.mainContents.length] = {NAME:'dates', SOURCE:'./contentparts/dates.js', LABEL:'Termine', SUBS:new Array()};
//Rf.Config.mainContents[Rf.Config.mainContents.length] = {NAME:'club', SOURCE:'./contentparts/club.js', LABEL:'Verein', SUBS:new Array()};
//Rf.Config.mainContents[Rf.Config.mainContents.length] = {NAME:'members', SOURCE:'./contentparts/members.js', LABEL:'Mitglieder', SUBS:new Array()};
//Rf.Config.mainContents[Rf.Config.mainContents.length] = {NAME:'clubhouse', SOURCE:'./contentparts/clubhouse.js', LABEL:'Clubhaus', SUBS:new Array()};
//Rf.Config.mainContents[Rf.Config.mainContents.length] = {NAME:'games', SOURCE:'./contentparts/games.js', LABEL:'Medenrunde', SUBS:new Array()};
//Rf.Config.mainContents[Rf.Config.mainContents.length] = {NAME:'images', SOURCE:'./contentparts/images.js', LABEL:'Bilder', SUBS:new Array()};
//Rf.Config.mainContents[Rf.Config.mainContents.length] = {NAME:'contact', SOURCE:'./contentparts/contact.js', LABEL:'Kontakt', SUBS:new Array()};
//Rf.Config.mainContents[Rf.Config.mainContents.length] = {NAME:'links', SOURCE:'./contentparts/links.js', LABEL:'Links', SUBS:new Array()};

Rf.Config.weekdays = ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"];
//to, from, subject, message
Rf.CTaube = function(aH){
	this.nodes = {};
	this.createTaube(aH);
}

Rf.CTaube.prototype.DIV = null;
Rf.CTaube.prototype.nodes = null;

Rf.CTaube.prototype.fromId = null;
Rf.CTaube.prototype.fromName = null;
Rf.CTaube.prototype.fromEmail = null;
Rf.CTaube.prototype.to = null;
Rf.CTaube.prototype.toId = null;
Rf.CTaube.prototype.toName = null;
Rf.CTaube.prototype.subjectFirst = null;
Rf.CTaube.prototype.subjectLast = null;
Rf.CTaube.prototype.subject = null;
Rf.CTaube.prototype.messageFirst = null;
Rf.CTaube.prototype.messageLast = null;
Rf.CTaube.prototype.message = null;

//to, toId, toName, fromId, subjectFirst, messageFirst
Rf.CTaube.prototype.showTaube = function(aH){
	if(Rf.empty(aH)) aH = {};
	
	if(aH.to == "tck"){
		this.to = "tck";
		this.toName = "TC Kirrberg";
		this.fromId = Rf.Session.rfAuth.userId;
		this.subjectFirst = "TC Kirrberg - Kontakt:" + " ";
		this.messageFirst = "";
	}
	else if(aH.to == "user"){
		this.to = aH.to;
		this.toId = aH.toId;
		this.toName = aH.toName;
		this.fromId = aH.fromId;
		this.subjectFirst = aH.subjectFirst + " ";
		this.messageFirst = aH.messageFirst;
	}
	else if(aH.to == "person"){
		this.to = aH.to;
		this.toId = aH.toId;
		this.toName = aH.toName;
		this.fromId = Rf.Session.rfAuth.userId;
		this.subjectFirst = aH.subjectFirst + " ";
		this.messageFirst = aH.messageFirst;
	}
	
	if(typeof aH.subjectFirst == "string"){
		this.subjectFirst = aH.subjectFirst + " ";
	}
	
	if(!(this.fromId == null || this.fromId == 0)){
		this.fromName = Rf.Session.rfAuth.firstname + " " + Rf.Session.rfAuth.name;
	}
	else{
		this.fromName = null;
	}
	
	this.fillTaube();
	this.DIV.style.display = "";
	Rf.Session.mainContent.OuterDIV.style.overflow = "hidden";
}

Rf.CTaube.prototype.hideTaube = function(){
	Rf.Session.mainContent.OuterDIV.style.overflow = "auto";
	this.DIV.style.display = "none";
	
}

Rf.CTaube.prototype.fillTaube = function(){
	if(this.fromId == null || this.fromId == 0){
		this.nodes.divFrom.style.display = "none";
		this.nodes.divName.style.display = "";
		this.nodes.divEmail.style.display = "";
	}
	else{
		this.nodes.divFrom.style.display = "";
		this.nodes.divName.style.display = "none";
		this.nodes.divEmail.style.display = "none";
	}
	if(this.fromName != null) this.nodes.contentFrom.innerHTML = this.fromName;
	this.nodes.contentSubjectFirst.innerHTML = this.subjectFirst;
	this.nodes.contentTo.innerHTML = this.toName;
	this.DIV.style.display = "none";
}

Rf.CTaube.prototype.createTaube = function(aH){
	this.DIV = Rf.getPopUpForm(286, "E-Mail senden");
	this.DIV.closeButton.rfTaube = this;
	this.DIV.closeButton.onclick = function(){
		this.rfTaube.hideTaube();
	};
	this.DIV.id = "rfTaube";
	this.DIV.style.display = "none";
	this.DIV.style.height = "320px";
	//this.DIV.className = "rfGlobalForm";
	document.getElementsByTagName("body")[0].appendChild(this.DIV);
/*	
		var buttonClose = Rf.getIMGButton("images/common/cross.png");
		buttonClose.style.left = "";
		buttonClose.style.right = "5px";
		buttonClose.style.top = "5px";
		buttonClose.rfTaube = this;
		buttonClose.onclick = function(){
			this.rfTaube.hideTaube();
		};
		this.DIV.appendChild(buttonClose);
*/
	this.nodes.divTo = Rf.dc("div");
	this.nodes.divTo.className = "divRelative";
	this.nodes.divTo.style.left = "10px";
	this.nodes.divTo.style.top = "10px";
	this.nodes.divTo.style.height = "44px";
	this.DIV.appendChild(this.nodes.divTo);
	
		this.nodes.labelTo = Rf.dc("div");
		this.nodes.labelTo.className = "label";
		this.nodes.labelTo.innerHTML = "An:";
		this.nodes.divTo.appendChild(this.nodes.labelTo);
		
		this.nodes.contentTo = Rf.dc("div");
		this.nodes.contentTo.className = "content";
		this.nodes.divTo.appendChild(this.nodes.contentTo);
	
	this.nodes.divFrom = Rf.dc("div");
	this.nodes.divFrom.className = "divRelative";
	this.nodes.divFrom.style.left = "10px";
	this.nodes.divFrom.style.top = "10px";
	this.nodes.divFrom.style.height = "30px";
	this.DIV.appendChild(this.nodes.divFrom);	
	
		this.nodes.labelFrom = Rf.dc("div");
		this.nodes.labelFrom.className = "label";
		this.nodes.labelFrom.innerHTML = "Von:";
		this.nodes.divFrom.appendChild(this.nodes.labelFrom);
		
		this.nodes.contentFrom = Rf.dc("div");
		this.nodes.contentFrom.className = "content";
		this.nodes.divFrom.appendChild(this.nodes.contentFrom);
	
	this.nodes.divName = Rf.dc("div");
	this.nodes.divName.className = "divRelative";
	this.nodes.divName.style.left = "10px";
	this.nodes.divName.style.height = "30px";
	this.DIV.appendChild(this.nodes.divName);	
	
		this.nodes.labelName = Rf.dc("div");
		this.nodes.labelName.className = "label";
		this.nodes.labelName.innerHTML = "Name:";
		this.nodes.divName.appendChild(this.nodes.labelName);
		
		this.nodes.inputName = Rf.dc("input");
		this.nodes.inputName.className = "content";
		this.nodes.inputName.type = "text";
		this.nodes.divName.appendChild(this.nodes.inputName);
	
	this.nodes.divEmail = Rf.dc("div");
	this.nodes.divEmail.className = "divRelative";
	this.nodes.divEmail.style.left = "10px";
	this.nodes.divEmail.style.height = "30px";
	this.DIV.appendChild(this.nodes.divEmail);
	
		this.nodes.labelEmail = Rf.dc("div");
		this.nodes.labelEmail.className = "label";
		this.nodes.labelEmail.innerHTML = "e-Mail:";
		this.nodes.divEmail.appendChild(this.nodes.labelEmail);
		
		this.nodes.inputEmail = Rf.dc("input");
		this.nodes.inputEmail.className = "content";
		this.nodes.inputEmail.type = "text";
		this.nodes.divEmail.appendChild(this.nodes.inputEmail);
		
	this.nodes.divSubjectFirst = Rf.dc("div");
	this.nodes.divSubjectFirst.className = "divRelative";
	this.nodes.divSubjectFirst.style.left = "10px";
	this.nodes.divSubjectFirst.style.height = "26px";
	this.DIV.appendChild(this.nodes.divSubjectFirst);
	
		this.nodes.labelSubjectFirst = Rf.dc("div");
		this.nodes.labelSubjectFirst.className = "label";
		this.nodes.labelSubjectFirst.innerHTML = "Betreff:";
		this.nodes.divSubjectFirst.appendChild(this.nodes.labelSubjectFirst);
		
		this.nodes.contentSubjectFirst = Rf.dc("div");
		this.nodes.contentSubjectFirst.className = "content";
		this.nodes.divSubjectFirst.appendChild(this.nodes.contentSubjectFirst);
		
	this.nodes.divSubjectLast = Rf.dc("div");
	this.nodes.divSubjectLast.className = "divRelative";
	this.nodes.divSubjectLast.style.left = "10px";
	this.nodes.divSubjectLast.style.height = "30px";
	this.DIV.appendChild(this.nodes.divSubjectLast);
		
		this.nodes.inputSubjectLast = Rf.dc("input");
		this.nodes.inputSubjectLast.className = "content";
		this.nodes.inputSubjectLast.type = "text";
		this.nodes.divSubjectLast.appendChild(this.nodes.inputSubjectLast);
		
	this.nodes.divMessage = Rf.dc("div");
	this.nodes.divMessage.className = "divRelative";
	this.nodes.divMessage.style.left = "10px";
	this.nodes.divMessage.style.height = "96px";
	this.DIV.appendChild(this.nodes.divMessage);
	
		this.nodes.labelMessage = Rf.dc("div");
		this.nodes.labelMessage.className = "label";
		this.nodes.labelMessage.innerHTML = "Nachricht:";
		this.nodes.divMessage.appendChild(this.nodes.labelMessage);
		
		this.nodes.inputMessage = Rf.dc("textarea");
		this.nodes.inputMessage.className = "content";
		this.nodes.divMessage.appendChild(this.nodes.inputMessage);
	
	this.nodes.divSubmit = Rf.dc("div");
	this.nodes.divSubmit.className = "divRelative";
	this.nodes.divSubmit.style.left = "10px";
	this.nodes.divSubmit.style.height = "30px";
	this.DIV.appendChild(this.nodes.divSubmit);
		
		this.nodes.submitTaube = Rf.dc("div");
		this.nodes.submitTaube.className = "rfSubmit";
		this.nodes.submitTaube.style.left = "70px";
		this.nodes.submitTaube.innerHTML = "abschicken";
		this.nodes.submitTaube.rfTaube = this;
		this.nodes.submitTaube.onclick = function(){
			this.rfTaube.flieg();
		};
	this.nodes.divSubmit.appendChild(this.nodes.submitTaube);

}

//to, from, subject, message
Rf.CTaube.prototype.flieg = function(aH){
	if(this.fromId == null || this.fromId == 0){
		this.fromName = this.nodes.inputName.value;
		this.fromEmail = this.nodes.inputEmail.value;
		if(Rf.empty(this.fromName)){
			Rf.setError("Du hast deinen Namen noch nicht angegeben!");
			return false;
		}
		if(Rf.empty(this.fromEmail)){
			Rf.setError("Du hast deinen e-Mail-Adresse noch nicht angegeben!");
			return false;
		}
	}
	
	this.subjectLast = this.nodes.inputSubjectLast.value;
	this.subject = this.subjectFirst + this.subjectLast;
	this.messageLast = this.nodes.inputMessage.value;
	this.message = this.messageLast;
	
	var request = new Rf.Loading.CRequest();
	request.rfTaube = this;
	request.Data = {
		action:"flieg",
		to:this.to,
		toId:this.toId,
		toName:this.toName,
		fromId:this.fromId,
		fromName:this.fromName,
		fromEmail:this.fromEmail,
		subject:this.subject,
		message:this.message
	};
	
	request.onSuccess = function() {
		if(!Rf.empty(this.Response.error)){
			Rf.setError(this.Response.error);
			return false;
		}
		this.rfTaube.hideTaube();
		Rf.setMessage("Die Nachricht wurde erfolgreich versand!");
	}
	request.onError = function() { alert("error"); } 
	request.onTimeout = function() { alert("timeout"); } 
	var conn = new Rf.Loading.CConnectHTTPXML({ServiceUrl: "backend/rfTaube.php"}); 
	conn.sendRequest( request );
}
Rf.CTicker = function(aH){
	this.Delay = 4000;
	this.Fcontent = [];
	this.Begintag = "<font face=Arial size=2 align=center><b>";
	this.Closetag = "</b></font>";
	this.Fwidth = 720;
	this.Fheight = 16;
	this.Faderdelay = 0;
	this.Index = 0;
	this.Frame = 20;
	this.Hex = 255;
	this.Nodes = {};
	this.divID = aH.divID;
	
	if(Rf.CTicker._Instances == null){
		Rf.CTicker._Instances = [];
	}
	
	this.InstanceId = Rf.CTicker._Instances.length;
	Rf.CTicker._Instances.push(this);
	
	if(Rf.CTicker.DOM2){
		this.Faderdelay = 2000;
	}
	
	this.init(aH);
}

Rf.CTicker.prototype.Delay = null;
Rf.CTicker.prototype.Fcontent = null;
Rf.CTicker.prototype.Begintag = null;
Rf.CTicker.prototype.Closetag = null;
Rf.CTicker.prototype.Fwidth = null;
Rf.CTicker.prototype.Fheight = null;
Rf.CTicker.prototype.Faderdelay = null;
Rf.CTicker.prototype.Index = null;
Rf.CTicker.prototype.Frame = null;
Rf.CTicker.prototype.Hex = null;
Rf.CTicker.prototype.Nodes = null;
Rf.CTicker.prototype.divID = null;

Rf.CTicker.prototype.InstanceId = null;
Rf.CTicker._Instances = null;

Rf.CTicker.prototype.init = function(aH){
	this.getNews();
	
	
}

Rf.CTicker.prototype.getNews = function(){
	var request = new Rf.Loading.CRequest();
	request.rfTicker = this;
	request.Data = {
		action:"getNews"
	};
	
	request.onSuccess = function() {
		if(!Rf.empty(this.Response.error)){
			Rf.setError(this.Response.error);
		}
		else{
			for(var i=0; i<this.Response.news.length; i++){
				this.rfTicker.Fcontent.push(this.Response.news[i].headline);
			}
			
			if (Rf.CTicker.IE4 || Rf.CTicker.DOM2){
				this.rfTicker.Nodes.Fscroller = Rf.dc("div");
				this.rfTicker.Nodes.Fscroller.id = "fscroller";
				//this.rfTicker.Nodes.Fscroller.style.backgroundColor = "#FFFFFF";
				this.rfTicker.Nodes.Fscroller.style.border = "0px none #FFFFFF";
				this.rfTicker.Nodes.Fscroller.style.width = this.rfTicker.Fwidth+"px";
				this.rfTicker.Nodes.Fscroller.style.height = this.rfTicker.Fheight+"px";
				this.rfTicker.Nodes.Fscroller.style.padding = "2px";
				this.rfTicker.Nodes.Fscroller.style.lineHeight = "18px";
				Rf.dg(this.rfTicker.divID).appendChild(this.rfTicker.Nodes.Fscroller);
			}
			
			this.rfTicker.Nodes.Fscrollerns = Rf.dc("ilayer");
			this.rfTicker.Nodes.Fscrollerns.id = "fscrollerns";
			this.rfTicker.Nodes.Fscrollerns.style.width = this.rfTicker.Fwidth+"px";
			this.rfTicker.Nodes.Fscrollerns.style.height = this.rfTicker.Fheight+"px";
			
				this.rfTicker.Nodes.Fscrollerns_sub = Rf.dc("ilayer");
				this.rfTicker.Nodes.Fscrollerns_sub.id = "fscrollerns_sub";
				this.rfTicker.Nodes.Fscrollerns_sub.top = "0";
				this.rfTicker.Nodes.Fscrollerns_sub.left = "0";
				this.rfTicker.Nodes.Fscrollerns_sub.style.width = this.rfTicker.Fwidth+"px";
				this.rfTicker.Nodes.Fscrollerns_sub.style.height = this.rfTicker.Fheight+"px";
				this.rfTicker.Nodes.Fscrollerns.appendChild(this.rfTicker.Nodes.Fscrollerns_sub);
				
			Rf.dg(this.rfTicker.divID).appendChild(this.rfTicker.Nodes.Fscrollerns);
			
			Rf_CTicker_changeContent(this.rfTicker.InstanceId);
		}
	}	
	request.onError = function() {  } 
	request.onTimeout = function() {  } 
	var conn = new Rf.Loading.CConnectHTTPXML({ServiceUrl: "backend/rfTicker.php"}); 
	conn.sendRequest( request );
	/*
	this.Fcontent.push("bla");
	this.Fcontent.push("test");
	this.Fcontent.push("it");
	*/
}

Rf.CTicker.prototype.refresh = function(){
	var request = new Rf.Loading.CRequest();
	request.rfTicker = this;
	request.Data = {
		action:"getNews"
	};
	
	request.onSuccess = function() {
		if(!Rf.empty(this.Response.error)){
			Rf.setError(this.Response.error);
		}
		else{
			this.rfTicker.Fcontent = [];
			for(var i=0; i<this.Response.news.length; i++){
				this.rfTicker.Fcontent.push(this.Response.news[i].headline);
			}
		}
	}	
	request.onError = function() {  } 
	request.onTimeout = function() {  } 
	var conn = new Rf.Loading.CConnectHTTPXML({ServiceUrl: "backend/rfTicker.php"}); 
	conn.sendRequest( request );
}

Rf_CTicker_changeContent = function(instanceId){
	var ticker = Rf.CTicker._Instances[instanceId];
	if(ticker.Index>=ticker.Fcontent.length){
		ticker.Index=0;
	}
	if(Rf.CTicker.DOM2){
		ticker.Nodes.Fscroller.style.color="rgb(255,255,255)";
		ticker.Nodes.Fscroller.innerHTML=ticker.Begintag+ticker.Fcontent[ticker.Index]+ticker.Closetag;
		Rf_CTicker_colorfade(ticker.InstanceId);
	}
	else if(Rf.CTicker.IE4){
		ticker.Nodes.Fscroller.innerHTML=ticker.Begintag+ticker.Fcontent[ticker.Index]+ticker.Closetag;
	}
	else if(Rf.CTicker.NS4){
		document.fscrollerns.document.fscrollerns_sub.document.write(ticker.Begintag+ticker.Fcontent[ticker.Index]+ticker.Closetag);
		document.fscrollerns.document.fscrollerns_sub.document.close();
	}
	ticker.Index++;
	setTimeout("Rf_CTicker_changeContent("+ticker.InstanceId+")",(ticker.Delay+ticker.Faderdelay));
}

Rf_CTicker_colorfade = function(instanceId){
	var ticker = Rf.CTicker._Instances[instanceId];
	// 20 frames fading process
	if(ticker.Frame>0) {
		ticker.Hex-=12; // increase color value
		ticker.Nodes.Fscroller.style.color="rgb("+ticker.Hex+","+ticker.Hex+","+ticker.Hex+")"; // Set color value.
		ticker.Frame--;
		setTimeout("Rf_CTicker_colorfade("+ticker.InstanceId+")",20);
	}
	else{
		ticker.Nodes.Fscroller.style.color="rgb(0,0,0)";
		ticker.Frame=20;
		ticker.Hex=255
	}
}


Rf.CTicker.IE4 = document.all&&!document.getElementById;
Rf.CTicker.NS4 = document.layers;
Rf.CTicker.DOM2 = document.getElementById;

Rf.Dom = function(){}

Rf.Dom.DateTimePicker = function(aH){
	this.Nodes = {};
	this.create(aH);
}

Rf.Dom.DateTimePicker.prototype.DIV = null;
Rf.Dom.DateTimePicker.prototype.Nodes = null;

Rf.Dom.DateTimePicker.prototype.Day = null;
Rf.Dom.DateTimePicker.prototype.Month = null;
Rf.Dom.DateTimePicker.prototype.Year = null;
Rf.Dom.DateTimePicker.prototype.Hour = null;
Rf.Dom.DateTimePicker.prototype.Minute = null;

Rf.Dom.DateTimePicker.prototype.Disabled = false;

Rf.Dom.DateTimePicker.prototype.create = function(aH){
	var date = new Date();
	
	var currentDate = true
	if(!Rf.empty(aH.Day)){
		currentDate == false;
	}
	
	var leftPos = 0;
	
	this.DIV = Rf.dc("div");
	this.DIV.style.position = "relative";
	this.DIV.style.top = "0px";
	this.DIV.style.left = "0px";
	this.DIV.style.width = "230px";
	this.DIV.style.height = "20px";
	
	this.Nodes.FieldDay = Rf.dc("select");
	this.Nodes.FieldDay.DateTimePicker = this;
	this.Nodes.FieldDay.onChange = function(){
		this.DateTimePicker.Day = this.value;
	}
	this.Nodes.FieldDay.style.position = "absolute";
	this.Nodes.FieldDay.style.top = leftPos+"px";
	this.Nodes.FieldDay.style.left = "0px";
	this.Nodes.FieldDay.style.width = "38px";
	leftPos+=40;
	for(var i=1; i<32; i++){
		var option = Rf.dc("option");
		var preString = "";
		if(i<10){
			preString = "0";
		}
		option.value = i;
		option.innerHTML = ""+preString+i;
		/*if((currentDate == true && date.getDate() == i) || aH.Day == i){
			option.setAttribute("selected", "selected");
		}*/
		this.Nodes.FieldDay.appendChild(option);
	}
	this.DIV.appendChild(this.Nodes.FieldDay);
	
	var sep = Rf.dc("div");
	sep.style.position = "absolute";
	sep.style.top = "7px";
	sep.style.left = leftPos+"px";
	sep.style.width = "4px";
	leftPos+=8;
	sep.style.height = "4px";
	sep.style.fontWeight = "bold";
	sep.innerHTML = ".";
	this.DIV.appendChild(sep);
	
	this.Nodes.FieldMonth = Rf.dc("select");
	this.Nodes.FieldMonth.DateTimePicker = this;
	this.Nodes.FieldMonth.onChange = function(){
		this.DateTimePicker.Month = this.value;
	}
	this.Nodes.FieldMonth.style.position = "absolute";
	this.Nodes.FieldMonth.style.top = "0px";
	this.Nodes.FieldMonth.style.left = leftPos+"px";
	this.Nodes.FieldMonth.style.width = "38px";
	leftPos+=40;
	for(var i=1; i<13; i++){
		var option = Rf.dc("option");
		var preString = "";
		if(i<10){
			preString = "0";
		}
		option.value = i;
		option.innerHTML = ""+preString+i;
		/*if((currentDate == true && date.getMonth() == i) || aH.Month == i){
			option.setAttribute("selected", "selected");
		}*/
		this.Nodes.FieldMonth.appendChild(option);
	}
	this.DIV.appendChild(this.Nodes.FieldMonth);
	
	var sep = Rf.dc("div");
	sep.style.position = "absolute";
	sep.style.top = "7px";
	sep.style.left = leftPos+"px";
	sep.style.width = "4px";
	leftPos+=8;
	sep.style.height = "4px";
	sep.style.fontWeight = "bold";
	sep.innerHTML = ".";
	this.DIV.appendChild(sep);
	
	this.Nodes.FieldYear = Rf.dc("select");
	this.Nodes.FieldYear.DateTimePicker = this;
	this.Nodes.FieldYear.onChange = function(){
		this.DateTimePicker.Year = this.value;
	}
	this.Nodes.FieldYear.style.position = "absolute";
	this.Nodes.FieldYear.style.top = "0px";
	this.Nodes.FieldYear.style.left = leftPos+"px";
	this.Nodes.FieldYear.style.width = "50px";
	leftPos+=68;
	for(var i=(date.getFullYear()-1); i<(date.getFullYear()+2); i++){
		var option = Rf.dc("option");
		option.value = i;
		option.innerHTML = ""+i;
		/*if((currentDate == true && date.getFullYear() == i) || aH.Year == i){
			option.setAttribute("selected", "selected");
		}*/
		this.Nodes.FieldYear.appendChild(option);
	}
	this.DIV.appendChild(this.Nodes.FieldYear);


	this.Nodes.FieldHour = Rf.dc("select");
	this.Nodes.FieldHour.DateTimePicker = this;
	this.Nodes.FieldHour.onChange = function(){
		this.DateTimePicker.Hour = this.value;
	}
	this.Nodes.FieldHour.style.position = "absolute";
	this.Nodes.FieldHour.style.top = "0px";
	this.Nodes.FieldHour.style.left = leftPos+"px";
	this.Nodes.FieldHour.style.width = "38px";
	leftPos+=42;
	for(var i=0; i<24; i++){
		var option = Rf.dc("option");
		var preString = "";
		if(i<10){
			preString = "0";
		}
		option.value = i;
		option.innerHTML = ""+preString+i;
		/*if((currentDate == true && date.getHours() == i) || aH.Hour == i){
			option.setAttribute("selected", "selected");
		}*/
		this.Nodes.FieldHour.appendChild(option);
	}
	this.DIV.appendChild(this.Nodes.FieldHour);
	
	var sep = Rf.dc("div");
	sep.style.position = "absolute";
	sep.style.top = "2px";
	sep.style.left = leftPos+"px";
	sep.style.width = "4px";
	leftPos+=8;
	sep.style.height = "8px";
	sep.style.fontWeight = "bold";
	sep.innerHTML = ":";
	this.DIV.appendChild(sep);
	
	this.Nodes.FieldMinute = Rf.dc("select");
	this.Nodes.FieldMinute.DateTimePicker = this;
	this.Nodes.FieldMinute.onChange = function(){
		this.DateTimePicker.Minute = this.value;
	}
	this.Nodes.FieldMinute.style.position = "absolute";
	this.Nodes.FieldMinute.style.top = "0px";
	this.Nodes.FieldMinute.style.left = leftPos+"px";
	this.Nodes.FieldMinute.style.width = "38px";
	leftPos+=40;
	for(var i=0; i<60; i++){
		var option = Rf.dc("option");
		var preString = "";
		if(i<10){
			preString = "0";
		}
		option.value = i;
		option.innerHTML = ""+preString+i;
		/*if((currentDate == true && date.getMinutes() == i) || aH.Minute == i){
			option.setAttribute("selected", "selected");
		}*/
		this.Nodes.FieldMinute.appendChild(option);
	}
	this.DIV.appendChild(this.Nodes.FieldMinute);
	
	this.disable();
}

Rf.Dom.DateTimePicker.prototype.disable = function(){
	this.Nodes.FieldDay.setAttribute("disabled", "disabled");
	this.Nodes.FieldMonth.setAttribute("disabled", "disabled");
	this.Nodes.FieldYear.setAttribute("disabled", "disabled");
	this.Nodes.FieldHour.setAttribute("disabled", "disabled");
	this.Nodes.FieldMinute.setAttribute("disabled", "disabled");
}

Rf.Dom.DateTimePicker.prototype.enable = function(){
	this.Nodes.FieldDay.disabled = false;
	this.Nodes.FieldMonth.disabled = false;
	this.Nodes.FieldYear.disabled = false;
	this.Nodes.FieldHour.disabled = false;
	this.Nodes.FieldMinute.disabled = false;
}

//{string} Datetime
Rf.Dom.DateTimePicker.prototype.set = function(aH){
	var datetimeArray = Rf.getDateTimeArray(aH.Datetime);
	this.Nodes.FieldYear.value = datetimeArray[0];
	this.Nodes.FieldMonth.value = datetimeArray[1];
	this.Nodes.FieldDay.value = datetimeArray[2];
	this.Nodes.FieldHour.value = datetimeArray[3];
	this.Nodes.FieldMinute.value = datetimeArray[4];
}

//{string} Datetime
Rf.Dom.DateTimePicker.prototype.refresh = function(aH){
	var date = new Date();
	this.Nodes.FieldYear.value = date.getFullYear();
	this.Nodes.FieldMonth.value = (date.getMonth()+1);
	this.Nodes.FieldDay.value = date.getDate();
	this.Nodes.FieldHour.value = date.getHours();
	this.Nodes.FieldMinute.value = date.getMinutes();
}

//{string} Datetime
Rf.Dom.DateTimePicker.prototype.getDBString = function(){
	var preString = "";
	var dbDateString = "";
	
	dbDateString += this.Nodes.FieldYear.value+"-";
	
	if(this.Nodes.FieldMonth.value < 10){
		preString = "0";
	}
	dbDateString += preString+this.Nodes.FieldMonth.value+"-";
	preString = "";
	
	if(this.Nodes.FieldDay.value < 10){
		preString = "0";
	}
	dbDateString += preString+this.Nodes.FieldDay.value+" ";
	preString = "";
	
	if(this.Nodes.FieldHour.value < 10){
		preString = "0";
	}
	dbDateString += preString+this.Nodes.FieldHour.value+":";
	preString = "";
	
	if(this.Nodes.FieldMinute.value < 10){
		preString = "0";
	}
	dbDateString += preString+this.Nodes.FieldMinute.value+":";
	preString = "";
	
	dbDateString += "00";
	
	return dbDateString;
}

/*
Rf.Dom.setOpacity = function(obj, opacity) {
  opacity = (opacity == 100)?99.999:opacity;
  // IE/Win
  obj.style.filter = "alpha(opacity:"+opacity+")";
  
  // Safari<1.2, Konqueror
  obj.style.KHTMLOpacity = opacity/100;
  
  // Older Mozilla and Firefox
  obj.style.MozOpacity = opacity/100;
  
  // Safari 1.2, newer Firefox and Mozilla, CSS3
  obj.style.opacity = opacity/100;
}

Rf.Dom.fadeIn = function(objId, opacity_stepdiff, opacity_start, opacity_end) {
	if(typeof opacity_stepdiff != 'number'){alert('Error')}
	if(typeof opacity_start != 'number' || opacity_start < 0 || opacity_start > 100){{opacity_start = 0}}
	if(typeof opacity_end != 'number' || opacity_end < 0 || opacity_end > 100){{opacity_end = 100}}
  if (document.getElementById) {
    obj = document.getElementById(objId);
    if (opacity_start <= opacity_end) {
      setOpacity(obj, opacity_start);
      var opacity = opacity_start + opacity_stepdiff;
      window.setTimeout("fadeIn('"+objId+"',"+opacity_stepdiff+","+opacity+","+opacity_end+")", 100);
    }
  }
}

Rf.Dom.fadeOut = function(objId, opacity_stepdiff, opacity_start, opacity_end) {
	if(typeof opacity_stepdiff != 'number'){alert('Error')}
	if(typeof opacity_start != 'number' || opacity_start < 0 || opacity_start > 100){{opacity_start = 100}}
	if(typeof opacity_end != 'number' || opacity_end < 0 || opacity_end > 100){{opacity_end = 0}}
  if (document.getElementById) {
    obj = document.getElementById(objId);
    if (opacity_start <= opacity_end) {
      setOpacity(obj, opacity_start);
      var opacity = opacity_start - opacity_stepdiff;
      window.setTimeout("fadeIn('"+objId+"',"+opacity_stepdiff+","+opacity+","+opacity_end+")", 100);
    }
  }
}

Rf.Dom.setMainNaviClass = function(objId, newState){
	dg(objId).className = 'rfMainNavi_'+newState;
}
*/

Rf.Dom.RoundBox = function(aH){
	this.Nodes = {};
	this.create(aH);
	return this;
}

Rf.Dom.RoundBox.prototype.DIV = null;
Rf.Dom.RoundBox.prototype.Nodes = null;

Rf.Dom.RoundBox.prototype.create = function(aH){
	this.DIV = Rf.dc("div");
	this.DIV.style.position = "relative";
	this.DIV.style.width = "100%";
	this.DIV.style.height = "100%";
	
	this.Nodes.BgTable = Rf.dc("table");
	this.Nodes.BgTable.cellpadding = "0";
	this.Nodes.BgTable.cellspacing = "0";
	this.Nodes.BgTable.border = "0";
	this.Nodes.BgTable.style.width = "100%";
	this.Nodes.BgTable.style.height = "100%";
		var tbody = Rf.dc("tbody");
		var tr = Rf.dc("tr");
			var td = Rf.dc("td");
			td.style.width = "11px";
			td.style.height = "20px";
			td.innerHTML = "<img src=\"images/common/roundbox_corner_tl.gif\" style=\"width:11px; height:11px;\" />";
			td.style.backgroundImage = "url('images/common/roundbox_edge_l.gif')";
			td.style.backgroundColor = "#d0c6b0";
			td.style.verticalAlign = "top";
			td.style.lineHeight = "1px";
			td.style.fontSize = "1px";
			tr.appendChild(td);
			var td = Rf.dc("td");
			td.style.width = "100%";
			td.style.height = "22px";
			td.style.backgroundImage = "url('images/common/roundbox_edge_t.gif')";
			td.style.backgroundColor = "#d0c6b0";
			td.style.backgroundRepeat = "repeat-x";
			
				this.Nodes.Header = Rf.dc("div");
				this.Nodes.Header.style.position = "relative";
				this.Nodes.Header.style.top = "2px";
				this.Nodes.Header.style.left = "0px";
				this.Nodes.Header.style.width = "100%";
				this.Nodes.Header.style.height = "100%";
				this.Nodes.Header.style.textAlign = "left";
				this.Nodes.Header.style.fontWeight = "bold";
				//this.Nodes.Header.innerHTML = "Header";
				td.appendChild(this.Nodes.Header);
			
			tr.appendChild(td);
			var td = Rf.dc("td");
			td.style.width = "11px";
			td.style.height = "20px";
			td.innerHTML = "<img src=\"images/common/roundbox_corner_tr.gif\" style=\"width:11px; height:11px;\" />";
			td.style.backgroundImage = "url('images/common/roundbox_edge_r.gif')";
			td.style.backgroundColor = "#d0c6b0";
			td.style.verticalAlign = "top";
			td.style.lineHeight = "1px";
			td.style.fontSize = "1px";
			tr.appendChild(td);
		tbody.appendChild(tr);
		var tr = Rf.dc("tr");
			var td = Rf.dc("td");
			td.style.width = "11px";
			td.style.height = "100%";
			td.style.backgroundImage = "url('images/common/roundbox_edge_l.gif')";
			td.style.lineHeight = "1px";
			td.style.fontSize = "1px";
			tr.appendChild(td);
			var td = Rf.dc("td");
			td.style.width = "100%";
			td.style.height = "100%";
			
				this.Nodes.Content = Rf.dc("div");
				this.Nodes.Content.style.position = "relative";
				this.Nodes.Content.style.top = "5px";
				this.Nodes.Content.style.left = "0px";
				this.Nodes.Content.style.width = "100%";
				this.Nodes.Content.style.height = "100%";
				this.Nodes.Content.style.textAlign = "left";
				this.Nodes.Content.style.fontWeight = "normal";
				//this.Nodes.Content.innerHTML = "Content<br/>Content";
				td.appendChild(this.Nodes.Content);
			
			tr.appendChild(td);
			var td = Rf.dc("td");
			td.style.width = "11px";
			td.style.height = "100%";
			td.style.backgroundImage = "url('images/common/roundbox_edge_r.gif')";
			td.style.lineHeight = "1px";
			td.style.fontSize = "1px";
			tr.appendChild(td);
		tbody.appendChild(tr);
		var tr = Rf.dc("tr");
			var td = Rf.dc("td");
			td.style.width = "11px";
			td.style.height = "11px";
			td.innerHTML = "<img src=\"images/common/roundbox_corner_bl.gif\" style=\"width:11px;height:11px;\" />";
			td.style.lineHeight = "1px";
			td.style.fontSize = "1px";
			tr.appendChild(td);
			var td = Rf.dc("td");
			td.style.width = "100%";
			td.style.height = "11px";
			td.style.backgroundImage = "url('images/common/roundbox_edge_b.gif')";
			td.style.lineHeight = "1px";
			td.style.fontSize = "1px";
			tr.appendChild(td);
			var td = Rf.dc("td");
			td.style.width = "11px";
			td.style.height = "11px";
			td.innerHTML = "<img src=\"images/common/roundbox_corner_br.gif\" style=\"width:11px; height:11px;\" />";
			td.style.lineHeight = "1px";
			td.style.fontSize = "1px";
			tr.appendChild(td);
		tbody.appendChild(tr);
	this.Nodes.BgTable.appendChild(tbody);
	this.DIV.appendChild(this.Nodes.BgTable);

}
Rf.Event = function (){}

Rf.Event.getMouseXY = function(evt) {
	e = evt || window.event;
	if(!e) return null;
	
	var coordsHash = {};
	
	if(document.layers) {
		coordsHash.X = e.pageX;
		coordsHash.Y = e.pageY
	}else if(window.opera){
		coordsHash.X = e.clientX;
		coordsHash.Y = e.clientY;
	}else if(document.all) {
		coordsHash.X = e.clientX + document.getElementsByTagName('body')[0].scrollLeft;
		coordsHash.Y = e.clientY + document.getElementsByTagName('body')[0].scrollTop;
	}else if(document.getElementById) {
		coordsHash.X = e.pageX;
		coordsHash.Y =  e.pageY;
	}
	return coordsHash;
}
;Rf.Image = function(){}

Rf.Image.swapImgRestore = function() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

Rf.Image.preloadImages = function() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

Rf.Image.findObj = function(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

Rf.Image.swapImage = function() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
;Rf.Info = function(){}

Rf.Info.DIV = null;

Rf.Info.iframeId = 'rfInfoFrame';
Rf.Info.rfInfoMainTableId = 'rfInfoMainTable';

Rf.Info.appendIFrame = function(){
	document.getElementsByTagName('body')[0].appendChild(Rf.Info.createIFrame());
	frames[Rf.Info.iframeId].document.open('text/html');
	frames[Rf.Info.iframeId].document.writeln('<html><head><title></title></head><body>');
	frames[Rf.Info.iframeId].document.writeln('infoFrame');
	frames[Rf.Info.iframeId].document.writeln('</body></html>');
	frames[Rf.Info.iframeId].document.close();
	//dg(Rf.Info.iframeId).backgroundColor = 'transparent';
	//rfLayout.setOpacity(dg(Rf.Info.iframeId), 0);
}

Rf.Info.createIFrame = function(){
	var iframe = dc('iframe');
	iframe.id = Rf.Info.iframeId;
	iframe.name = Rf.Info.iframeId;
	iframe.scrolling = 'no';
	iframe.frameBorder = 0;
	iframe.marginwidth = '0';
	iframe.marginheight = '0';
	//iframe.style.width = '0px';
	//iframe.style.height = '0px';
	iframe.allowTransparency = 'true';
	//iframe.style.background = 'none transparent';
	iframe.style.background = 'none transparent';
	//iframe.style.filter = 'chroma(color=#FFFFFF)';
	//FILTER: chroma(color=#FFFFFF)
	iframe.style.padding = '0px';
	iframe.style.position = 'absolute';
	iframe.style.top = '0px';
	iframe.style.left = '0px';
	iframe.style.textAlign = 'center';
	iframe.style.verticalAlign = 'middle';
	iframe.style.zIndex = '-1';
	iframe.style.display = 'none';
	iframe.onmouseover = 'Rf.Info.showInfo(event)';
	return iframe;
}


Rf.Info.show = function(evt, content, top, right, bottom, left, obj){
	if(Rf.Info.DIV == null){
		Rf.Info.DIV = Rf.dc("div");
		Rf.Info.DIV.style.display = "none";
		Rf.Info.DIV.style.zIndex = "-1";
		Rf.Info.DIV.style.position = "absolute";
		Rf.Info.DIV.style.top = "0px";
		Rf.Info.DIV.style.left = "0px";
		//Rf.Info.DIV.style.border = "2px solid #AA0000";
		Rf.Info.DIV.style.width = "320px";
		Rf.Info.DIV.style.backgroundColor = "#FFFFFF";
		document.getElementsByTagName("body")[0].appendChild(Rf.Info.DIV);
	}
	
	var table = Rf.dc("table");
	var tbody = Rf.dc("tbody");
	table.appendChild(tbody);
	
	var tr = Rf.dc("tr");
	tbody.appendChild(tr);
		var td = Rf.dc("td");
		td.style.lineHeight = "1px";
		td.innerHTML = "<img src=\"images/common/bg_info_corner_topleft.gif\" style=\"width:5px; height:5px;\" />";
		tr.appendChild(td);
		var td = Rf.dc("td");
		td.style.lineHeight = "1px";
		td.style.width = "100%";
		td.style.backgroundImage = "url('images/common/bg_info_edge_top.gif')";
		tr.appendChild(td);
		var td = Rf.dc("td");
		td.style.lineHeight = "1px";
		td.innerHTML = "<img src=\"images/common/bg_info_corner_topright.gif\" style=\"width:5px; height:5px;\" />";
		tr.appendChild(td);
		
	var tr = Rf.dc("tr");
	tbody.appendChild(tr);
		var td = Rf.dc("td");
		td.style.backgroundImage = "url('images/common/bg_info_edge_left.gif')";
		tr.appendChild(td);
		var td = Rf.dc("td");
		td.style.width = "100%";
		td.style.padding = "3px";
		td.innerHTML = content;
		tr.appendChild(td);
		var td = Rf.dc("td");
		td.style.backgroundImage = "url('images/common/bg_info_edge_right.gif')";
		tr.appendChild(td);
	
	var tr = Rf.dc("tr");
	tbody.appendChild(tr);
		var td = Rf.dc("td");
		td.style.lineHeight = "1px";
		td.innerHTML = "<img src=\"images/common/bg_info_corner_bottomleft.gif\" style=\"width:5px; height:5px;\" />";
		tr.appendChild(td);
		var td = Rf.dc("td");
		td.style.lineHeight = "1px";
		td.style.width = "100%";
		td.style.backgroundImage = "url('images/common/bg_info_edge_bottom.gif')";
		tr.appendChild(td);
		var td = Rf.dc("td");
		td.style.lineHeight = "1px";
		td.innerHTML = "<img src=\"images/common/bg_info_corner_bottomright.gif\" style=\"width:5px; height:5px;\" />";
		tr.appendChild(td);
	
	
	Rf.Info.DIV.innerHTML = "";
	Rf.Info.DIV.appendChild(table);
	Rf.Info.DIV.style.display = "block";
	Rf.Info.DIV.style.zIndex = "1000";
	
	if(typeof top != "number" && typeof right != "number" && typeof bottom != "number" && typeof left != "number"){
		var coordsHash = Rf.Event.getMouseXY(evt);
		coordsHash.X = coordsHash.X +10;
		coordsHash.Y = coordsHash.Y -10;
		Rf.Info.DIV.style.top = coordsHash.Y + 'px';
		Rf.Info.DIV.style.left = (coordsHash.X-330) + 'px';
	}
	else{
		if(typeof top == "number"){
			Rf.Info.DIV.style.top = top + 'px';
		}
		else{
			Rf.Info.DIV.style.top = '';
		}
		if(typeof right == "number"){
			Rf.Info.DIV.style.right = right + 'px';
		}
		else{
			Rf.Info.DIV.style.right = '';
		}
		if(typeof bottom == "number"){
			Rf.Info.DIV.style.bottom = bottom + 'px';
		}
		else{
			Rf.Info.DIV.style.bottom = '';
		}
		if(typeof left == "number"){
			Rf.Info.DIV.style.left = left + 'px';
		}
		else{
			Rf.Info.DIV.style.left = '';
		}
	}
	
	
return true;
	if(typeof dg(Rf.Info.iframeId) == 'boolean' && dg(Rf.Info.iframeId) == false){
		Rf.Info.appendIFrame();
	}
	if(typeof content == 'string' && content != ''){
		var scriptContent = '';
		scriptContent += 'var dg = function(id){return document.getElementById(id);}';
		frames[Rf.Info.iframeId].document.open('text/html');
		frames[Rf.Info.iframeId].document.writeln('<html style="background:none transparent;"><head><title></title><script language="Javascript">'+scriptContent+'</script></head><body style="margin:0px; padding:0px; background:none transparent;">');
		frames[Rf.Info.iframeId].document.writeln('<table id="'+Rf.Info.rfInfoMainTableId+'" style="border-collapse:collapse; border:5px solid red; background:none transparent;"><tbody style="background:none transparent;"><tr><td>');
		frames[Rf.Info.iframeId].document.writeln(content);
		frames[Rf.Info.iframeId].document.writeln('</td></tr></tbody></table>');
		frames[Rf.Info.iframeId].document.writeln('</body></html>');
		frames[Rf.Info.iframeId].document.close();
	}
	dg(Rf.Info.iframeId).style.display = 'block';
	var rfInfoMainTableHeight = rfLayout.getObjectHeight(frames[Rf.Info.iframeId].dg(Rf.Info.rfInfoMainTableId));
	var rfInfoMainTableWidth = rfLayout.getObjectWidth(frames[Rf.Info.iframeId].dg(Rf.Info.rfInfoMainTableId));
	//alert(rfInfoMainTableHeight+' '+rfInfoMainTableWidth);
	rfLayout.setHeight(Rf.Info.iframeId, rfInfoMainTableHeight);
	rfLayout.setWidth(Rf.Info.iframeId, rfInfoMainTableWidth);
	dg(Rf.Info.iframeId).style.zIndex = '100';
	//rfLayout.setOpacity(frames[Rf.Info.iframeId].dg(Rf.Info.rfInfoMainTableId), 100);
	
		
	
	
	//rfLayout.setHeight(Rf.Info.iframeId, 100);
	//rfLayout.setWidth(Rf.Info.iframeId, 100);
	
		
	var coordsHash = rfEvent.getMouseXY(evt);
	coordsHash.X = coordsHash.X +10;
	coordsHash.Y = coordsHash.Y -20;
	/*
	var e = new CEvent( evt );
	e.clientX = e.clientX + 10;
	e.clientY = e.clientY - 20;
	*/

	dg(Rf.Info.iframeId).style.left = coordsHash.X + 'px';
	dg(Rf.Info.iframeId).style.top = coordsHash.Y + 'px';
return true;		
	var infoTable = m24DOM.getNewTable(null, 'map24InfoLayer');
		infoTable.style.width = '100%';
		var Row = m24DOM.getNewTableRow(null);
		var Cell = m24DOM.getNewTableCell(gIMGTag('button_info_std.gif', 7, 12, 'common', null, null), 'infoLayerIButton');
		Cell.style.paddingRight = '5px';
		Row.appendChild(Cell);
		var Cell = m24DOM.getNewTableCell(gT(resId), null);
		Row.appendChild(Cell);
	infoTable.appendChild(Row);
}

Rf.Info.hide = function(){
	if(Rf.Info.DIV != null){
		Rf.Info.DIV.style.zIndex = '-1';
		Rf.Info.DIV.style.top = '0px';
		Rf.Info.DIV.style.left = '0px';
		Rf.Info.DIV.style.display = 'none';
		//dg(Rf.Info.iframeId).style.width = '0px';
		//dg(Rf.Info.iframeId).style.height = '0px';
	}
}

Rf.Info.showAppended = function(evt, content, top, right, bottom, left, obj, infoBox){
	if(infoBox == null){
		infoBox = Rf.dc("div");
		infoBox.style.display = "none";
		infoBox.style.zIndex = "-1";
		infoBox.style.position = "absolute";
		infoBox.style.top = "0px";
		infoBox.style.left = "0px";
		//infoBox.style.border = "2px solid #AA0000";
		infoBox.style.width = "320px";
		infoBox.style.backgroundColor = "#FFFFFF";
		obj.appendChild(infoBox);
	}
	
	var table = Rf.dc("table");
	var tbody = Rf.dc("tbody");
	table.appendChild(tbody);
	
	var tr = Rf.dc("tr");
	tbody.appendChild(tr);
		var td = Rf.dc("td");
		td.style.lineHeight = "1px";
		td.innerHTML = "<img src=\"images/common/bg_info_corner_topleft.gif\" style=\"width:5px; height:5px;\" />";
		tr.appendChild(td);
		var td = Rf.dc("td");
		td.style.lineHeight = "1px";
		td.style.width = "100%";
		td.style.backgroundImage = "url('images/common/bg_info_edge_top.gif')";
		tr.appendChild(td);
		var td = Rf.dc("td");
		td.style.lineHeight = "1px";
		td.innerHTML = "<img src=\"images/common/bg_info_corner_topright.gif\" style=\"width:5px; height:5px;\" />";
		tr.appendChild(td);
		
	var tr = Rf.dc("tr");
	tbody.appendChild(tr);
		var td = Rf.dc("td");
		td.style.backgroundImage = "url('images/common/bg_info_edge_left.gif')";
		tr.appendChild(td);
		var td = Rf.dc("td");
		td.style.width = "100%";
		td.style.padding = "3px";
		td.innerHTML = content;
		tr.appendChild(td);
		var td = Rf.dc("td");
		td.style.backgroundImage = "url('images/common/bg_info_edge_right.gif')";
		tr.appendChild(td);
	
	var tr = Rf.dc("tr");
	tbody.appendChild(tr);
		var td = Rf.dc("td");
		td.style.lineHeight = "1px";
		td.innerHTML = "<img src=\"images/common/bg_info_corner_bottomleft.gif\" style=\"width:5px; height:5px;\" />";
		tr.appendChild(td);
		var td = Rf.dc("td");
		td.style.lineHeight = "1px";
		td.style.width = "100%";
		td.style.backgroundImage = "url('images/common/bg_info_edge_bottom.gif')";
		tr.appendChild(td);
		var td = Rf.dc("td");
		td.style.lineHeight = "1px";
		td.innerHTML = "<img src=\"images/common/bg_info_corner_bottomright.gif\" style=\"width:5px; height:5px;\" />";
		tr.appendChild(td);
	
	
	infoBox.innerHTML = "";
	infoBox.appendChild(table);
	infoBox.style.display = "block";
	infoBox.style.zIndex = "1000";


	
	if(typeof top != "number" && typeof right != "number" && typeof bottom != "number" && typeof left != "number"){
		var coordsHash = Rf.Event.getMouseXY(evt);
		coordsHash.X = coordsHash.X +10;
		coordsHash.Y = coordsHash.Y -10;
		infoBox.style.top = coordsHash.Y + 'px';
		infoBox.style.left = (coordsHash.X-330) + 'px';
	}
	else{
		if(typeof top == "number"){
			infoBox.style.top = top + 'px';
		}
		else{
			infoBox.style.top = '';
		}
		if(typeof right == "number"){
			infoBox.style.right = right + 'px';
		}
		else{
			infoBox.style.right = '';
		}
		if(typeof bottom == "number"){
			infoBox.style.bottom = bottom + 'px';
		}
		else{
			infoBox.style.bottom = '';
		}
		if(typeof left == "number"){
			infoBox.style.left = left + 'px';
		}
		else{
			infoBox.style.left = '';
		}
	}


	return infoBox;
}

Rf.Info.hideAppended = function(infoBox){
	if(infoBox != null){
		infoBox.style.zIndex = '-1';
		//infoBox.style.top = '0px';
		//infoBox.style.left = '0px';
		infoBox.style.display = 'none';
		//dg(Rf.Info.iframeId).style.width = '0px';
		//dg(Rf.Info.iframeId).style.height = '0px';
	}
}

;Rf.Layout = function (){}

// Global variables
Rf.Layout.isCSS;
Rf.Layout.isW3C;
Rf.Layout.isIE4;
Rf.Layout.isNN4;
Rf.Layout.isIE6CSS;

// Initialize upon load to let all browsers establish content objects
Rf.Layout.initDHTMLAPI = function( ) {
    if (document.images) {
        Rf.Layout.isCSS = (document.body && document.body.style) ? true : false;
        Rf.Layout.isW3C = (Rf.Layout.isCSS && document.getElementById) ? true : false;
        Rf.Layout.isIE4 = (Rf.Layout.isCSS && document.all) ? true : false;
        Rf.Layout.isNN4 = (document.layers) ? true : false;
        Rf.Layout.isIE6CSS = (document.compatMode && document.compatMode.indexOf("CSS1") >= 0) ? 
            true : false;
    }
}

Rf.Layout.setOpacity = function(obj, opacity) {
  opacity = (opacity == 100)?99.999:opacity;
  // IE/Win
  obj.style.filter = "alpha(opacity:"+opacity+")";
  
  // Safari<1.2, Konqueror
  obj.style.KHTMLOpacity = opacity/100;
  
  // Older Mozilla and Firefox
  obj.style.MozOpacity = opacity/100;
  
  // Safari 1.2, newer Firefox and Mozilla, CSS3
  obj.style.opacity = opacity/100;
}

// Seek nested NN4 layer from string name
Rf.Layout.seekLayer = function(doc, name) {
    var theObj;
    for (var i = 0; i < doc.layers.length; i++) {
        if (doc.layers[i].name == name) {
            theObj = doc.layers[i];
            break;
        }
        // dive into nested layers if necessary
        if (doc.layers[i].document.layers.length > 0) {
            theObj = Rf.Layout.seekLayer(document.layers[i].document, name);
        }
    }
    return theObj;
}
   
// Convert object name string or object reference
// into a valid element object reference
Rf.Layout.getRawObject = function(obj) {
    var theObj;
    if (typeof obj == "string") {
        if (Rf.Layout.isW3C) {
            theObj = document.getElementById(obj);
        } else if (Rf.Layout.isIE4) {
            theObj = document.all(obj);
        } else if (Rf.Layout.isNN4) {
            theObj = Rf.Layout.seekLayer(document, obj);
        }
    } else {
        // pass through object reference
        theObj = obj;
    }
    return theObj;
}
   
// Convert object name string or object reference
// into a valid style (or NN4 layer) reference
Rf.Layout.getObject = function(obj) {
    var theObj = Rf.Layout.getRawObject(obj);
    if (theObj && Rf.Layout.isCSS) {
        theObj = theObj.style;
    }
    return theObj;
}
   
// Position an object at a specific pixel coordinate
Rf.Layout.shiftTo = function(obj, x, y) {
    var theObj = Rf.Layout.getObject(obj);
    if (theObj) {
        if (Rf.Layout.isCSS) {
            // equalize incorrect numeric value type
            var units = (typeof theObj.left == "string") ? "px" : 0;
            theObj.left = x + units;
            theObj.top = y + units;
        } else if (Rf.Layout.isNN4) {
            theObj.moveTo(x,y)
        }
    }
}
   
// Move an object by x and/or y pixels
Rf.Layout.shiftBy = function(obj, deltaX, deltaY) {
    var theObj = Rf.Layout.getObject(obj);
    if (theObj) {
        if (Rf.Layout.isCSS) {
            // equalize incorrect numeric value type
            var units = (typeof theObj.left == "string") ? "px" : 0;
            theObj.left = Rf.Layout.getObjectLeft(obj) + deltaX + units;
            theObj.top = Rf.Layout.getObjectTop(obj) + deltaY + units;
        } else if (Rf.Layout.isNN4) {
            theObj.moveBy(deltaX, deltaY);
        }
    }
}
   
// Set the z-order of an object
Rf.Layout.setZIndex = function(obj, zOrder) {
    var theObj = Rf.Layout.getObject(obj);
    if (theObj) {
        theObj.zIndex = zOrder;
    }
}
   
// Set the background color of an object
Rf.Layout.setBGColor = function(obj, color) {
    var theObj = Rf.Layout.getObject(obj);
    if (theObj) {
        if (Rf.Layout.isNN4) {
            theObj.bgColor = color;
        } else if (Rf.Layout.isCSS) {
            theObj.backgroundColor = color;
        }
    }
}
   
// Set the visibility of an object to visible
Rf.Layout.show = function(obj) {
    var theObj = Rf.Layout.getObject(obj);
    if (theObj) {
        theObj.visibility = "visible";
    }
}
   
// Set the visibility of an object to hidden
Rf.Layout.hide = function(obj) {
    var theObj = Rf.Layout.getObject(obj);
    if (theObj) {
        theObj.visibility = "hidden";
    }
}
   
// Retrieve the x coordinate of a positionable object
Rf.Layout.getObjectLeft = function(obj)  {
    var elem = Rf.Layout.getRawObject(obj);
    var result = 0;
    if (document.defaultView) {
        var style = document.defaultView;
        var cssDecl = style.getComputedStyle(elem, "");
        result = cssDecl.getPropertyValue("left");
    } else if (elem.currentStyle) {
        result = elem.currentStyle.left;
    } else if (elem.style) {
        result = elem.style.left;
    } else if (Rf.Layout.isNN4) {
        result = elem.left;
    }
    return parseInt(result);
}
   
// Retrieve the y coordinate of a positionable object
Rf.Layout.getObjectTop = function(obj)  {
    var elem = Rf.Layout.getRawObject(obj);
    var result = 0;
    if (document.defaultView) {
        var style = document.defaultView;
        var cssDecl = style.getComputedStyle(elem, "");
        result = cssDecl.getPropertyValue("top");
    } else if (elem.currentStyle) {
        result = elem.currentStyle.top;
    } else if (elem.style) {
        result = elem.style.top;
    } else if (Rf.Layout.isNN4) {
        result = elem.top;
    }
    return parseInt(result);
}
   
// Retrieve the rendered width of an element
Rf.Layout.getObjectWidth = function(obj)  {
    var elem = Rf.Layout.getRawObject(obj);
    var result = 0;
    if (elem.offsetWidth) {
        result = elem.offsetWidth;
    } else if (elem.clip && elem.clip.width) {
        result = elem.clip.width;
    } else if (elem.style && elem.style.pixelWidth) {
        result = elem.style.pixelWidth;
    }
    return parseInt(result);
}
   
// Retrieve the rendered height of an element
Rf.Layout.getObjectHeight = function(obj)  {
    var elem = Rf.Layout.getRawObject(obj);
    var result = 0;
    if (elem.offsetHeight) {
        result = elem.offsetHeight;
    } else if (elem.clip && elem.clip.height) {
        result = elem.clip.height;
    } else if (elem.style && elem.style.pixelHeight) {
        result = elem.style.pixelHeight;
    }
    return parseInt(result);
}
   
// Return the available content width space in browser window
Rf.Layout.getInsideWindowWidth = function( ) {
    if (window.innerWidth) {
        return window.innerWidth;
    } else if (Rf.Layout.isIE6CSS) {
        // measure the html element's clientWidth
        return document.body.parentElement.clientWidth;
    } else if (document.body && document.body.clientWidth) {
        return document.body.clientWidth;
    }
    return 0;
}
   
// Return the available content height space in browser window
Rf.Layout.getInsideWindowHeight = function( ) {
    if (window.innerHeight) {
        return window.innerHeight;
    } else if (Rf.Layout.isIE6CSS) {
        // measure the html element's clientHeight
        return document.body.parentElement.clientHeight;
    } else if (document.body && document.body.clientHeight) {
    	alert('hier');
        return document.body.clientHeight;
    }
    return 0;
}

Rf.Layout.setHeight = function(id, height) {
	if(typeof height != 'number'){height = 0;}
	if(Rf.dg(id)){
		Rf.dg(id).style.height = height+'px';
	}
}
Rf.Layout.setWidth = function(id, width) {
	if(typeof width != 'number'){width = 0;}
	if(Rf.dg(id)){
		Rf.dg(id).style.width = width+'px';
	}
}
Rf.Layout.setDimensions = function(id, width, height) {
	Rf.Layout.setWidth(id, width);
	Rf.Layout.setheight(id, height);
}


;Rf.Info = function(){}

Rf.Info.DIV = null;

Rf.Info.iframeId = 'rfInfoFrame';
Rf.Info.rfInfoMainTableId = 'rfInfoMainTable';

Rf.Info.appendIFrame = function(){
	document.getElementsByTagName('body')[0].appendChild(Rf.Info.createIFrame());
	frames[Rf.Info.iframeId].document.open('text/html');
	frames[Rf.Info.iframeId].document.writeln('<html><head><title></title></head><body>');
	frames[Rf.Info.iframeId].document.writeln('infoFrame');
	frames[Rf.Info.iframeId].document.writeln('</body></html>');
	frames[Rf.Info.iframeId].document.close();
	//dg(Rf.Info.iframeId).backgroundColor = 'transparent';
	//rfLayout.setOpacity(dg(Rf.Info.iframeId), 0);
}

Rf.Info.createIFrame = function(){
	var iframe = dc('iframe');
	iframe.id = Rf.Info.iframeId;
	iframe.name = Rf.Info.iframeId;
	iframe.scrolling = 'no';
	iframe.frameBorder = 0;
	iframe.marginwidth = '0';
	iframe.marginheight = '0';
	//iframe.style.width = '0px';
	//iframe.style.height = '0px';
	iframe.allowTransparency = 'true';
	//iframe.style.background = 'none transparent';
	iframe.style.background = 'none transparent';
	//iframe.style.filter = 'chroma(color=#FFFFFF)';
	//FILTER: chroma(color=#FFFFFF)
	iframe.style.padding = '0px';
	iframe.style.position = 'absolute';
	iframe.style.top = '0px';
	iframe.style.left = '0px';
	iframe.style.textAlign = 'center';
	iframe.style.verticalAlign = 'middle';
	iframe.style.zIndex = '-1';
	iframe.style.display = 'none';
	iframe.onmouseover = 'Rf.Info.showInfo(event)';
	return iframe;
}


Rf.Info.show = function(evt, content, top, right, bottom, left, obj){
	if(Rf.Info.DIV == null){
		Rf.Info.DIV = Rf.dc("div");
		Rf.Info.DIV.style.display = "none";
		Rf.Info.DIV.style.zIndex = "-1";
		Rf.Info.DIV.style.position = "absolute";
		Rf.Info.DIV.style.top = "0px";
		Rf.Info.DIV.style.left = "0px";
		//Rf.Info.DIV.style.border = "2px solid #AA0000";
		Rf.Info.DIV.style.width = "320px";
		Rf.Info.DIV.style.backgroundColor = "#FFFFFF";
		document.getElementsByTagName("body")[0].appendChild(Rf.Info.DIV);
	}
	
	var table = Rf.dc("table");
	var tbody = Rf.dc("tbody");
	table.appendChild(tbody);
	
	var tr = Rf.dc("tr");
	tbody.appendChild(tr);
		var td = Rf.dc("td");
		td.style.lineHeight = "1px";
		td.innerHTML = "<img src=\"images/common/bg_info_corner_topleft.gif\" style=\"width:5px; height:5px;\" />";
		tr.appendChild(td);
		var td = Rf.dc("td");
		td.style.lineHeight = "1px";
		td.style.width = "100%";
		td.style.backgroundImage = "url('images/common/bg_info_edge_top.gif')";
		tr.appendChild(td);
		var td = Rf.dc("td");
		td.style.lineHeight = "1px";
		td.innerHTML = "<img src=\"images/common/bg_info_corner_topright.gif\" style=\"width:5px; height:5px;\" />";
		tr.appendChild(td);
		
	var tr = Rf.dc("tr");
	tbody.appendChild(tr);
		var td = Rf.dc("td");
		td.style.backgroundImage = "url('images/common/bg_info_edge_left.gif')";
		tr.appendChild(td);
		var td = Rf.dc("td");
		td.style.width = "100%";
		td.style.padding = "3px";
		td.innerHTML = content;
		tr.appendChild(td);
		var td = Rf.dc("td");
		td.style.backgroundImage = "url('images/common/bg_info_edge_right.gif')";
		tr.appendChild(td);
	
	var tr = Rf.dc("tr");
	tbody.appendChild(tr);
		var td = Rf.dc("td");
		td.style.lineHeight = "1px";
		td.innerHTML = "<img src=\"images/common/bg_info_corner_bottomleft.gif\" style=\"width:5px; height:5px;\" />";
		tr.appendChild(td);
		var td = Rf.dc("td");
		td.style.lineHeight = "1px";
		td.style.width = "100%";
		td.style.backgroundImage = "url('images/common/bg_info_edge_bottom.gif')";
		tr.appendChild(td);
		var td = Rf.dc("td");
		td.style.lineHeight = "1px";
		td.innerHTML = "<img src=\"images/common/bg_info_corner_bottomright.gif\" style=\"width:5px; height:5px;\" />";
		tr.appendChild(td);
	
	
	Rf.Info.DIV.innerHTML = "";
	Rf.Info.DIV.appendChild(table);
	Rf.Info.DIV.style.display = "block";
	Rf.Info.DIV.style.zIndex = "1000";
	
	if(typeof top != "number" && typeof right != "number" && typeof bottom != "number" && typeof left != "number"){
		var coordsHash = Rf.Event.getMouseXY(evt);
		coordsHash.X = coordsHash.X +10;
		coordsHash.Y = coordsHash.Y -10;
		Rf.Info.DIV.style.top = coordsHash.Y + 'px';
		Rf.Info.DIV.style.left = (coordsHash.X-330) + 'px';
	}
	else{
		if(typeof top == "number"){
			Rf.Info.DIV.style.top = top + 'px';
		}
		else{
			Rf.Info.DIV.style.top = '';
		}
		if(typeof right == "number"){
			Rf.Info.DIV.style.right = right + 'px';
		}
		else{
			Rf.Info.DIV.style.right = '';
		}
		if(typeof bottom == "number"){
			Rf.Info.DIV.style.bottom = bottom + 'px';
		}
		else{
			Rf.Info.DIV.style.bottom = '';
		}
		if(typeof left == "number"){
			Rf.Info.DIV.style.left = left + 'px';
		}
		else{
			Rf.Info.DIV.style.left = '';
		}
	}
	
	
return true;
	if(typeof dg(Rf.Info.iframeId) == 'boolean' && dg(Rf.Info.iframeId) == false){
		Rf.Info.appendIFrame();
	}
	if(typeof content == 'string' && content != ''){
		var scriptContent = '';
		scriptContent += 'var dg = function(id){return document.getElementById(id);}';
		frames[Rf.Info.iframeId].document.open('text/html');
		frames[Rf.Info.iframeId].document.writeln('<html style="background:none transparent;"><head><title></title><script language="Javascript">'+scriptContent+'</script></head><body style="margin:0px; padding:0px; background:none transparent;">');
		frames[Rf.Info.iframeId].document.writeln('<table id="'+Rf.Info.rfInfoMainTableId+'" style="border-collapse:collapse; border:5px solid red; background:none transparent;"><tbody style="background:none transparent;"><tr><td>');
		frames[Rf.Info.iframeId].document.writeln(content);
		frames[Rf.Info.iframeId].document.writeln('</td></tr></tbody></table>');
		frames[Rf.Info.iframeId].document.writeln('</body></html>');
		frames[Rf.Info.iframeId].document.close();
	}
	dg(Rf.Info.iframeId).style.display = 'block';
	var rfInfoMainTableHeight = rfLayout.getObjectHeight(frames[Rf.Info.iframeId].dg(Rf.Info.rfInfoMainTableId));
	var rfInfoMainTableWidth = rfLayout.getObjectWidth(frames[Rf.Info.iframeId].dg(Rf.Info.rfInfoMainTableId));
	//alert(rfInfoMainTableHeight+' '+rfInfoMainTableWidth);
	rfLayout.setHeight(Rf.Info.iframeId, rfInfoMainTableHeight);
	rfLayout.setWidth(Rf.Info.iframeId, rfInfoMainTableWidth);
	dg(Rf.Info.iframeId).style.zIndex = '100';
	//rfLayout.setOpacity(frames[Rf.Info.iframeId].dg(Rf.Info.rfInfoMainTableId), 100);
	
		
	
	
	//rfLayout.setHeight(Rf.Info.iframeId, 100);
	//rfLayout.setWidth(Rf.Info.iframeId, 100);
	
		
	var coordsHash = rfEvent.getMouseXY(evt);
	coordsHash.X = coordsHash.X +10;
	coordsHash.Y = coordsHash.Y -20;
	/*
	var e = new CEvent( evt );
	e.clientX = e.clientX + 10;
	e.clientY = e.clientY - 20;
	*/

	dg(Rf.Info.iframeId).style.left = coordsHash.X + 'px';
	dg(Rf.Info.iframeId).style.top = coordsHash.Y + 'px';
return true;		
	var infoTable = m24DOM.getNewTable(null, 'map24InfoLayer');
		infoTable.style.width = '100%';
		var Row = m24DOM.getNewTableRow(null);
		var Cell = m24DOM.getNewTableCell(gIMGTag('button_info_std.gif', 7, 12, 'common', null, null), 'infoLayerIButton');
		Cell.style.paddingRight = '5px';
		Row.appendChild(Cell);
		var Cell = m24DOM.getNewTableCell(gT(resId), null);
		Row.appendChild(Cell);
	infoTable.appendChild(Row);
}

Rf.Info.hide = function(){
	if(Rf.Info.DIV != null){
		Rf.Info.DIV.style.zIndex = '-1';
		Rf.Info.DIV.style.top = '0px';
		Rf.Info.DIV.style.left = '0px';
		Rf.Info.DIV.style.display = 'none';
		//dg(Rf.Info.iframeId).style.width = '0px';
		//dg(Rf.Info.iframeId).style.height = '0px';
	}
}

Rf.Info.showAppended = function(evt, content, top, right, bottom, left, obj, infoBox){
	if(infoBox == null){
		infoBox = Rf.dc("div");
		infoBox.style.display = "none";
		infoBox.style.zIndex = "-1";
		infoBox.style.position = "absolute";
		infoBox.style.top = "0px";
		infoBox.style.left = "0px";
		//infoBox.style.border = "2px solid #AA0000";
		infoBox.style.width = "320px";
		infoBox.style.backgroundColor = "#FFFFFF";
		obj.appendChild(infoBox);
	}
	
	var table = Rf.dc("table");
	var tbody = Rf.dc("tbody");
	table.appendChild(tbody);
	
	var tr = Rf.dc("tr");
	tbody.appendChild(tr);
		var td = Rf.dc("td");
		td.style.lineHeight = "1px";
		td.innerHTML = "<img src=\"images/common/bg_info_corner_topleft.gif\" style=\"width:5px; height:5px;\" />";
		tr.appendChild(td);
		var td = Rf.dc("td");
		td.style.lineHeight = "1px";
		td.style.width = "100%";
		td.style.backgroundImage = "url('images/common/bg_info_edge_top.gif')";
		tr.appendChild(td);
		var td = Rf.dc("td");
		td.style.lineHeight = "1px";
		td.innerHTML = "<img src=\"images/common/bg_info_corner_topright.gif\" style=\"width:5px; height:5px;\" />";
		tr.appendChild(td);
		
	var tr = Rf.dc("tr");
	tbody.appendChild(tr);
		var td = Rf.dc("td");
		td.style.backgroundImage = "url('images/common/bg_info_edge_left.gif')";
		tr.appendChild(td);
		var td = Rf.dc("td");
		td.style.width = "100%";
		td.style.padding = "3px";
		td.innerHTML = content;
		tr.appendChild(td);
		var td = Rf.dc("td");
		td.style.backgroundImage = "url('images/common/bg_info_edge_right.gif')";
		tr.appendChild(td);
	
	var tr = Rf.dc("tr");
	tbody.appendChild(tr);
		var td = Rf.dc("td");
		td.style.lineHeight = "1px";
		td.innerHTML = "<img src=\"images/common/bg_info_corner_bottomleft.gif\" style=\"width:5px; height:5px;\" />";
		tr.appendChild(td);
		var td = Rf.dc("td");
		td.style.lineHeight = "1px";
		td.style.width = "100%";
		td.style.backgroundImage = "url('images/common/bg_info_edge_bottom.gif')";
		tr.appendChild(td);
		var td = Rf.dc("td");
		td.style.lineHeight = "1px";
		td.innerHTML = "<img src=\"images/common/bg_info_corner_bottomright.gif\" style=\"width:5px; height:5px;\" />";
		tr.appendChild(td);
	
	
	infoBox.innerHTML = "";
	infoBox.appendChild(table);
	infoBox.style.display = "block";
	infoBox.style.zIndex = "1000";


	
	if(typeof top != "number" && typeof right != "number" && typeof bottom != "number" && typeof left != "number"){
		var coordsHash = Rf.Event.getMouseXY(evt);
		coordsHash.X = coordsHash.X +10;
		coordsHash.Y = coordsHash.Y -10;
		infoBox.style.top = coordsHash.Y + 'px';
		infoBox.style.left = (coordsHash.X-330) + 'px';
	}
	else{
		if(typeof top == "number"){
			infoBox.style.top = top + 'px';
		}
		else{
			infoBox.style.top = '';
		}
		if(typeof right == "number"){
			infoBox.style.right = right + 'px';
		}
		else{
			infoBox.style.right = '';
		}
		if(typeof bottom == "number"){
			infoBox.style.bottom = bottom + 'px';
		}
		else{
			infoBox.style.bottom = '';
		}
		if(typeof left == "number"){
			infoBox.style.left = left + 'px';
		}
		else{
			infoBox.style.left = '';
		}
	}


	return infoBox;
}

Rf.Info.hideAppended = function(infoBox){
	if(infoBox != null){
		infoBox.style.zIndex = '-1';
		//infoBox.style.top = '0px';
		//infoBox.style.left = '0px';
		infoBox.style.display = 'none';
		//dg(Rf.Info.iframeId).style.width = '0px';
		//dg(Rf.Info.iframeId).style.height = '0px';
	}
}

;Rf.Loading = function(){}

Rf.Loading.urlsLoadingQueu = new Array();
Rf.Loading.urlDependencies = {};
Rf.Loading.urlCallback = {};
Rf.Loading.urlCallbackParams = {};
Rf.Loading.urlIntervals = {};

//params: module
Rf.Loading.requireModule = function(aH){
	Rf.Loading.requireJScriptGroup({urlsArray:rfConfig.modules[aH.module]['requiredScripts'], callback:rfConfig.modules[aH.module]['callbackFunction'], callbackParams:rfConfig.modules[aH.module]['callbackParams']});
}

//params: urlsArray, callback, callbackParams
Rf.Loading.requireJScriptGroup = function(aH){
	if(typeof aH.urlsArray == 'array') {Rf.Loading.urlDependencies[aH.file] = aH.urlsArray};
	for(var i=0; i<aH.urlsArray.length; i++){
		Rf.Loading.requireJScriptFile({file:aH.urlsArray[i], callback:aH.callback, callbackParams:aH.callbackParams, dependenciesArray:aH.urlsArray});
	}
}

//params: file, 
Rf.Loading.requireJScriptFile = function(aH){
	
	
	
	return true;
	if(!in_array(aH.file, Rf.Loading.urlsLoadingQueu) && !in_array(aH.file, rfSession.loadedJScriptFiles)){
	//alert('load');
		Rf.Loading.loadJScriptFile(aH);
		
	}
	else if(in_array(aH.file, rfSession.loadedJScriptFiles) && aH.dependenciesArray.length == 0){
		callCallback(aH);
	}
	else{
		alert('dependencies vorhanden');
	}
}

// params: URL, callback, callbackParams, dependenciesArray
Rf.Loading.loadJScriptFile = function(aH){
	var head = document.getElementsByTagName('head')[0];
	var srcFound = false;
	for(var i=0; i<head.childNodes.length; i++){
		if(head.childNodes[i].nodeName == "script" && head.childNodes[i].src && head.childNodes[i].src == aH.URL){
			srcFound = true;
			return true;
		}
	}
	
	if(srcFound == false){
		var newScript = Rf.dc('script');
		newScript.setAttribute('type','text/javascript');
		newScript.setAttribute('charset','utf-8');
		newScript.setAttribute('src',aH.URL);
		document.getElementsByTagName('head')[0].appendChild(newScript);
	}
	
	return false;
	
	
	Rf.Loading.urlsLoadingQueu.push(aH.file);
	if(isString(aH.callback)) {Rf.Loading.urlCallback[aH.file] = aH.callback};
	if(isString(aH.callbackParams) || typeof aH.callbackParams == 'object') {Rf.Loading.urlCallbackParams[aH.file] = aH.callbackParams};
	//Rf.Loading.urlDependencies[aH.file] = null;
	var fullURL = __HTTP_SOURCE__+aH.file;
	var newScript = dc('script', null, null);
	newScript.setAttribute('type','text/javascript');
	newScript.setAttribute('charset','utf-8');
	newScript.setAttribute('src',fullURL);
	document.getElementsByTagName('head')[0].appendChild(newScript);
	//window.setTimeout('', 1);
	Rf.Loading.urlIntervals[aH.file] = window.setInterval("Rf.Loading.checkJScriptFileLoaded('"+aH.file+"')", 50);
}

Rf.Loading.checkJScriptFileLoaded = function(file){
	if(in_array(file, rfSession.loadedJScriptFiles)){
		window.clearInterval(Rf.Loading.urlIntervals[file]);
		Rf.Loading.urlIntervals[file] = false;
		Rf.Loading.urlsLoadingQueu.extract(file);
		if(isString(Rf.Loading.urlCallback[file])){
			var doCallbackFlag = true;
			if(typeof Rf.Loading.urlDependencies[file] == 'array'){
				for(var i=0; i<Rf.Loading.urlDependencies[file].length; i++){
					if(!in_array(Rf.Loading.urlDependencies[file][i], rfSession.loadedJScriptFiles)) doCallbackFlag = false;
				}
			}
			if(typeof doCallbackFlag == 'boolean' && doCallbackFlag == true){
				//var callbackFunction = eval(Rf.Loading.urlCallback[result['url']]);
				var cb = {};
				cb.callback = Rf.Loading.urlCallback[file];
				cb.callbackParams = Rf.Loading.urlCallbackParams[file];
				Rf.Loading.urlCallback[file] = null;
				Rf.Loading.urlDependencies[file] = null;
				Rf.Loading.urlCallbackParams[file] = null;
				callCallback(cb);
				//callbackFunction.apply();
			}
		}
	}
}

Rf.Loading.loadInlineJScript = function(aH){
	Rf.Loading.urlsLoadingQueu.push(aH.url);
	alert(typeof aH.callback);
	if(isString(aH.callback)) {alert('caa'+aH.callback);Rf.Loading.urlCallback[aH.url] = aH.callback};
	alert(Rf.Loading.urlCallback[aH.url]);
	if(isString(aH.callbackParams) || typeof aH.callbackParams == 'object') {Rf.Loading.urlCallbackParams[aH.url] = aH.callbackParams};
	Rf.Loading.urlDependencies[aH.url] = null;
	if(typeof dependenciesArray == 'array') {Rf.Loading.urlDependencies[aH.url] = aH.dependenciesArray};
	var requestURL = __HTTP_SOURCE__+'php/utils/rfLoadFile.php';
	var paramHash = {};
	paramHash['url'] = aH.url;
	for(var obj in Rf.Loading.urlCallback){
	alert('test'+obj);
}
	Rf.Loading.doAJAXRequest(requestURL, Rf.Loading.appendInlineJScript, paramHash);
}

Rf.Loading.doAJAXRequest = function(url, callback, paramHash){
	if(typeof paramHash == 'object'){
		var params = '';
		for(var obj in paramHash){
			params += obj+'='+paramHash[obj]+'&';
		}
	}
	var options = {method: 'post', parameters: params};
	if(typeof callback == 'function'){
		options['onComplete'] = callback;
	}
	var myAjax = new Ajax.CRequest(url,options);
}

Rf.Loading.appendInlineJScript = function(AJAXrequest){
alert('test');
	var newScript = dc('script', null, null);
	newScript.setAttribute('type','text/javascript');

	var result = JSON.parse(AJAXrequest.responseText);

	newScript.text = result['content'];

	alert(result['url']);
	document.getElementsByTagName('head')[0].appendChild(newScript);
	
	rfSession.loadedAJAXUrls.push(result['url']);
	Rf.Loading.urlsLoadingQueu.extract(result['url']);
for(var obj in Rf.Loading.urlCallback){
	alert(obj);
}
alert(Rf.Loading.urlCallback[result['url']]);	
	if(isString(Rf.Loading.urlCallback[result['url']])){
alert('test1a');
		var doCallbackFlag = true;
		if(typeof Rf.Loading.urlDependencies[result['url']] == 'array'){
	alert('test2');
			for(var i=0; i<Rf.Loading.urlDependencies[result['url']].length; i++){
				if(!in_array(Rf.Loading.urlDependencies[result['url']][i], rfSession.loadedAJAXUrls)) doCallbackFlag = false;
			}
		}
		if(typeof doCallbackFlag == 'boolean' && doCallbackFlag == true){
			//var callbackFunction = eval(Rf.Loading.urlCallback[result['url']]);
			var cb = {};
			cb.callback = Rf.Loading.urlCallback[result['url']];
			cb.callbackParams = Rf.Loading.urlCallbackParams[result['url']];
			Rf.Loading.urlCallback[result['url']] = null;
			Rf.Loading.urlDependencies[result['url']] = null;
			Rf.Loading.urlCallbackParams[result['url']] = null;
alert('test3');
			callCallback(cb);
			//callbackFunction.apply();
		}
	}
	
}


//params: file, 
Rf.Loading.loadwaitJScriptFile = function(aH){
	//alert(aH.file);
	if(!in_array(aH.file)){
	//alert('load');
		Rf.Loading.loadJScriptFile(aH);
		
	}
	else if(in_array(aH.file, rfSession.loadedJScriptFiles) && aH.dependenciesArray.length == 0){
		callCallback(aH);
	}
	else{
		alert('dependencies vorhanden');
	}
}


Rf.Loading.CConnect = function( aH ) {
	// if this is a prototype, leave constructor now
	if( typeof aH=="boolean" && aH==false ) return;

	// initialize properties
	if( aH instanceof Object ) {
		if( typeof aH["ServiceUrl"]=="string" )
			this.ServiceUrl = aH.ServiceUrl;
	}
	
	// add this instance into the instance table
	this.InstanceId = Rf.makeUniqueId();
	Rf.Loading.CConnect._Instances[ this.InstanceId ] = this;
}

Rf.Loading.CConnect.prototype.InstanceId = null;
Rf.Loading.CConnect.prototype.ServiceUrl = null;

Rf.Loading.CConnect.prototype.sendRequest = function( request, blocking ) {}

Rf.Loading.CConnect.prototype.isReady = function() { return true; }

Rf.Loading.CConnect.prototype.prepareSend = function( request ) {
	try {
		request._repareSend();
	}catch(e){
		e.Method = "Rf.Loading.CConnect.prepareRequest";
		e.Msg = "_repareSend failed with an Exception";
		Rf.e(e);
	}
	request.SendTime = (new Date()).getTime();
	request.TimeoutAt = request.SendTime + request.Timeout*1000;
	Rf.Loading.CConnect.CRequests[ request.Id ] = request;
	Rf.Loading.CConnect._ensureTimeoutCheck();
	request.IsSent = true;
}

Rf.Loading.CConnect.prototype.finishRequest = function( request, success ) {
	if( typeof success!= "boolean" ) success = true;
	try {
		Rf.Loading.CConnect.CRequests[ request.Id ] = null;
		if( request.ResponseTime <= 0 ) {
			request.ResponseTime = (new Date()).getTime();
			request.CRequestTime = request.ResponseTime - request.SendTime;
		}
		request.IsFinished = true;
		if( success )
			request.IsSuccessfull = true;
		else
			request.IsFailed = true;
		request._beforeDelivery();
		if( success )
			request.onSuccess();
		else
			request.onError();
		delete Rf.Loading.CConnect.CRequests[ request.Id ];
		request._afterDelivery();
	} catch(e) {
		e.Method = "Rf.Loading.CConnect.finishRequest";
		e.CRequest = request;
		Rf.e(e);
	}
}

Rf.Loading.CConnect.CRequests = {};

Rf.Loading.CConnect._Instances = {};

Rf.Loading.CConnect._TimeoutCheckRuning = false;

Rf.Loading.CConnect._TimeoutCheckTimer = 1000;

Rf.Loading.CConnect._ensureTimeoutCheck = function() {
	if( !Rf.Loading.CConnect._TimeoutCheckRuning ) {
		Rf.Loading.CConnect._TimeoutCheckRuning = true;
		setTimeout(Rf.Loading.CConnect._checkTimeout, Rf.Loading.CConnect._TimeoutCheckTimer);
	}
}

Rf.Loading.CConnect._checkTimeout = function() {
	var METHOD = "Rf.Loading.CConnect._checkTimeout";
	var open_request = null;
	try {
		var timed_out = [];
		var now = (new Date()).getTime();
		var request = null;
		open_request = Rf.Loading.CConnect.CRequests;

		// find all timed-out requests
		for( var key in open_request ) {
			try {
				request = open_request[key];
				if( (request instanceof Rf.Loading.CRequest) &&
					(now > request.TimeoutAt) )
				{
					timed_out[timed_out.length++] = request;
					delete open_request[key];
				}
			} catch( e ) {
				e.Method = METHOD;
				Rf.e(e);
			}
		}

		// notify them that they're timed-out
		for( var i=0,n=timed_out.length; i<n; i++ ) {
			try {
				request = timed_out[i];
				request.IsFinished = true;
				request.IsFailed = true;
				request.IsTimedout = true;
				request._beforeDelivery();
				request.onTimeout();
				request._afterDelivery();
			} catch(e) {
				e.Method = METHOD;
				Rf.e(e);
			}
		}
	} catch(e){
		e.Method = METHOD;
		Rf.e(e);
	}
	
	// if we have no more pending requests, stop check for timeout
	if( open_request==null || open_request.length <= 0 ) {
		Rf.Loading.CConnect._TimeoutCheckRuning = false;
	} else
	// otherwise, go on
		setTimeout(Rf.Loading.CConnect._checkTimeout, Rf.Loading.CConnect._TimeoutCheckTimer);
}

Rf.Loading.CRequest = function( aH ) {
	// if prototype constructor
	if( typeof aH=="boolean" && aH==false ) return;
	
	if( aH instanceof Object ) {
		if( typeof aH.Id=="string" || 
			typeof aH.Id=="number" )
			this.Id = aH.Id;
		else
			this.Id = Rf.makeUniqueId(10);

		if( aH.ConnData instanceof Object )
			this.ConnData = aH.ConnData;
		else
			this.ConnData = {};

		if( aH.Conn instanceof Rf.Loading.CConnect )
			this.Conn = aH.Conn;
			
		if( aH.Args instanceof Object )
			this.Args = aH.Args;
		else
			this.Args = {};
			
		if( typeof aH.QueryString=="string" )
			this.QueryString = aH.QueryString;
			
		if( aH.Data instanceof Object )
			this.Data = aH.Data;
		else
			this.Data = {};
			
		if( aH.Response instanceof Object )
			this.Response = aH.Response;
			
		if( typeof aH.Timeout=="number" )
			this.Timeout = aH.Timeout;
	} else {
		this.Id = Rf.makeUniqueId(10);
		this.ConnData = {};
		this.Args = {};
		this.Data = {};
	}
}

Rf.Loading.CRequest.prototype.Class = "Request";
Rf.Loading.CRequest.prototype.Package = "rfLoading";
Rf.Loading.CRequest.prototype.ClassId = "Rf.Loading.CRequest";

Rf.Loading.CRequest.prototype.Id = null;

Rf.Loading.CRequest.prototype.Conn = null;

Rf.Loading.CRequest.prototype.ConnData = null;

Rf.Loading.CRequest.prototype.Args = null;

Rf.Loading.CRequest.prototype.QueryString = null;

Rf.Loading.CRequest.prototype.Data = null;

Rf.Loading.CRequest.prototype.IsSent = false;

Rf.Loading.CRequest.prototype.IsFinished = false;

Rf.Loading.CRequest.prototype.IsSuccessfull = false;

Rf.Loading.CRequest.prototype.IsFailed = false;

Rf.Loading.CRequest.prototype.IsTimedout = false;

Rf.Loading.CRequest.prototype.Response = null;

Rf.Loading.CRequest.prototype.Timeout = 30;

Rf.Loading.CRequest.prototype.TimeoutAt = 0;

Rf.Loading.CRequest.prototype.SendTime = 0;

Rf.Loading.CRequest.prototype.ResponseTime = 0;

Rf.Loading.CRequest.prototype.CRequestTime = 0;

Rf.Loading.CRequest.prototype._repareSend = function() { this.prepareSend(); }

Rf.Loading.CRequest.prototype.prepareSend = function() {}

Rf.Loading.CRequest.prototype._beforeDelivery = function() { this.beforeDelivery(); }

Rf.Loading.CRequest.prototype.beforeDelivery = function() {}

Rf.Loading.CRequest.prototype._afterDelivery = function() { this.afterDelivery(); }

Rf.Loading.CRequest.prototype.afterDelivery = function() {}

Rf.Loading.CRequest.prototype.onSuccess = function() {}

Rf.Loading.CRequest.prototype.onError = function() {}

Rf.Loading.CRequest.prototype.onTimeout = function() { this.onError(); }



Rf.Loading.CConnectHTTPXML = function( aH ) {
	Rf.Loading.CConnect.call(this, aH);
}
Rf.Loading.CConnectHTTPXML.prototype = new Rf.Loading.CConnect(false);

Rf.Loading.CConnectHTTPXML.prototype.Class = "ConnectHTTPXML";
Rf.Loading.CConnectHTTPXML.prototype.Package = "rfLoading";
Rf.Loading.CConnectHTTPXML.prototype.ClassId = "Rf.Loading.CConnectHTTPXML"
Rf.Loading.CConnectHTTPXML.prototype.XmlReq = null;
Rf.Loading.CConnectHTTPXML.prototype.CRequestId = null;

Rf.Loading.CConnectHTTPXML.prototype = new Rf.Loading.CConnect(false);

Rf.Loading.CConnectHTTPXML.prototype.setTimeout = function( timeout ) {
	if( (typeof timeout != "number") || (timeout <= 0) ) alert("exception");
	this.Timeout = timeout;
} 

// see Rf.Loading.CConnect
Rf.Loading.CConnectHTTPXML.prototype.sendRequest = function( request, blocking ) {
	if( (typeof blocking == "boolean") && blocking ) throw new Rf.Exception.InvalidArgument("Blocking mode not supported!",request,"Rf.Loading.CConnectHTTPXML","sendRequest");
	if( !(request instanceof Rf.Loading.CRequest) ) throw new Rf.Exception.InvalidArgument("Invalid argument 'request'! The given argument is not an instance of Rf.Loading.CRequest");
	
	try {
		// TODO: isn't the request id already created ?
		// request.Id = Rf.makeUniqueId();
		this.CRequestId = request.Id;

		// create the image URL
		request.Conn = this;
		this.prepareSend( request );
		
		
		//default config
		var url = this.ServiceUrl;
		var method = 'POST';
		var asynchronous = true;

		//build url
		url = Rf.appendUrl(url , {requestid: request.Id} );
		if( request.Args ) url = Rf.appendUrl(url , request.Args );
		if( typeof request.QueryString == "string" ) url = Rf.appendUrl(url , request.QueryString );


		//create requestbody and set request type
		var requestBody = null;
		if(request.Data == null || typeof request.Data == "undefined"){
			method = 'GET';
			requestBody = null;
		}
		else if(typeof request.Data == "string" && request.Data != ""){
			method = 'POST';
			requestBody = "&data="+Rf.urlencode(request.Data);
		}
		else if(request.Data instanceof Object){
			method = 'POST';
			requestBody = "";
			for(key in request.Data){
				if(typeof request.Data[key] == "function"){continue;}
				requestBody += "&"+Rf.urlencode(key)+"="+Rf.urlencode(request.Data[key]);
			}
			if(requestBody == ""){
				method = 'GET';
				requestBody = null;
			}
		}

		
		//create request object
		request.XmlReq = this.createXMLHttpRequest();
		
		
		//set listener
		if (asynchronous == true){
			//request.XmlReq.onreadystatechange = this.onReadyStateChanged;
		
			request.XmlReq.onreadystatechange = function(){
				switch ( request.XmlReq.readyState ) {
					case 0 : // UNINITIALIZED
						break;
					case 1 : // LOADING
						request.isSent = true;
						break;
					case 2 : // LOADED
						break;
					case 3 : // INTERACTIVE
						break;
					case 4 :
						if(request.XmlReq.status == 200){
							Rf.Loading.CConnectHTTPXML.responseHandler( true, request );
						}
				}
			}
		
		}
		
		//open request connection
		request.XmlReq.open(method, url, asynchronous);
		
		//set request headers
		var requestHeaders = ['X-Requested-With', 'XMLHttpRequest'];
		if (method == 'POST'){
			requestHeaders.push('Content-type', 'application/x-www-form-urlencoded');
			/*could be a nessecary workaround for mozilla bug
			if (overrideMimeType){
				requestHeaders.push('Connection', 'close');
			}
			*/
		}
		requestHeaders.push('request_id', request.Id);
	    for (var i = 0; i < requestHeaders.length; i += 2){
			request.XmlReq.setRequestHeader(requestHeaders[i], requestHeaders[i+1]);
		}
		
		//send request
		request.XmlReq.send(requestBody);

		// TODO: call function that checks for timeout
		
		//alert("ConnectHTTPXML: sending request with id "+request.Id+" and URL "+url);
		request.ConnData["url"] = url;
		
	} catch(e) {
		Rf.Loading.CConnectHTTPXML.responseHandler(false, request);
		e.Method = "Rf.Loading.CConnectHTTPXML.sendRequest";
		Rf.e(e);
	}
}

Rf.Loading.CConnectHTTPXML.prototype.createXMLHttpRequest = function() {
	var req = null;
	
	try {
		req = new ActiveXObject("MSXML2.XMLHTTP");
	}
	catch (err_MSXML2) {
		try {
			req = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch (err_Microsoft) {
			if (typeof XMLHttpRequest != "undefined")
				req = new XMLHttpRequest();
			else throw new Rf.Exception("This browser doesn't support XmlHttp Requests!",null,"Rf.Loading.CConnectHTTPXML","createXMLHttpRequest");
		}
	}
	return req;
}

Rf.Loading.CConnectHTTPXML.responseHandler = function( success, request ) {
	try {
		if( typeof success!="boolean" ) success = true;
		
		if( success ) {
			//alert("ConnectHTTPXML: receive response for request with id "+request.Id);
			var res = JSON.parse(request.XmlReq.responseText);
			request.Response = res.response;
		}
		else {
			request.Response = request.XmlReq.statusText;
			// the error message
			// TODO: action on failure
		}
		delete request.XmlReq;
		request.Conn.finishRequest( request, success );
	} catch(e) {
		//alert( Rf.Loading.CConnect.CRequests );
		e.Method = "Rf.Loading.CConnectHTTPXML.responseHandler";
		Rf.e(e);
	}
}



Rf.Navi = function (){}


Rf.Session = function (){}

__HTTP_SOURCE__ = 'http://' + window.location.host + window.location.pathname;
debug=(__HTTP_SOURCE__);
Rf.Session.currentLanguage = 'de-DE',

Rf.Session.userPermissions = {};
Rf.Session.userLoggedInFlag = false;
Rf.Session.userData = {};
Rf.Session.maxContentWidth = 1200;

Rf.Session.setMaxContentWidth = function(value){
	Rf.Session.maxContentWidth = value;
}
Rf.Session.resetMaxContentWidth = function(){
	Rf.Session.maxContentWidth = Rf.Session.defaultMaxContentWidth;
}
Rf.Session.defaultMaxContentWidth = 1200;

Rf.Session.loadedAJAXUrls = new Array();

Rf.Session.loadedJScriptFiles = new Array();


Rf.Session.mainContent = null;

//{Rf.CContent} content, divIdSubMenu
Rf.CBallschule = function(aH){
	
	Rf.CModule.call(this, aH);
	
	this.RfContent = aH.content;
	this.RfAuth = this.RfContent.RfAuth;
	this.DIV = Rf.dcModuleDIV();
	this.RfContent.DIV.appendChild(this.DIV);
	
	this.UserID = this.RfContent.UserID;
	
	this.RegisteredSubMenuItems = {};
	this.SubMenuItemDivs = {};
	this.SubPartDIVs = {};
	
	this.buildSubParts();
	this.createSiteIndicator({ModuleName: "Ballschule"});
	
	//this.RegisteredSubMenuItems["vorstand"] = {label:"Ballschule"};
	this.createSubMenu();
}
Rf.CBallschule.prototype = new Rf.CModule(false);


Rf.CBallschule.prototype.buildSubParts = function(){
	this.createBallschule();
	//this.createSatzung();
}

Rf.CBallschule.prototype.createBallschule = function(){
	this.SubPartDIVs["ballschule"] = Rf.dc("div");
	this.DIV.appendChild(this.SubPartDIVs["ballschule"]);
}


//page, newsId
Rf.CBallschule.prototype.fillBallschule = function(aH, force_flag){
	if(this.SubPartDIVs["ballschule"].innerHTML != "" && (typeof force_flag != "boolean" || force_flag != true)){
		return true;
	}
	
	var table = Rf.dcTable();
	var tbody = Rf.dc("tbody");
	table.appendChild(tbody);
	var tr = Rf.dc("tr");
	tbody.appendChild(tr);
	var td = Rf.dc("td");
	tr.appendChild(td);
	//td.innerHTML = "Hier werden bald die Beitr&auml;ge einzusehen sein.";
	td.style.textAlign = "center";
	td.style.verticalAlign = "middle";
	td.style.fontWeight = "bold";
	td.style.height = "100px";
	var box = new Rf.Dom.RoundBox();
	td.appendChild(box.DIV);
	
	var request = new Rf.Loading.CRequest();
	request.rfNews = this;
	request.Data = {
		username:Rf.Session.rfAuth.username,
		password:Rf.Session.rfAuth.password,
		userId:Rf.Session.rfAuth.userId,
		action:"getVorstand"
	};
	
	request.onSuccess = function() {
		if(!Rf.empty(this.Response.error)){
			Rf.setError(this.Response.error);
		}
		else{
			this.rfNews.SubPartDIVs["ballschule"].innerHTML = "";	
			
			for(var i=0; i<this.Response.boxes.length; i++){
				var CObj = new Rf.CContentBox({
					Color: "d0c6b0",
					HeaderLeftText: this.Response.boxes[i].hleft,
					HeaderRightText: this.Response.boxes[i].hright
				});

				var div = Rf.dc("div");
				div.style.position = "relative";
				div.style.top = "0px";
				div.style.left = "0px";
				div.innerHTML = this.Response.boxes[i].content;
				CObj.appendContent(div);
				
				this.rfNews.SubPartDIVs["ballschule"].appendChild(CObj.getNode());
			}
			
			
			
			
		}
	}
	request.onError = function() { alert("b"); } 
	request.onTimeout = function() { alert("c"); } 
	var conn = new Rf.Loading.CConnectHTTPXML({ServiceUrl: "local/modules/Ballschule/backend.php"}); 
	conn.sendRequest( request );
}


//cI
Rf.CBallschule.prototype.showPart = function(aH){
	Rf.Session.setMaxContentWidth(850);
	var cIArray = aH.cI.split("|");
	if(Rf.empty(cIArray[1]) || cIArray[1] == "ballschule"){
		this.fillBallschule();
		//this.chooseSubMenuItem({Item:"ballschule"});
		this.show({name:"ballschule"});
	}/*
	else if(cIArray[1] == "satzung"){
		this.fillSatzung();
		this.chooseSubMenuItem({Item:"satzung"});
		this.show({name:"satzung"});
	}*/
};

//{Rf.CContent} content, divIdSubMenu
Rf.CNews = function(aH){
	
	Rf.CModule.call(this, aH);
	
	this.RfContent = aH.content;
	this.RfAuth = this.RfContent.RfAuth;
	this.DIV = Rf.dcModuleDIV();
	this.RfContent.DIV.appendChild(this.DIV);
	
	this.UserID = this.RfContent.UserID;
	
	this.RegisteredSubMenuItems = {};
	this.SubMenuItemDivs = {};
	this.SubPartDIVs = {};
	
	this.buildSubParts();
	this.createSiteIndicator({ModuleName: "News"});
	
	this.createSubMenu();
}
Rf.CNews.prototype = new Rf.CModule(false);


Rf.CNews.prototype.buildSubParts = function(){
	this.createNewsEditForm();
	this.createNewsListing();
}

Rf.CNews.prototype.createNewsListing = function(){
	this.SubPartDIVs["NewsListing"] = Rf.dc("div");
	this.DIV.appendChild(this.SubPartDIVs["NewsListing"]);
}

//page, newsId
Rf.CNews.prototype.showNewsListing = function(aH){
	if(Rf.empty(aH)){
		aH = {};
	}
	if(Rf.empty(this.SubPartDIVs["NewsListing"])){
		this.createNewsListing();
	}
	if(Rf.empty(aH.page)){
		aH.page = 1;
	}
	
	var request = new Rf.Loading.CRequest();
	request.rfNews = this;
	request.Data = {
		username:Rf.Session.rfAuth.username,
		password:Rf.Session.rfAuth.password,
		userId:Rf.Session.rfAuth.userId,
		action:"getNews",
		page:aH.page
	};
	
	request.onSuccess = function() {
		if(!Rf.empty(this.Response.error)){
			Rf.setError(this.Response.error);
		}
		else{
			var table = Rf.dcTable();
			var tbody = Rf.dc("tbody");
			table.appendChild(tbody);
			
			this.rfNews.SubPartDIVs["NewsListing"].innerHTML = "";
			this.rfNews.SubPartDIVs["NewsListing"].appendChild(table);
			
			if(!Rf.empty(this.Response.privileges.news.CREATE)){
				var tr = Rf.dc("tr");
				tbody.appendChild(tr);
				var td = Rf.dc("td");
				
				tr.appendChild(td);
				var lineButton = Rf.dc("div");
				lineButton.style.height = "30px";
				lineButton.style.position = "relative";
				lineButton.style.top = "0px";
				lineButton.style.left = "0px";
				td.appendChild(lineButton);
				var buttonCreate = Rf.getIMGButton("images/common/16plus.png");
				buttonCreate.rfNews = this.rfNews;
				buttonCreate.onclick = function(){
					this.rfNews.showNewsEditForm({
						Id: null
					});
				};
				lineButton.appendChild(buttonCreate);
			}
			
			var numOfNewsShown = 0;
			for(var i=0; i<this.Response.news.length; i++){
				if(this.Response.news[i].active == "0" && Rf.empty(this.Response.privileges.news.UPDATE)){
					continue;
				}
				
				numOfNewsShown++;
				
				var tr = Rf.dc("tr");
				tbody.appendChild(tr);
				var td = Rf.dc("td");
				tr.appendChild(td);
				
				var newsObj = new Rf.CContentBox({
					Color: "d0c6b0",
					HeaderLeftText: this.Response.news[i].headline,
					HeaderRightText: Rf.getReadableDate(this.Response.news[i].date, this.Response.news[i].weekday)
				});
				
					//var iTable = Rf.dcTable();
					//iTable.style.border = "2px solid #CCCCCC";
				
				//newsObj.appendContent(iTable);
				
					/*var iTbody = Rf.dc("tbody");
					iTable.appendChild(iTbody);
					*/
					/*
					var iTr = Rf.dc("tr");
					iTbody.appendChild(iTr);
					var iTd = Rf.dc("td");
					iTd.style.backgroundColor = "#CCCCCC";
					iTd.style.padding = "0px 0px 0px 0px";
					iTd.style.height = "24px";
					//iTd.style.border = "2px solid #CCCCCC";
					iTr.appendChild(iTd);
					var headerDIV = Rf.dc("div");
					headerDIV.style.position = "relative";
					headerDIV.style.border = "2px solid #CCCCCC";
					//headerDIV.style.borderWidth = "2px 2px 2px 2px";
					headerDIV.style.top = "0px";
					headerDIV.style.left = "0px";
					iTd.appendChild(headerDIV);
					var headerHeadlineDIV = Rf.dc("div");
					headerHeadlineDIV.style.position = "relative";
					headerHeadlineDIV.style.top = "1px";
					headerHeadlineDIV.style.left = "4px";
					headerHeadlineDIV.style.height = "19px";
					headerHeadlineDIV.style.fontWeight = "bold";
					headerHeadlineDIV.innerHTML = this.Response.news[i].headline;
					headerDIV.appendChild(headerHeadlineDIV);
					var headerDateDIV = Rf.dc("div");
					headerDateDIV.style.position = "absolute";
					headerDateDIV.style.top = "2px";
					headerDateDIV.style.right = "4px";
					headerDateDIV.style.height = "20px";
					//headerDateDIV.style.border = "1px solid red";
					headerDateDIV.innerHTML = Rf.getReadableDate(this.Response.news[i].date, this.Response.news[i].weekday);
					headerDIV.appendChild(headerDateDIV);
					*/
					/*
					var iTr = Rf.dc("tr");
					iTbody.appendChild(iTr);
					var iTd = Rf.dc("td");
					iTr.appendChild(iTd);
					var bodyDIV = Rf.dc("div");
					bodyDIV.style.position = "relative";
					bodyDIV.style.top = "-2px";
					bodyDIV.style.left = "0px";
					bodyDIV.style.border = "2px solid #CCCCCC";
					bodyDIV.style.borderWidth = "0px 2px 5px 2px";
					iTd.appendChild(bodyDIV);
					*/
					
					var bodyContentDIV = Rf.dc("div");
					bodyContentDIV.style.position = "relative";
					bodyContentDIV.style.top = "0px";
					bodyContentDIV.style.left = "0px";
					bodyContentDIV.style.lineHeight = "15px";
					var text = "";
					if(this.Response.news[i].image != null){
						text += "<div style='float:right;padding-left:10px'><img src='"+this.Response.news[i].image+"' /></div>";
					}
					text += this.Response.news[i].content;
					text = text.replace(/\n|\r\n/g, "<br />");
					//text = text.replace("\n", "<br />");
					bodyContentDIV.innerHTML = text;
					bodyContentDIV.style.textAlign = "justify";
					bodyContentDIV.style.alignment = "justify";
					//bodyDIV.appendChild(bodyContentDIV);
					newsObj.appendContent(bodyContentDIV);
						
					if(!Rf.empty(this.Response.privileges.news.CREATE ||
						!Rf.empty(this.Response.privileges.news.UPDATE) ||
						!Rf.empty(this.Response.privileges.news.DELETE))){

						var bodyToolbarDIV = Rf.dc("div");
						bodyToolbarDIV.style.position = "relative";
						bodyToolbarDIV.style.height = "20px";
						bodyToolbarDIV.style.top = "0px";
						bodyToolbarDIV.style.left = "0px";
						newsObj.appendContent(bodyToolbarDIV);
							var toolbar = Rf.dc("div");
							toolbar.style.position = "absolute";
							toolbar.style.width = "100px";
							toolbar.style.height = "23px";
							//toolbar.style.backgroundColor = "#CCCCCC";
							toolbar.style.bottom = "0px";
							toolbar.style.right = "-1px";
							//toolbar.innerHTML = "Toolbar";
							bodyToolbarDIV.appendChild(toolbar);
								if(!Rf.empty(this.Response.privileges.news.UPDATE)){
									
									var checkboxLabel = Rf.dc("span");
									checkboxLabel.style.position = "absolute";
									checkboxLabel.style.top = "2px";
									checkboxLabel.style.left = "16px";
									checkboxLabel.innerHTML = "aktiv";
									checkboxLabel.style.color = "#CC0000";
									
									var checkbox = Rf.dc("input");
									checkbox.type = "checkbox";
									checkbox.style.position = "absolute";
									checkbox.style.top = "2px";
									checkbox.style.border = "0px none #000000";
									checkbox.rfNews = this.rfNews;
									checkbox.newsId = this.Response.news[i].id;	
									checkbox.checkboxLabel = checkboxLabel;
									checkbox.onclick = function(){
										if(this.checked == true){
											this.rfNews.changeNewsStatus({
												NewsId: this.newsId,
												Active: "1"
											});
											this.checkboxLabel.style.color = "#000000";
										}
										else{
											this.rfNews.changeNewsStatus({
												NewsId: this.newsId,
												Active: "0"
											});
											this.checkboxLabel.style.color = "#CC0000";
										}
									}

									toolbar.appendChild(checkbox);
									toolbar.appendChild(checkboxLabel);
									
									if(this.Response.news[i].active == "1"){
										checkboxLabel.style.color = "#000000";
										checkbox.setAttribute("checked", "checked");
									}
								
									var button = Rf.getIMGButton("images/common/pencil.png");
									button.style.left = "50px";
									button.rfNews = this.rfNews;
									button.rfNewsCurrentNews = this.Response.news[i];
									button.onclick = function(){
										this.rfNews.showNewsEditForm({
											Id: this.rfNewsCurrentNews.id,
											Content: this.rfNewsCurrentNews.content,
											Headline: this.rfNewsCurrentNews.headline,
											Datetime: this.rfNewsCurrentNews.date,
											AuthorId: this.rfNewsCurrentNews.id_user_author,
											ModId: this.rfNewsCurrentNews.id_user_mod,
											Active: this.rfNewsCurrentNews.active,
											Weekday: this.rfNewsCurrentNews.weekday
										});
									};
									toolbar.appendChild(button);
								}
								if(!Rf.empty(this.Response.privileges.news.DELETE)){
									var button = Rf.getIMGButton("images/common/delete2.gif");
									button.style.left = "74px";
									button.rfNews = this.rfNews;
									button.newsId = this.Response.news[i].id;
									button.onclick = function(){
										this.rfNews.deleteNews({
											NewsId: this.newsId
										});
									}
									toolbar.appendChild(button);
								}
						}
				
				td.appendChild(newsObj.getNode());
				
			}
			
			if(numOfNewsShown == 0){
				var tr = Rf.dc("tr");
				tbody.appendChild(tr);
				var td = Rf.dc("td");
				td.style.height = "100px";
				td.innerHTML = "Zur Zeit keine News vorhanden.";
				td.style.verticalAlign = "middle";
				td.style.textAlign = "center";
				td.style.fontWeight = "bold";
				tr.appendChild(td);
			}
			
		}
	}
	request.onError = function() { alert("b"); } 
	request.onTimeout = function() { alert("c"); } 
	var conn = new Rf.Loading.CConnectHTTPXML({ServiceUrl: "local/modules/News/backend.php"}); 
	conn.sendRequest( request );
}

//NewsId,Active
Rf.CNews.prototype.changeNewsStatus = function(aH){
	if(Rf.empty(aH)){
		aH = {};
	}
	
	var request = new Rf.Loading.CRequest();
	request.rfNews = this;
	request.Data = {
		username:Rf.Session.rfAuth.username,
		password:Rf.Session.rfAuth.password,
		userId:Rf.Session.rfAuth.userId,
		action:"changeNewsStatus",
		newsId:aH.NewsId,
		active:aH.Active
	};
	
	request.onSuccess = function() {
		if(!Rf.empty(this.Response.error)){
			Rf.setError(this.Response.error);
		}
		else{
			Rf.Session.rfTicker.refresh();
		}
	}
	request.onError = function() { alert("b"); } 
	request.onTimeout = function() { alert("c"); } 
	var conn = new Rf.Loading.CConnectHTTPXML({ServiceUrl: "local/modules/News/backend.php"}); 
	conn.sendRequest( request );
}

//NewsId,Active
Rf.CNews.prototype.changeNews = function(aH){
	if(Rf.empty(aH)){
		aH = {};
	}
/*
this.rfNews.createNews({
					Headline: this.getrfNews.Nodes.NEFHeadlineInput,
					Content: this.rfNews.Nodes.NEFContentInput,
					Datetime: this.rfNews.DateTime.getDBString()
				});
			}
*/
	
	var request = new Rf.Loading.CRequest();
	request.rfNews = this;
	request.Data = {
		username:Rf.Session.rfAuth.username,
		password:Rf.Session.rfAuth.password,
		userId:Rf.Session.rfAuth.userId,
		action:"changeNews",
		newsId:aH.NewsId,
		headline:aH.Headline,
		content:aH.Content,
		date:aH.Datetime
	};
	
	request.onSuccess = function() {
		if(!Rf.empty(this.Response.error)){
			Rf.setError(this.Response.error);
		}
		else{
			this.rfNews.hideNewsEditForm();
			this.rfNews.showNewsListing();
			Rf.Session.rfTicker.refresh();
		}
	}
	request.onError = function() { alert("b"); } 
	request.onTimeout = function() { alert("c"); } 
	var conn = new Rf.Loading.CConnectHTTPXML({ServiceUrl: "local/modules/News/backend.php"}); 
	conn.sendRequest( request );
}

Rf.CNews.prototype.createNews = function(aH){
	if(Rf.empty(aH)){
		aH = {};
	}

	var request = new Rf.Loading.CRequest();
	request.rfNews = this;
	request.Data = {
		username:Rf.Session.rfAuth.username,
		password:Rf.Session.rfAuth.password,
		userId:Rf.Session.rfAuth.userId,
		action:"createNews",
		newsId:aH.NewsId,
		headline:aH.Headline,
		content:aH.Content,
		date:aH.Datetime
	};
	
	request.onSuccess = function() {
		if(!Rf.empty(this.Response.error)){
			Rf.setError(this.Response.error);
		}
		else{
			this.rfNews.hideNewsEditForm();
			this.rfNews.showNewsListing();
		}
	}
	request.onError = function() { alert("b"); } 
	request.onTimeout = function() { alert("c"); } 
	var conn = new Rf.Loading.CConnectHTTPXML({ServiceUrl: "local/modules/News/backend.php"}); 
	conn.sendRequest( request );
}

Rf.CNews.prototype.deleteNews = function(aH){
	if(Rf.empty(aH)){
		aH = {};
	}

	var request = new Rf.Loading.CRequest();
	request.rfNews = this;
	request.Data = {
		username:Rf.Session.rfAuth.username,
		password:Rf.Session.rfAuth.password,
		userId:Rf.Session.rfAuth.userId,
		action:"deleteNews",
		newsId:aH.NewsId
	};
	
	request.onSuccess = function() {
		if(!Rf.empty(this.Response.error)){
			Rf.setError(this.Response.error);
		}
		else{
			this.rfNews.showNewsListing();
			Rf.Session.rfTicker.refresh();
		}
	}
	request.onError = function() { alert("b"); } 
	request.onTimeout = function() { alert("c"); } 
	var conn = new Rf.Loading.CConnectHTTPXML({ServiceUrl: "local/modules/News/backend.php"}); 
	conn.sendRequest( request );
}

//cI
Rf.CNews.prototype.createNewsEditForm = function(aH){
	this.SubPartDIVs["NewsEditForm"] = Rf.getPopUpForm(600, "News hinzuf&uuml;gen / editieren");
	
	
	this.Nodes.NEFdivHeadline = Rf.dc("div");
	this.Nodes.NEFdivHeadline.className = "rfRelative";
	this.Nodes.NEFdivHeadline.style.height = "42px";
	this.Nodes.NEFdivHeadline.style.top = "14px";
	this.Nodes.NEFdivHeadline.style.left = "10px";
	
		this.Nodes.NEFHeadlineLabel = Rf.dc("div");
		this.Nodes.NEFHeadlineLabel.className = "rfLabel";
		this.Nodes.NEFHeadlineLabel.innerHTML = "Headline:";
		this.Nodes.NEFdivHeadline.appendChild(this.Nodes.NEFHeadlineLabel);
		
		this.Nodes.NEFHeadlineInput = Rf.dc("input");
		this.Nodes.NEFHeadlineInput.type = "text";
		this.Nodes.NEFHeadlineInput.maxLength = 100;
		this.Nodes.NEFHeadlineInput.className = "rfInput";
		this.Nodes.NEFHeadlineInput.style.width = "492px";
		this.Nodes.NEFdivHeadline.appendChild(this.Nodes.NEFHeadlineInput);
	
	this.SubPartDIVs["NewsEditForm"].appendChild(this.Nodes.NEFdivHeadline);
	
	this.Nodes.NEFdivDatetimechoose = Rf.dc("div");
	this.Nodes.NEFdivDatetimechoose.className = "rfRelative";
	this.Nodes.NEFdivDatetimechoose.style.height = "30px";
	this.Nodes.NEFdivDatetimechoose.style.top = "6px";
	this.Nodes.NEFdivDatetimechoose.style.left = "10px";
		
		this.Nodes.NEFinputDatetimechoose = Rf.dc("div");
		this.Nodes.NEFinputDatetimechoose.className = "rfInput";
			this.Nodes.NEFinputDatetimechooseCheckbox = Rf.dc("input");
			this.Nodes.NEFinputDatetimechooseCheckbox.style.position = "absolute";
			this.Nodes.NEFinputDatetimechooseCheckbox.style.top = "2px";
			this.Nodes.NEFinputDatetimechooseCheckbox.style.left = "0px";
			this.Nodes.NEFinputDatetimechooseCheckbox.style.width = "14px";
			this.Nodes.NEFinputDatetimechooseCheckbox.style.height = "14px";
			this.Nodes.NEFinputDatetimechooseCheckbox.style.padding = "0px";
			this.Nodes.NEFinputDatetimechooseCheckbox.style.margin = "0px";
			this.Nodes.NEFinputDatetimechooseCheckbox.style.border = "0px none #000000";
			this.Nodes.NEFinputDatetimechooseCheckbox.type = "checkbox";
			this.Nodes.NEFinputDatetimechooseCheckbox.News = this;
			this.Nodes.NEFinputDatetimechooseCheckbox.onchange = function(){
				if(this.checked == true){
					this.News.DateTime.enable();
				}
				else{
					this.News.DateTime.disable();
				}
			};
			this.Nodes.NEFinputDatetimechoose.appendChild(this.Nodes.NEFinputDatetimechooseCheckbox);
			this.Nodes.NEFinputDatetimechooseText = Rf.dc("div");
			this.Nodes.NEFinputDatetimechooseText.className = "rfAbsolute";
			this.Nodes.NEFinputDatetimechooseText.style.top = "2px";
			this.Nodes.NEFinputDatetimechooseText.style.left = "16px";
			this.Nodes.NEFinputDatetimechooseText.style.width = "200px";
			this.Nodes.NEFinputDatetimechooseText.innerHTML = "Datum/Zeit manuell festlegen";
			this.Nodes.NEFinputDatetimechoose.appendChild(this.Nodes.NEFinputDatetimechooseText);
		this.Nodes.NEFdivDatetimechoose.appendChild(this.Nodes.NEFinputDatetimechoose);
	
	this.SubPartDIVs["NewsEditForm"].appendChild(this.Nodes.NEFdivDatetimechoose);
	
	this.Nodes.NEFdivDatetime = Rf.dc("div");
	this.Nodes.NEFdivDatetime.className = "rfRelative";
	this.Nodes.NEFdivDatetime.style.height = "36px";
	//this.Nodes.NEFdivDatetime.style.top = "70px";
	this.Nodes.NEFdivDatetime.style.left = "10px";
	
		this.Nodes.NEFlabelTo = Rf.dc("div");
		this.Nodes.NEFlabelTo.className = "rfLabel";
		this.Nodes.NEFlabelTo.innerHTML = "Datum/Zeit:";
		this.Nodes.NEFdivDatetime.appendChild(this.Nodes.NEFlabelTo);
		
		this.Nodes.NEFcontentTo = Rf.dc("div");
		this.Nodes.NEFcontentTo.className = "rfInput";
			this.DateTime = new Rf.Dom.DateTimePicker({});
			this.Nodes.NEFcontentTo.appendChild(this.DateTime.DIV);
		this.Nodes.NEFdivDatetime.appendChild(this.Nodes.NEFcontentTo);
	
	this.SubPartDIVs["NewsEditForm"].appendChild(this.Nodes.NEFdivDatetime);
	
	this.Nodes.NEFdivContent = Rf.dc("div");
	this.Nodes.NEFdivContent.className = "rfRelative";
	this.Nodes.NEFdivContent.style.height = "130px";
	//this.Nodes.NEFdivContent.style.top = "106px";
	this.Nodes.NEFdivContent.style.left = "10px";
	
		this.Nodes.NEFContentLabel = Rf.dc("div");
		this.Nodes.NEFContentLabel.className = "rfLabel";
		this.Nodes.NEFContentLabel.innerHTML = "Text:";
		this.Nodes.NEFdivContent.appendChild(this.Nodes.NEFContentLabel);
		
		this.Nodes.NEFContentInput = Rf.dc("textarea");
		this.Nodes.NEFContentInput.className = "rfInput";
		this.Nodes.NEFContentInput.style.width = "492px";
		this.Nodes.NEFContentInput.style.height = "120px";
		this.Nodes.NEFdivContent.appendChild(this.Nodes.NEFContentInput);	
	
	this.SubPartDIVs["NewsEditForm"].appendChild(this.Nodes.NEFdivContent);
	
	this.Nodes.NEFdivSubmit = Rf.dc("div");
	this.Nodes.NEFdivSubmit.className = "rfRelative";
	this.Nodes.NEFdivSubmit.style.height = "30px";
	this.Nodes.NEFdivSubmit.style.top = "6px";
	this.Nodes.NEFdivSubmit.style.left = "90px";
	
		this.Nodes.NEFSubmit = Rf.dc("div");
		this.Nodes.NEFSubmit.className = "rfSubmit";
		this.Nodes.NEFSubmit.innerHTML = "speichern";
		this.Nodes.NEFSubmit.rfNews = this;
		this.Nodes.NEFSubmit.onclick = function(){
			if(this.rfNews.currentNewsId == null){
				this.rfNews.createNews({
					Headline: this.rfNews.Nodes.NEFHeadlineInput.value,
					Content: this.rfNews.Nodes.NEFContentInput.value,
					Datetime: this.rfNews.DateTime.getDBString()
				});
			}
			else{
				this.rfNews.changeNews({
					NewsId: this.rfNews.currentNewsId,
					Headline: this.rfNews.Nodes.NEFHeadlineInput.value,
					Content: this.rfNews.Nodes.NEFContentInput.value,
					Datetime: this.rfNews.DateTime.getDBString()
				});
			}
		};
		this.Nodes.NEFdivSubmit.appendChild(this.Nodes.NEFSubmit);
	
	this.SubPartDIVs["NewsEditForm"].appendChild(this.Nodes.NEFdivSubmit);

	document.getElementsByTagName("body")[0].appendChild(this.SubPartDIVs["NewsEditForm"]);
}

//cI
Rf.CNews.prototype.showNewsEditForm = function(aH){
	if(typeof aH != "undefined" && !Rf.empty(aH.Id)){
		this.currentNewsId = aH.Id;
		this.Nodes.NEFHeadlineInput.value = aH.Headline;
		this.Nodes.NEFinputDatetimechooseCheckbox.setAttribute("checked", "checked");
		this.DateTime.enable();
		this.DateTime.set({Datetime: aH.Datetime});
		this.Nodes.NEFContentInput.value = aH.Content;
	}
	else{
		this.currentNewsId = null;
		this.Nodes.NEFHeadlineInput.value = "";
		this.Nodes.NEFinputDatetimechooseCheckbox.checked = false;
		this.DateTime.refresh();
		this.DateTime.disable();
		this.Nodes.NEFContentInput.value = "";
	}
	this.SubPartDIVs["NewsEditForm"].style.display = "block";
}

Rf.CNews.prototype.hideNewsEditForm = function(aH){
	this.SubPartDIVs["NewsEditForm"].style.display = "none";
}

//cI
Rf.CNews.prototype.showPart = function(aH){
	Rf.Session.resetMaxContentWidth();
	var cIArray = aH.cI.split("|");
	if(Rf.empty(cIArray[1])){
		if(this.SubPartDIVs["NewsListing"].innerHTML == ""){
			this.showNewsListing();
		}
		this.show({name:"NewsListing"});
	}
}




/*
Rf.CNews._ModuleFiles = [
	__HTTP_SOURCE__+'modules/RfNews/partMain.js'
]

//modulePart
Rf.CNews.load = function(aH){
	//default
	if(typeof aH == 'undefined' || typeof aH.modulePart == 'undefined'){
		aH.modulePart = 'main';
	}
	switch(aH.modulePart){
		case 'main':{
			rfLoading.loadScriptGroup(Rf.CNews._ModuleFiles, 'show news()');
			break;
		}
		default:{
			break;
		}
	}
}

rfNews.divId = '';

//divId
rfNews.init = function(aH){
	rfNews.divId = aH.divId;
	rfNews.getNews(aH);
}

rfNews.getNews = function(aH){
	var params = 'action=getnews&module=rfNews&username='+rfUser.getUsername()+'&';
	var options = {method: 'post', parameters: params, onComplete: rfUser.login_callback};
	var myAjax = new Ajax.Request(__HTTP_SOURCE__+'backend/rfNews.php' ,options);
}

rfNews.getNews_callback = function(res){
	dg(rfNews.divId).innerHTML = '';
}
*///{Rf.CContent} content, divIdSubMenu
Rf.CDates = function(aH){
	
	Rf.CModule.call(this, aH);
	
	this.RfContent = aH.content;
	this.RfAuth = this.RfContent.RfAuth;
	this.DIV = Rf.dcModuleDIV();
	this.RfContent.DIV.appendChild(this.DIV);
	
	this.UserID = this.RfContent.UserID;
	
	this.RegisteredSubMenuItems = {};
	this.SubMenuItemDivs = {};
	this.SubPartDIVs = {};
	
	
	
	this.buildSubParts();
	this.createSiteIndicator({ModuleName: "Termine"});
	
	this.RegisteredSubMenuItems["liste"] = {label:"Liste"};
	
	this.createSubMenu();
}
Rf.CDates.prototype = new Rf.CModule(false);

Rf.CDates.prototype.ListGameRows = null;
Rf.CDates.prototype.ListEventRows = null;
Rf.CDates.prototype.ListExtendRows = null;

Rf.CDates.prototype.buildSubParts = function(){
	this.createListe();
	this.createKalender();
}

Rf.CDates.prototype.createListe = function(){
	this.SubPartDIVs["liste"] = Rf.dc("div");
	this.DIV.appendChild(this.SubPartDIVs["liste"]);
}

Rf.CDates.prototype.createKalender = function(){
	this.SubPartDIVs["kalender"] = Rf.dc("div");
	this.DIV.appendChild(this.SubPartDIVs["kalender"]);
}

Rf.CDates.prototype.switchListTypes = function(){
	var i = 0;
	for(i=0; i<this.ListExtendRows.length; i++){
		this.ListExtendRows[i].style.display = 'none';
	}
	if(this.Nodes.listDateType.value == "games"){
		for(i=0; i<this.ListGameRows.length; i++){
			this.ListGameRows[i].style.display = '';
		}
		for(i=0; i<this.ListEventRows.length; i++){
			this.ListEventRows[i].style.display = 'none';
		}
	}
	else if(this.Nodes.listDateType.value == "events"){
		for(i=0; i<this.ListGameRows.length; i++){
			this.ListGameRows[i].style.display = 'none';
		}
		for(i=0; i<this.ListEventRows.length; i++){
			this.ListEventRows[i].style.display = '';
		}
	}
	else{//all
		for(i=0; i<this.ListGameRows.length; i++){
			this.ListGameRows[i].style.display = '';
		}
		for(i=0; i<this.ListEventRows.length; i++){
			this.ListEventRows[i].style.display = '';
		}
	}
}

Rf.CDates.prototype.fillListe = function(aH, force_flag){
	if(typeof aH == "undefined"){
		aH = {};
	}
	if(this.SubPartDIVs["liste"].innerHTML != "" && (typeof force_flag != "boolean" || force_flag != true)){
		return true;
	}

	if(typeof this.Nodes.listSelectRow == "undefined"){
		this.Nodes.listSelectRow = Rf.dc("div");
		this.Nodes.listSelectRow.className = "Dates_listSelectRow";
		
		this.Nodes.listYearLabel = Rf.dc("div");
		this.Nodes.listYearLabel.className = "Dates_listYearLabel";
		this.Nodes.listYearLabel.innerHTML = "Jahr:";
		this.Nodes.listSelectRow.appendChild(this.Nodes.listYearLabel);
		
		var div = Rf.dc("div");
		div.style.position = "absolute";
		div.style.top = "0px";
		div.style.right = "0px";
			this.Nodes.listYearSelect = Rf.dc("select");
			this.Nodes.listYearSelect.rfDates = this;
			this.Nodes.listYearSelect.onchange = function(){
				this.rfDates.fillListe({Year:this.value}, true);
			}
			this.Nodes.listYearSelect.style.width = "53px";
				var option = Rf.dc("option");
				option.innerHTML = "2012"; 
				option.value = "2012";
				option.selected = true;
				this.Nodes.listYearSelect.appendChild(option);
				var option = Rf.dc("option");
				option.innerHTML = "2011";
				option.value = "2011";
				this.Nodes.listYearSelect.appendChild(option);
				var option = Rf.dc("option");
				option.innerHTML = "2010";
				option.value = "2010";
				this.Nodes.listYearSelect.appendChild(option);
				var option = Rf.dc("option");
				option.innerHTML = "2009";
				option.value = "2009";
				this.Nodes.listYearSelect.appendChild(option);
				var option = Rf.dc("option");
				option.innerHTML = "2008";
				option.value = "2008";
				this.Nodes.listYearSelect.appendChild(option);
				var option = Rf.dc("option");
				option.innerHTML = "2007";
				option.value = "2007";
				this.Nodes.listYearSelect.appendChild(option);
			div.appendChild(this.Nodes.listYearSelect);
		this.Nodes.listSelectRow.appendChild(div);
		
		if(typeof aH.Year != "undefined"){
			this.Nodes.listYearSelect.value = aH.Year;
		}
	
		this.Nodes.listDateTypeLabel = Rf.dc("div");
		this.Nodes.listDateTypeLabel.className = "Dates_listDateTypeLabel";
		this.Nodes.listDateTypeLabel.innerHTML = "Termintyp:";
		this.Nodes.listSelectRow.appendChild(this.Nodes.listDateTypeLabel);
	
		var div = Rf.dc("div");
		div.style.position = "absolute";
		div.style.top = "0px";
		div.style.left = "78px";
			this.Nodes.listDateType = Rf.dc("select");
			this.Nodes.listDateType.rfDates = this;
			this.Nodes.listDateType.onchange = function(){
				this.rfDates.switchListTypes();
			}
			this.Nodes.listDateType.style.width = "86px";
				var option = Rf.dc("option");
				option.innerHTML = "alle";
				option.value = "all";
				this.Nodes.listDateType.appendChild(option);
				var option = Rf.dc("option");
				option.innerHTML = "Events";
				option.value = "events";
				this.Nodes.listDateType.appendChild(option);
				var option = Rf.dc("option");
				option.innerHTML = "Medenspiele";
				option.value = "games";
				this.Nodes.listDateType.appendChild(option);
			div.appendChild(this.Nodes.listDateType);
		this.Nodes.listSelectRow.appendChild(div);
			
		this.SubPartDIVs["liste"].appendChild(this.Nodes.listSelectRow);
		
		
		this.Nodes.listContent = Rf.dc("div");
		this.Nodes.listContent.className = "Dates_listContent";
		
		this.SubPartDIVs["liste"].appendChild(this.Nodes.listContent);
	}
	
	var request = new Rf.Loading.CRequest();
	request.rfDates = this;
	request.Data = {
		username:Rf.Session.rfAuth.username,
		password:Rf.Session.rfAuth.password,
		userId:Rf.Session.rfAuth.userId,
		action:"getList",
		year:this.Nodes.listYearSelect.value,
		datetype:this.Nodes.listDateType.value
	};
	
	request.onSuccess = function() {
		if(!Rf.empty(this.Response.error)){
			Rf.setError(this.Response.error);
		}
		else{
			this.rfDates.ListGameRows = [];
			this.rfDates.ListEventRows = [];
			this.rfDates.ListExtendRows = [];
			
			this.rfDates.Nodes.listContent.innerHTML = "";
			dates = this.Response.dates;
			for(month in dates){

				var monthObj = new Rf.CContentBox({
					Color: "d0c6b0",
					HeaderLeftText: month,
					HeaderRightText: ""
				});
				
					var thisEvents = dates[month]["events"];
					var thisGames = dates[month]["games"];
					
					var thisEventsLength = thisEvents.length;
					var thisGamesLength = thisGames.length;
					
					
					var numOfDatesInMonth = thisEventsLength + thisGamesLength;
					
					
					//content table
					var t = Rf.dc("table");
					t.cellpadding = "0";
					t.cellspacing = "0";
					var tb = Rf.dc("tbody");
					t.appendChild(tb);
					monthObj.appendContent(t);
					
					//for(date in dates[month]){
					var indexEvents = 0;
					var indexGames = 0;
					for(var i=0; i<numOfDatesInMonth; i++){
						
						var tr1 = Rf.dc("tr");
						var tr2 = Rf.dc("tr");
						var tr3 = Rf.dc("tr");
						//seperator
						if(i>0){
							//space
							tb.appendChild(tr1);
							var td = Rf.dc("td");
							td.colSpan = "4";
							td.style.height = "2px";
							td.style.lineHeight = "0px";
							td.style.fontSize = "0px";
							tr1.appendChild(td);
							td.innerHTML = "<img src=\"images/common/space.gif\" style=\"width:2px;height:2px;\" />";
							
							//line
							tb.appendChild(tr2);
							var td = Rf.dc("td");
							td.colSpan = "4";
							td.style.height = "2px";
							td.style.lineHeight = "0px";
							td.style.fontSize = "0px";
							tr2.appendChild(td);
							td.style.backgroundColor = "#EEEEEE";
							td.innerHTML = "<img src=\"images/common/space.gif\" style=\"width:2px;height:2px;\" />";
							
							//space
							tb.appendChild(tr3);
							var td = Rf.dc("td");
							td.colSpan = "4";
							td.style.height = "2px";
							td.style.lineHeight = "0px";
							td.style.fontSize = "0px";
							tr3.appendChild(td);
							td.innerHTML = "<img src=\"images/common/space.gif\" style=\"width:2px;height:2px;\" />";
						}
						
						//data row
						var tr4 = Rf.dc("tr");
						tr4.onmouseover = function(){
							this.style.backgroundColor = "#DDDDDD";
						};
						tr4.onmouseout = function(){
							this.style.backgroundColor = "";
						};
						tr4.onclick = function(){
							if(this.extendRow.style.display == ""){
								this.extendRow.style.display = "none";
							}
							else{
								this.extendRow.style.display = "";
							}
						};
						tr4.style.cursor = "pointer";
						tr4.style.cursor = "hand";
						tb.appendChild(tr4);
						var td_date = Rf.dc("td");
							td_date.style.paddingTop = "1px";
							td_date.style.verticalAlign = "top";
							td_date.style.lineHeight = "13px";
						tr4.appendChild(td_date);
						var td_time = Rf.dc("td");
							td_time.style.paddingTop = "1px";
							td_time.style.verticalAlign = "top";
							td_time.style.lineHeight = "13px";
						tr4.appendChild(td_time);
						var td_title = Rf.dc("td");
							td_title.style.paddingTop = "1px";
							td_title.style.verticalAlign = "top";
							td_title.style.lineHeight = "13px";
							td_title.style.width = "100%";
						tr4.appendChild(td_title);
						var td_category = Rf.dc("td");
						td_category.whiteSpace = "nowrap";
						tr4.appendChild(td_category);
						
						//2nddata row
						var tr5 = Rf.dc("tr");
						tr4.extendRow = tr5;
						tr5.onclick = function(){
							if(this.style.display == ""){
								this.style.display = "none";
							}
							else{
								this.style.display = "";
							}
						};
						tr5.style.cursor = "pointer";
						tr5.style.cursor = "hand";
						tr5.style.display = "none";
						tr5.style.paddingTop = "20px";
						tb.appendChild(tr5);
						var td_dateadd = Rf.dc("td");
						td_dateadd.colSpan = "2";
						td_dateadd.innerHTML = "<img src=\"images/common/space.gif\" style=\"width:2px;height:14px;\" />";
						tr5.appendChild(td_dateadd);
						var td_content = Rf.dc("td");
						td_content.style.paddingTop = "3px";
						td_content.style.paddingBottom = "3px";
						td_content.style.width = "100%";
						td_content.style.lineHeight = "13px";
						td_content.style.color = "#555555";
						tr5.appendChild(td_content);
						var td_contentadd = Rf.dc("td");
						td_contentadd.whiteSpace = "nowrap";
						tr5.appendChild(td_contentadd);
						
						var eventFlag = false;
						if(indexEvents < thisEventsLength){
							eventFlag = true;
						 	if(indexGames < thisGamesLength){
						 		if(Rf.getComparableDateTime(thisEvents[indexEvents].datefrom) <= Rf.getComparableDateTime(thisGames[indexGames].date)){
						 			eventFlag = true;
						 		}
						 		else{
						 			eventFlag = false;
						 		}
							}
						}
						
						if(eventFlag == true){
							//event
							this.rfDates.ListEventRows[this.rfDates.ListEventRows.length] = tr1;
							this.rfDates.ListEventRows[this.rfDates.ListEventRows.length] = tr2;
							this.rfDates.ListEventRows[this.rfDates.ListEventRows.length] = tr3;
							this.rfDates.ListEventRows[this.rfDates.ListEventRows.length] = tr4;
							
							this.rfDates.ListExtendRows[this.rfDates.ListExtendRows.length] = tr5;
							
							var date = Rf.getReadableDate(thisEvents[indexEvents].datefrom);
							var time = Rf.getReadableTimeShort(thisEvents[indexEvents].datefrom);
							td_date.innerHTML = "<span style=\"white-space:nowrap;\">"+date+"<img src=\"images/common/space.gif\" style=\"width:8px;height:5px;\" /></span>";
							if(time == "00:00"){
								td_time.innerHTML = "<span style=\"white-space:nowrap;visibility:hidden;\">"+time+" Uhr<img src=\"images/common/space.gif\" style=\"width:8px;height:5px;\" /></span>";
							}
							else{
								td_time.innerHTML = "<span style=\"white-space:nowrap;\">"+time+" Uhr<img src=\"images/common/space.gif\" style=\"width:8px;height:5px;\" /></span>";
							}
							td_title.innerHTML = thisEvents[indexEvents].headline;
							
							/*var item = Rf.dc("div");
							item.style.position = "relative";
							item.style.top = "0px";
							item.style.left = "0px";
							item.style.width = "100%";
							item.style.height = "15px";
							item.style.lineHeight = "15px";
							item.style.fontSize = "11px";
							item.style.backgroundColor = "#EEEEEE";
							if(i%2==1){
								item.style.backgroundColor = "#DDDDDD";
							}
							item.innerHTML = thisEvents[indexEvents].datefrom+thisEvents[indexEvents].headline;
							*/
							
							var content = "<span style=\"white-space:nowrap;\"><img src=\"";
							if(thisEvents[indexEvents].category_tennis == "1"){
								content += Rf.CContent.DateImagesActive.TENNIS;
							}
							else{
								content += Rf.CContent.DateImagesDisabled.TENNIS;
							}
							content += "\" style=\"width:16px;height:16px;\" />";
							content += "<img src=\"images/common/space.gif\" style=\"width:5px;height:16px;\" /><img src=\"";
							if(thisEvents[indexEvents].category_food == "1"){
								content += Rf.CContent.DateImagesActive.FOOD;
							}
							else{
								content += Rf.CContent.DateImagesDisabled.FOOD;
							}
							content += "\" style=\"width:16px;height:16px;\" />";
							content += "<img src=\"images/common/space.gif\" style=\"width:5px;height:16px;\" /><img src=\"";
							if(thisEvents[indexEvents].category_work == "1"){
								content += Rf.CContent.DateImagesActive.WORK;
							}
							else{
								content += Rf.CContent.DateImagesDisabled.WORK;
							}
							content += "\" style=\"width:16px;height:16px;\" /></span>";
	
							td_category.innerHTML = content;
							
							if(typeof thisEvents[indexEvents].content != "string"){
								thisEvents[indexEvents].content = "&nbsp;";
							}
							
							td_content.innerHTML = thisEvents[indexEvents].content;
							
							
							indexEvents++;
						}
						else{
							//game
							this.rfDates.ListGameRows[this.rfDates.ListGameRows.length] = tr1;
							this.rfDates.ListGameRows[this.rfDates.ListGameRows.length] = tr2;
							this.rfDates.ListGameRows[this.rfDates.ListGameRows.length] = tr3;
							this.rfDates.ListGameRows[this.rfDates.ListGameRows.length] = tr4;
							
							this.rfDates.ListExtendRows[this.rfDates.ListExtendRows.length] = tr5;
							/*
							var item = Rf.dc("div");
							item.style.position = "relative";
							item.style.top = "0px";
							item.style.left = "0px";
							item.style.width = "100%";
							item.style.height = "15px";
							item.style.lineHeight = "15px";
							item.style.fontSize = "11px";
							item.style.backgroundColor = "#EEEEEE";
							if(i%2==1){
								item.style.backgroundColor = "#DDDDDD";
							}
							item.innerHTML = thisGames[indexGames].date+thisGames[indexGames].place;
							monthObj.appendContent(item);
							*/
							var date = Rf.getReadableDate(thisGames[indexGames].date);
							var time = Rf.getReadableTimeShort(thisGames[indexGames].date);
							td_date.innerHTML = "<span style=\"white-space:nowrap;\">"+date+"<img src=\"images/common/space.gif\" style=\"width:8px;height:5px;\" /></span>";
							td_time.innerHTML = "<span style=\"white-space:nowrap;\">"+time+" Uhr<img src=\"images/common/space.gif\" style=\"width:8px;height:5px;\" /></span>";
							var title = "<i>"+thisGames[indexGames].team+":&nbsp;&nbsp;</i>";
							if(thisGames[indexGames].homeflag == "1"){
								title += "<span style=\"white-space:nowrap;\">TC Kirrberg "+thisGames[indexGames].teamnumber+"</span> - <span style=\"white-space:nowrap;\">"+thisGames[indexGames].adversary+" "+thisGames[indexGames].adversarynumber+"</span>";
							}
							else{
								title += "<span style=\"white-space:nowrap;\">"+thisGames[indexGames].adversary+" "+thisGames[indexGames].adversarynumber+"</span> - <span style=\"white-space:nowrap;\">TC Kirrberg "+thisGames[indexGames].teamnumber+"</span>";
							}
							td_title.innerHTML = title;
															
							var contentArray = [];
							contentArray[contentArray.length] = "<span style=\"white-space:nowrap;\"><img src=\"";
							contentArray[contentArray.length] = Rf.CContent.DateImagesActive.TENNIS;
							contentArray[contentArray.length] = "\" style=\"width:16px;height:16px;\" />";
							contentArray[contentArray.length] = "<img src=\"images/common/space.gif\" style=\"width:5px;height:16px;\" /><img src=\"";
							contentArray[contentArray.length] = Rf.CContent.DateImagesDisabled.FOOD;
							contentArray[contentArray.length] = "\" style=\"width:16px;height:16px;\" />";
							contentArray[contentArray.length] = "<img src=\"images/common/space.gif\" style=\"width:5px;height:16px;\" /><img src=\"";
							contentArray[contentArray.length] = Rf.CContent.DateImagesDisabled.WORK;
							contentArray[contentArray.length] = "\" style=\"width:16px;height:16px;\" /></span>";
							
							td_category.innerHTML = contentArray.join("");
							
							var additionalContent = "Austragungsort: "+thisGames[indexGames].place;
							additionalContent += "<br/>Spielnummer: "+thisGames[indexGames].number;
							td_content.innerHTML = additionalContent;
							
							indexGames++;
						}
					}
				
				this.rfDates.Nodes.listContent.appendChild(monthObj.getNode());
			}
		}
	}
	request.onError = function() {  } 
	request.onTimeout = function() {  } 
	var conn = new Rf.Loading.CConnectHTTPXML({ServiceUrl: "local/modules/Dates/backend.php"}); 
	conn.sendRequest( request );
}

//page, newsId
Rf.CDates.prototype.showKalender = function(aH){
	var table = Rf.dcTable();
	var tbody = Rf.dc("tbody");
	table.appendChild(tbody);
	var tr = Rf.dc("tr");
	tbody.appendChild(tr);
	var td = Rf.dc("td");
	tr.appendChild(td);
	td.innerHTML = "Hier werden bald Termine zu finden sein.";
	td.style.textAlign = "center";
	td.style.verticalAlign = "middle";
	td.style.fontWeight = "bold";
	td.style.height = "100px";
	
	
	this.SubPartDIVs["Kalender"].innerHTML = "";
	this.SubPartDIVs["Kalender"].appendChild(table);
	
	return true;
	
	if(Rf.empty(aH)){
		aH = {};
	}
	if(Rf.empty(this.SubPartDIVs["NewsListing"])){
		this.createNewsListing();
	}
	if(Rf.empty(aH.page)){
		aH.page = 1;
	}
	
	var request = new Rf.Loading.CRequest();
	request.rfNews = this;
	request.Data = {
		username:Rf.Session.rfAuth.username,
		password:Rf.Session.rfAuth.password,
		userId:Rf.Session.rfAuth.userId,
		action:"getNews",
		page:aH.page
	};
	
	request.onSuccess = function() {
		if(!Rf.empty(this.Response.error)){
			Rf.setError(this.Response.error);
		}
		else{
			var table = Rf.dcTable();
			var tbody = Rf.dc("tbody");
			table.appendChild(tbody);
			
			
			/*
			if(!Rf.empty(this.Response.privileges.news.CREATE)){
				var tr = Rf.dc("tr");
				tbody.appendChild(tr);
				var td = Rf.dc("td");
				
				tr.appendChild(td);
				var lineButton = Rf.dc("div");
				lineButton.style.height = "30px";
				lineButton.style.position = "relative";
				lineButton.style.top = "0px";
				lineButton.style.left = "0px";
				td.appendChild(lineButton);
				var buttonCreate = Rf.getIMGButton("images/common/16plus.png");
				buttonCreate.rfNews = this.rfNews;
				buttonCreate.onclick = function(){
					this.rfNews.showNewsEditForm({
						Id: null
					});
				};
				lineButton.appendChild(buttonCreate);
			}
			
			var numOfNewsShown = 0;
			for(var i=0; i<this.Response.news.length; i++){
				if(this.Response.news[i].active == "0" && Rf.empty(this.Response.privileges.news.UPDATE)){
					continue;
				}
				
				numOfNewsShown++;
				
				var tr = Rf.dc("tr");
				tbody.appendChild(tr);
				var td = Rf.dc("td");
				tr.appendChild(td);
				
					var iTable = Rf.dcTable();
					iTable.style.border = "2px solid #DDDDDD";
					td.appendChild(iTable);
					var iTbody = Rf.dc("tbody");
					iTable.appendChild(iTbody);
					
					var iTr = Rf.dc("tr");
					iTbody.appendChild(iTr);
					var iTd = Rf.dc("td");
					iTd.style.backgroundColor = "#DDDDDD";
					iTd.style.padding = "0px 4px 2px 4px";
					iTr.appendChild(iTd);
					var headerDIV = Rf.dc("div");
					headerDIV.style.position = "relative";
					headerDIV.style.border = "1px solid #DDDDDD";
					headerDIV.style.top = "0px";
					headerDIV.style.left = "0px";
					iTd.appendChild(headerDIV);
					var headerHeadlineDIV = Rf.dc("div");
					headerHeadlineDIV.style.position = "relative";
					headerHeadlineDIV.style.top = "0px";
					headerHeadlineDIV.style.left = "0px";
					headerHeadlineDIV.style.fontWeight = "bold";
					headerHeadlineDIV.innerHTML = this.Response.news[i].headline;
					headerDIV.appendChild(headerHeadlineDIV);
					var headerDateDIV = Rf.dc("div");
					headerDateDIV.style.position = "absolute";
					headerDateDIV.style.top = "0px";
					headerDateDIV.style.right = "0px";
					//headerDateDIV.style.border = "1px solid red";
					headerDateDIV.innerHTML = Rf.getReadableDate(this.Response.news[i].date, this.Response.news[i].weekday);
					headerDIV.appendChild(headerDateDIV);
					
					var iTr = Rf.dc("tr");
					iTbody.appendChild(iTr);
					var iTd = Rf.dc("td");
					iTr.appendChild(iTd);
					var bodyDIV = Rf.dc("div");
					bodyDIV.style.position = "relative";
					bodyDIV.style.top = "0px";
					bodyDIV.style.left = "0px";
					iTd.appendChild(bodyDIV);
					var bodyContentDIV = Rf.dc("div");
					bodyContentDIV.style.position = "relative";
					bodyContentDIV.style.top = "0px";
					bodyContentDIV.style.left = "0px";
					bodyContentDIV.style.padding = "3px 5px 3px 5px";
					var text = this.Response.news[i].content;
					text = text.replace(/\n|\r\n/g, "<br />");
					//text = text.replace("\n", "<br />");
					bodyContentDIV.innerHTML = text;
					bodyDIV.appendChild(bodyContentDIV);
						
					if(!Rf.empty(this.Response.privileges.news.CREATE ||
						!Rf.empty(this.Response.privileges.news.UPDATE) ||
						!Rf.empty(this.Response.privileges.news.DELETE))){

						var bodyToolbarDIV = Rf.dc("div");
						bodyToolbarDIV.style.position = "relative";
						bodyToolbarDIV.style.height = "20px";
						bodyToolbarDIV.style.top = "0px";
						bodyToolbarDIV.style.left = "0px";
						bodyDIV.appendChild(bodyToolbarDIV);
							var toolbar = Rf.dc("div");
							toolbar.style.position = "absolute";
							toolbar.style.width = "100px";
							toolbar.style.height = "23px";
							//toolbar.style.backgroundColor = "#DDDDDD";
							toolbar.style.bottom = "0px";
							toolbar.style.right = "-1px";
							//toolbar.innerHTML = "Toolbar";
							bodyToolbarDIV.appendChild(toolbar);
								if(!Rf.empty(this.Response.privileges.news.UPDATE)){
									var checkbox = Rf.dc("input");
									checkbox.type = "checkbox";
									checkbox.style.position = "absolute";
									checkbox.style.top = "2px";
									checkbox.style.border = "0px none #000000";
									checkbox.rfNews = this.rfNews;
									checkbox.newsId = this.Response.news[i].id;
									
									toolbar.appendChild(checkbox);
									var checkboxLabel = Rf.dc("span");
									checkboxLabel.style.position = "absolute";
									checkboxLabel.style.top = "2px";
									checkboxLabel.style.left = "16px";
									checkboxLabel.innerHTML = "aktiv";
									checkboxLabel.style.color = "#CC0000";
									toolbar.appendChild(checkboxLabel);
									
									checkbox.checkboxLabel = checkboxLabel;
									checkbox.onclick = function(){
										if(this.checked == true){
											this.rfNews.changeNewsStatus({
												NewsId: this.newsId,
												Active: "1"
											});
											this.checkboxLabel.style.color = "#000000";
										}
										else{
											this.rfNews.changeNewsStatus({
												NewsId: this.newsId,
												Active: "0"
											});
											this.checkboxLabel.style.color = "#CC0000";
										}
									}
									if(this.Response.news[i].active == "1"){
										checkboxLabel.style.color = "#000000";
										checkbox.setAttribute("checked", "checked");
									}
									
								
									var button = Rf.getIMGButton("images/common/pencil.png");
									button.style.left = "50px";
									button.rfNews = this.rfNews;
									button.rfNewsCurrentNews = this.Response.news[i];
									button.onclick = function(){
										this.rfNews.showNewsEditForm({
											Id: this.rfNewsCurrentNews.id,
											Content: this.rfNewsCurrentNews.content,
											Headline: this.rfNewsCurrentNews.headline,
											Datetime: this.rfNewsCurrentNews.date,
											AuthorId: this.rfNewsCurrentNews.id_user_author,
											ModId: this.rfNewsCurrentNews.id_user_mod,
											Active: this.rfNewsCurrentNews.active,
											Weekday: this.rfNewsCurrentNews.weekday
										});
									};
									toolbar.appendChild(button);
								}
								if(!Rf.empty(this.Response.privileges.news.DELETE)){
									var button = Rf.getIMGButton("images/common/delete2.gif");
									button.style.left = "74px";
									button.rfNews = this.rfNews;
									button.newsId = this.Response.news[i].id;
									button.onclick = function(){
										this.rfNews.deleteNews({
											NewsId: this.newsId
										});
									}
									toolbar.appendChild(button);
								}
						}
				
				var tr = Rf.dc("tr");
				tbody.appendChild(tr);
				var td = Rf.dc("td");
				td.style.height = "20px";
				tr.appendChild(td);
				
			}
			
			if(numOfNewsShown == 0){
				var tr = Rf.dc("tr");
				tbody.appendChild(tr);
				var td = Rf.dc("td");
				td.style.height = "100px";
				td.innerHTML = "Zur Zeit keine News vorhanden.";
				td.style.verticalAlign = "middle";
				td.style.textAlign = "center";
				td.style.fontWeight = "bold";
				tr.appendChild(td);
			}
			*/
			
			
			this.rfNews.SubPartDIVs["Kalender"].innerHTML = "";
			this.rfNews.SubPartDIVs["Kalender"].appendChild(table);
			
		}
	}
	request.onError = function() { alert("b"); } 
	request.onTimeout = function() { alert("c"); } 
	var conn = new Rf.Loading.CConnectHTTPXML({ServiceUrl: "local/modules/News/backend.php"}); 
	conn.sendRequest( request );
}



//cI
Rf.CDates.prototype.showPart = function(aH){
	Rf.Session.setMaxContentWidth(850);
	var cIArray = aH.cI.split("|");
	if(Rf.empty(cIArray[1]) || cIArray[1] == "liste"){
		this.fillListe();
		this.chooseSubMenuItem({Item:"liste"});
		this.show({name:"liste"});
	}
	/*
	else if(cIArray[1] == "kalender"){
		this.fillSatzung();
		this.chooseSubMenuItem({Item:"kalender"});
		this.show({name:"kalender"});
	}
	* */
}
;
//{Rf.CContent} content, divIdSubMenu
Rf.CClub = function(aH){
	
	Rf.CModule.call(this, aH);
	
	this.RfContent = aH.content;
	this.RfAuth = this.RfContent.RfAuth;
	this.DIV = Rf.dcModuleDIV();
	this.RfContent.DIV.appendChild(this.DIV);
	
	this.UserID = this.RfContent.UserID;
	
	this.RegisteredSubMenuItems = {};
	this.SubMenuItemDivs = {};
	this.SubPartDIVs = {};
	
	this.buildSubParts();
	this.createSiteIndicator({ModuleName: "Verein"});
	
	this.RegisteredSubMenuItems["portrait"] = {label:"Portrait"};
	this.RegisteredSubMenuItems["vorstand"] = {label:"Vorstand"};
	this.createSubMenu();
}
Rf.CClub.prototype = new Rf.CModule(false);


Rf.CClub.prototype.buildSubParts = function(){
	this.createVorstand();
	this.createPortrait();
}

Rf.CClub.prototype.createVorstand = function(){
	this.SubPartDIVs["vorstand"] = Rf.dc("div");
	this.DIV.appendChild(this.SubPartDIVs["vorstand"]);
}

Rf.CClub.prototype.createPortrait = function(){
	this.SubPartDIVs["portrait"] = Rf.dc("div");
	this.SubPartDIVs["portrait"].style.display = "none";
	this.DIV.appendChild(this.SubPartDIVs["portrait"]);
}

//page, newsId
Rf.CClub.prototype.fillVorstand = function(aH, force_flag){
	if(this.SubPartDIVs["vorstand"].innerHTML != "" && (typeof force_flag != "boolean" || force_flag != true)){
		return true;
	}
	
	/*
	var table = Rf.dcTable();
	var tbody = Rf.dc("tbody");
	table.appendChild(tbody);
	var tr = Rf.dc("tr");
	tbody.appendChild(tr);
	var td = Rf.dc("td");
	tr.appendChild(td);
	//td.innerHTML = "Hier werden bald Termine zu finden sein.";
	td.style.textAlign = "center";
	td.style.verticalAlign = "middle";
	td.style.fontWeight = "bold";
	td.style.height = "100px";
	var box = new Rf.Dom.RoundBox();
	td.appendChild(box.DIV);
	*/
	
	
	var request = new Rf.Loading.CRequest();
	request.rfNews = this;
	request.Data = {
		username:Rf.Session.rfAuth.username,
		password:Rf.Session.rfAuth.password,
		userId:Rf.Session.rfAuth.userId,
		action:"getVorstand"
	};
	
	request.onSuccess = function() {
		if(!Rf.empty(this.Response.error)){
			Rf.setError(this.Response.error);
		}
		else{/*
			var table = Rf.dcTable();
			var tbody = Rf.dc("tbody");
			table.appendChild(tbody);
			*/
			this.rfNews.SubPartDIVs["vorstand"].innerHTML = "";	
			
			for(var i=0; i<this.Response.vorstand.length; i++){
				var CObj = new Rf.CContentBox({
					Color: "d0c6b0",
					HeaderLeftText: this.Response.vorstand[i].charge_label,
					HeaderRightText: this.Response.vorstand[i].firstname+"&nbsp;"+this.Response.vorstand[i].name
				});
				/*
				var tr = Rf.dc("tr");
				tbody.appendChild(tr);
				var td = Rf.dc("td");
				tr.appendChild(td);
				
				var name = Rf.dc("div");
				name.style.position = "absolute";
				name.style.top = "0px";
				name.style.right = "0px";
				name.innerHTML = this.Response.vorstand[i].firstname+"&nbsp;"+this.Response.vorstand[i].name;
				*/
				var div = Rf.dc("div");
				div.style.position = "relative";
				div.style.top = "0px";
				div.style.left = "0px";
				div.style.height = "152px";
				
					var image = Rf.dc("div");
					image.style.position = "absolute";
					image.style.top = "4px";
					image.style.right = "0px";
					image.style.width = "128px";
					image.style.height = "148px";
					image.innerHTML = "<img src=\""+this.Response.vorstand[i].image+"\" style=\"width:120px;height:140px;border:4px solid #AAAAAA;\" />";
					div.appendChild(image);
					
					var city = Rf.dc("div");
					city.style.position = "relative";
					city.style.top = "0px";
					city.style.right = "0px";
					city.style.height = "20px";
					city.innerHTML = "Wohnort:&nbsp;"+this.Response.vorstand[i].city;
					div.appendChild(city);
				
					var mail = Rf.getIMGButton("images/common/email.png");
					mail.style.position = "absolute";
					mail.style.top = "";
					mail.style.bottom = "4px";
					mail.Person = this.Response.vorstand[i];
					mail.onclick = function(){
						Rf.Session.rfTaube.showTaube({
							to:'person',
							toId:this.Person.id,
							toName:this.Person.firstname+" "+this.Person.name,
							subjectFirst:"TC Kirrberg - Kontakt ("+this.Person.charge_label+"):" + " "
						});
					};
					div.appendChild(mail);
				/*
				var position = Rf.dc("div");
				position.style.position = "absolute";
				position.style.top = "0px";
				position.style.left = "0px";
				position.style.fontStyle = "italic";
				position.innerHTML = this.Response.vorstand[i].charge_label;
				*/
				/*
				var box = new Rf.Dom.RoundBox();
				box.Nodes.Header.appendChild(position);
				box.Nodes.Header.appendChild(name);
				box.Nodes.Content.style.height = "156px";
				box.Nodes.Content.appendChild(city);
				box.Nodes.Content.appendChild(mail);
				box.Nodes.Content.appendChild(image);
				*/
				/*
				td.appendChild(box.DIV);
				
				var tr = Rf.dc("tr");
				tbody.appendChild(tr);
				var td = Rf.dc("td");
				td.style.height = "12px";
				td.style.lineHeight = "1px";
				td.style.fontSize = "1px";
				tr.appendChild(td);
				*/
				CObj.appendContent(div);
				
				this.rfNews.SubPartDIVs["vorstand"].appendChild(CObj.getNode());
			}
			
			
			
			
		}
	}
	request.onError = function() { alert("b"); } 
	request.onTimeout = function() { alert("c"); } 
	var conn = new Rf.Loading.CConnectHTTPXML({ServiceUrl: "local/modules/Club/backend.php"}); 
	conn.sendRequest( request );
}

//page, newsId
Rf.CClub.prototype.fillPortrait = function(aH, force_flag){
	if(this.SubPartDIVs["portrait"].innerHTML != "" && (typeof force_flag != "boolean" || force_flag != true)){
		return true;
	}
	
	var table = Rf.dcTable();
	var tbody = Rf.dc("tbody");
	table.appendChild(tbody);
	var tr = Rf.dc("tr");
	tbody.appendChild(tr);
	var td = Rf.dc("td");
	tr.appendChild(td);
	//td.innerHTML = "Hier wird bald das Vereins-Portrait zu finden sein.";
	td.style.textAlign = "center";
	td.style.verticalAlign = "middle";
	td.style.fontWeight = "bold";
	td.style.height = "100px";

	this.SubPartDIVs["portrait"].innerHTML ="";
	this.SubPartDIVs["portrait"].appendChild(table);
	
	var request = new Rf.Loading.CRequest();
	request.rfNews = this;
	request.Data = {
		username:Rf.Session.rfAuth.username,
		password:Rf.Session.rfAuth.password,
		userId:Rf.Session.rfAuth.userId,
		action:"getPortrait"
	};
	
	request.onSuccess = function() {
		if(!Rf.empty(this.Response.error)){
			Rf.setError(this.Response.error);
		}
		else{
			this.rfNews.SubPartDIVs["portrait"].innerHTML = "";	
			
			for(var i=0; i<this.Response.boxes.length; i++){
				var CObj = new Rf.CContentBox({
					Color: "d0c6b0",
					HeaderLeftText: this.Response.boxes[i].hleft,
					HeaderRightText: this.Response.boxes[i].hright
				});

				var div = Rf.dc("div");
				div.style.position = "relative";
				div.style.top = "0px";
				div.style.left = "0px";
				div.innerHTML = this.Response.boxes[i].content;
				CObj.appendContent(div);
				
				this.rfNews.SubPartDIVs["portrait"].appendChild(CObj.getNode());
			}	
		}
	}
	request.onError = function() { alert("b"); } 
	request.onTimeout = function() { alert("c"); } 
	var conn = new Rf.Loading.CConnectHTTPXML({ServiceUrl: "local/modules/Club/backend.php"}); 
	conn.sendRequest( request );
}

//cI
Rf.CClub.prototype.showPart = function(aH){
	Rf.Session.setMaxContentWidth(850);
	var cIArray = aH.cI.split("|");
	if(Rf.empty(cIArray[1]) || cIArray[1] == "portrait"){
		this.fillPortrait();
		this.chooseSubMenuItem({Item:"portrait"});
		this.show({name:"portrait"});
	}
	else if(cIArray[1] == "vorstand"){
		this.fillVorstand();
		this.chooseSubMenuItem({Item:"vorstand"});
		this.show({name:"vorstand"});
	}
}
;
//{Rf.CContent} content, divIdSubMenu
Rf.CFees = function(aH){
	
	Rf.CModule.call(this, aH);
	
	this.RfContent = aH.content;
	this.RfAuth = this.RfContent.RfAuth;
	this.DIV = Rf.dcModuleDIV();
	this.RfContent.DIV.appendChild(this.DIV);
	
	this.UserID = this.RfContent.UserID;
	
	this.RegisteredSubMenuItems = {};
	this.SubMenuItemDivs = {};
	this.SubPartDIVs = {};
	
	this.buildSubParts();
	this.createSiteIndicator({ModuleName: "Beitr&auml;ge"});
	
	//this.RegisteredSubMenuItems["vorstand"] = {label:"Beitrage"};
	this.createSubMenu();
}
Rf.CFees.prototype = new Rf.CModule(false);


Rf.CFees.prototype.buildSubParts = function(){
	this.createBeitrage();
	//this.createSatzung();
}

Rf.CFees.prototype.createBeitrage = function(){
	this.SubPartDIVs["beitrage"] = Rf.dc("div");
	this.DIV.appendChild(this.SubPartDIVs["beitrage"]);
}


//page, newsId
Rf.CFees.prototype.fillBeitrage = function(aH, force_flag){
	if(this.SubPartDIVs["beitrage"].innerHTML != "" && (typeof force_flag != "boolean" || force_flag != true)){
		return true;
	}
	
	
	var table = Rf.dcTable();
	var tbody = Rf.dc("tbody");
	table.appendChild(tbody);
	var tr = Rf.dc("tr");
	tbody.appendChild(tr);
	var td = Rf.dc("td");
	tr.appendChild(td);
	//td.innerHTML = "Hier werden bald die Beitr&auml;ge einzusehen sein.";
	td.style.textAlign = "center";
	td.style.verticalAlign = "middle";
	td.style.fontWeight = "bold";
	td.style.height = "100px";
	var box = new Rf.Dom.RoundBox();
	td.appendChild(box.DIV);
	
	var request = new Rf.Loading.CRequest();
	request.rfNews = this;
	request.Data = {
		username:Rf.Session.rfAuth.username,
		password:Rf.Session.rfAuth.password,
		userId:Rf.Session.rfAuth.userId,
		action:"getVorstand"
	};
	
	request.onSuccess = function() {
		if(!Rf.empty(this.Response.error)){
			Rf.setError(this.Response.error);
		}
		else{/*
			var table = Rf.dcTable();
			var tbody = Rf.dc("tbody");
			table.appendChild(tbody);
			*/
			this.rfNews.SubPartDIVs["beitrage"].innerHTML = "";	
			
			for(var i=0; i<this.Response.boxes.length; i++){
				var CObj = new Rf.CContentBox({
					Color: "d0c6b0",
					HeaderLeftText: this.Response.boxes[i].hleft,
					HeaderRightText: this.Response.boxes[i].hright
				});
				/*
				var tr = Rf.dc("tr");
				tbody.appendChild(tr);
				var td = Rf.dc("td");
				tr.appendChild(td);
				
				var name = Rf.dc("div");
				name.style.position = "absolute";
				name.style.top = "0px";
				name.style.right = "0px";
				name.innerHTML = this.Response.vorstand[i].firstname+"&nbsp;"+this.Response.vorstand[i].name;
				*/
				var div = Rf.dc("div");
				div.style.position = "relative";
				div.style.top = "0px";
				div.style.left = "0px";
				//div.style.height = "152px";
				/*
					var image = Rf.dc("div");
					image.style.position = "absolute";
					image.style.top = "4px";
					image.style.right = "0px";
					image.style.width = "128px";
					image.style.height = "148px";
					image.innerHTML = "<img src=\""+this.Response.vorstand[i].image+"\" style=\"width:120px;height:140px;border:4px solid #AAAAAA;\" />";
					div.appendChild(image);
					
					var city = Rf.dc("div");
					city.style.position = "relative";
					city.style.top = "0px";
					city.style.right = "0px";
					city.style.height = "20px";
					city.innerHTML = "Wohnort:&nbsp;"+this.Response.vorstand[i].city;
					div.appendChild(city);
				
					var mail = Rf.getIMGButton("images/common/email.png");
					mail.style.position = "absolute";
					mail.style.top = "";
					mail.style.bottom = "4px";
					mail.Person = this.Response.vorstand[i];
					mail.onclick = function(){
						Rf.Session.rfTaube.showTaube({
							to:'person',
							toId:this.Person.id,
							toName:this.Person.firstname+" "+this.Person.name,
							subjectFirst:"TC Kirrberg - Kontakt ("+this.Person.charge_label+"):" + " "
						});
					};
					div.appendChild(mail);
				*/
				div.innerHTML = this.Response.boxes[i].content;
				/*
				var position = Rf.dc("div");
				position.style.position = "absolute";
				position.style.top = "0px";
				position.style.left = "0px";
				position.style.fontStyle = "italic";
				position.innerHTML = this.Response.vorstand[i].charge_label;
				*/
				/*
				var box = new Rf.Dom.RoundBox();
				box.Nodes.Header.appendChild(position);
				box.Nodes.Header.appendChild(name);
				box.Nodes.Content.style.height = "156px";
				box.Nodes.Content.appendChild(city);
				box.Nodes.Content.appendChild(mail);
				box.Nodes.Content.appendChild(image);
				*/
				/*
				td.appendChild(box.DIV);
				
				var tr = Rf.dc("tr");
				tbody.appendChild(tr);
				var td = Rf.dc("td");
				td.style.height = "12px";
				td.style.lineHeight = "1px";
				td.style.fontSize = "1px";
				tr.appendChild(td);
				*/
				CObj.appendContent(div);
				
				this.rfNews.SubPartDIVs["beitrage"].appendChild(CObj.getNode());
			}
			
			
			
			
		}
	}
	request.onError = function() { alert("b"); } 
	request.onTimeout = function() { alert("c"); } 
	var conn = new Rf.Loading.CConnectHTTPXML({ServiceUrl: "local/modules/Fees/backend.php"}); 
	conn.sendRequest( request );
}


//cI
Rf.CFees.prototype.showPart = function(aH){
	Rf.Session.setMaxContentWidth(850);
	var cIArray = aH.cI.split("|");
	if(Rf.empty(cIArray[1]) || cIArray[1] == "beitrage"){
		this.fillBeitrage();
		//this.chooseSubMenuItem({Item:"beitrage"});
		this.show({name:"beitrage"});
	}/*
	else if(cIArray[1] == "satzung"){
		this.fillSatzung();
		this.chooseSubMenuItem({Item:"satzung"});
		this.show({name:"satzung"});
	}*/
};

//{Rf.CContent} content, divIdSubMenu
Rf.CDirections = function(aH){
	
	Rf.CModule.call(this, aH);
	
	this.RfContent = aH.content;
	this.RfAuth = this.RfContent.RfAuth;
	this.DIV = Rf.dcModuleDIV();
	this.RfContent.DIV.appendChild(this.DIV);
	
	this.UserID = this.RfContent.UserID;
	
	this.RegisteredSubMenuItems = {};
	this.SubMenuItemDivs = {};
	this.SubPartDIVs = {};
	
	this.buildSubParts();
	this.createSiteIndicator({ModuleName: "Anfahrt"});
	
	//this.RegisteredSubMenuItems["anfahrt"] = {label:"Vorstand"};
	//this.RegisteredSubMenuItems["satzung"] = {label:"Satzung"};
	this.createSubMenu();
}
Rf.CDirections.prototype = new Rf.CModule(false);

//instanceof Map24.Map
Rf.CDirections.prototype.Map = null;

Rf.CDirections.prototype.StartAlternatives = [];
Rf.CDirections.prototype.StartIndex = null;

Rf.CDirections.prototype.ClubData = null;

Rf.CDirections.prototype.DestAlternatives = [];
Rf.CDirections.prototype.DestIndex = null;

Rf.CDirections.prototype.Route = null;

Rf.CDirections.prototype.ClubTooltipAdded = {};

Rf.CDirections.prototype.buildSubParts = function(){
	this.createAnfahrt();
}

Rf.CDirections.prototype.createAnfahrt = function(){
	this.SubPartDIVs["anfahrt"] = Rf.dc("div");
	this.DIV.appendChild(this.SubPartDIVs["anfahrt"]);
}




//page, newsId
Rf.CDirections.prototype.fillAnfahrt = function(aH, force_flag){
	if(this.SubPartDIVs["anfahrt"].innerHTML != "" && (typeof force_flag != "boolean" || force_flag != true)){
		return true;
	}
	
	//only if we don't have requested the data already
	if(this.ClubData == null){
		var request = new Rf.Loading.CRequest();
		request.rfDirections = this;
		request.Data = {
			username:Rf.Session.rfAuth.username,
			password:Rf.Session.rfAuth.password,
			userId:Rf.Session.rfAuth.userId,
			action:"getClubs"
		};
		
		request.onSuccess = function() {
			if(!Rf.empty(this.Response.error)){
				Rf.setError(this.Response.error);
			}
			else{
				this.rfDirections.ClubData = this.Response;
				this.rfDirections.fillAnfahrt();
			}
		}
		request.onError = function() {  } 
		request.onTimeout = function() {  } 
		var conn = new Rf.Loading.CConnectHTTPXML({ServiceUrl: "local/modules/Directions/backend.php"}); 
		conn.sendRequest( request );
		
		return;
	}
	
	/*
	var table = Rf.dcTable();
	var tbody = Rf.dc("tbody");
	table.appendChild(tbody);
	var tr = Rf.dc("tr");
	tbody.appendChild(tr);
	var td = Rf.dc("td");
	tr.appendChild(td);
	//td.innerHTML = "Hier werden bald Termine zu finden sein.";
	td.style.textAlign = "center";
	td.style.verticalAlign = "middle";
	td.style.fontWeight = "bold";
	td.style.height = "100px";
	var box = new Rf.Dom.RoundBox();
	td.appendChild(box.DIV);
	*/
	this.SubPartDIVs["anfahrt"].innerHTML = "";
	//form box
	var formBox = new Rf.CContentBox({
		Color: "d0c6b0",
		HeaderLeftText: "Route",
		HeaderRightText: ""
	});
	
	var table = Rf.dc("table");
	table.cellpadding = "0";
	table.cellspacing = "0";
	var tb = Rf.dc("tbody");
	table.appendChild(tb);
	var tr = Rf.dc("tr");
	tb.appendChild(tr);
		
		var td = Rf.dc("td");
		td.style.verticalAlign = "middle";
		var text = Rf.dc("span");
		text.innerHTML = "Start:";
		td.appendChild(text);
	tr.appendChild(td);
		
		var td = Rf.dc("td");
		td.style.verticalAlign = "middle";
		this.Nodes["inputFrom"] = Rf.dc("input");
		this.Nodes["inputFrom"].style.width = "140px";
		this.Nodes["inputFrom"].value = "Strasse, PLZ, Ort ..."
		this.Nodes["inputFrom"].onclick = function(){
			this.value = "";
			this.onclick = function(){};
		}
		td.appendChild(this.Nodes["inputFrom"]);
	tr.appendChild(td);
		
		var td = Rf.dc("td");
		td.style.verticalAlign = "middle";
		var text = Rf.dc("span");
		text.innerHTML = "&nbsp;Ziel:";
		td.appendChild(text);
	tr.appendChild(td);
		
		var td = Rf.dc("td");
		td.style.verticalAlign = "middle";
		this.Nodes["selectTo"] = Rf.dc("select");
		this.Nodes["selectTo"].style.width = "200px";
		var i=0;
		var option;
		var address = "";
		var tckId = 0;
		for(i=0; i<this.ClubData.length; i++){
			option = Rf.dc("option");
			option.value = i;
			option.innerHTML = this.ClubData[i].name;
			if(this.ClubData[i].name == "TC 1978 Kirrberg"){
				tckId = i;
			}
			this.Nodes["selectTo"].appendChild(option);
		}
		this.Nodes["selectTo"].rfDirection = this;
		this.Nodes["selectTo"].onchange = function(){
			this.rfDirection.DestIndex = this.value;
			this.rfDirection.centerClub( this.value );
		}
		td.appendChild(this.Nodes["selectTo"]);
		this.Nodes["selectTo"].value = tckId;
		this.DestIndex = tckId;
	tr.appendChild(td);
		
		var td = Rf.dc("td");
		td.innerHTML = "<img src=\"images/common/space.gif\" style=\"width:10px;height:2px;\" />";
	tr.appendChild(td);
		
		var td = Rf.dc("td");
		td.style.verticalAlign = "middle";
		this.Nodes["submitRoute"] = Rf.dc("div");
		//this.Nodes["submitRoute"].style.width = "200px";
		this.Nodes["submitRoute"].className = "button";
		this.Nodes["submitRoute"].innerHTML = "anzeigen";
		this.Nodes["submitRoute"].rfDirection = this;
		this.Nodes["submitRoute"].onclick = function(){
			this.rfDirection.geocode();
		}
		td.appendChild(this.Nodes["submitRoute"]);
	tr.appendChild(td);
		
	formBox.appendContent(table);
	
	
	this.Nodes["chooseStartBox"] = Rf.dc("div");
	this.Nodes["chooseStartBox"].style.display = "none";
	//this.Nodes["chooseStartBox"].innerHTML = "anzeigen";
		var chooseStartLabel = Rf.dc("div");
		chooseStartLabel.style.position = "relative";
		chooseStartLabel.style.top = "0px";
		chooseStartLabel.style.left = "0px";
		chooseStartLabel.style.padding = "13px 3px 3px 3px";
		chooseStartLabel.style.height = "20px";
		chooseStartLabel.innerHTML = "<strong>Startadresse ausw&auml;hlen:</strong>"
		chooseStartLabel.style.color = "#AA0000";
	this.Nodes["chooseStartBox"].appendChild(chooseStartLabel);
		this.Nodes["chooseStartContent"] = Rf.dc("div");
	this.Nodes["chooseStartBox"].appendChild(this.Nodes["chooseStartContent"]);
	
	
	formBox.appendContent(this.Nodes["chooseStartBox"]);
	
	this.SubPartDIVs["anfahrt"].appendChild(formBox.getNode());
	
	//map box
	var mapBox = new Rf.CContentBox({
		Color: "d0c6b0",
		HeaderLeftText: "Karte",
		HeaderRightText: ""
	});
	/*
	var table = Rf.dc("table");
	table.cellpadding = "0";
	table.cellspacing = "0";
	table.style.width = "100%";
	var tb = Rf.dc("tbody");
	table.appendChild(tb);
		var tr = Rf.dc("tr");
		tb.appendChild(tr);
			var tdForm = Rf.dc("td");
			tdForm.style.width = "100%";
			tr.appendChild(tdForm);
			var tdMap = Rf.dc("td");
			tdMap.style.width = "50%";
			tr.appendChild(tdMap);
	*/
	this.Nodes.maparea = Rf.dc("div");
	this.Nodes.maparea.id = "maparea";
	this.Nodes.maparea.style.position = "relative";
	this.Nodes.maparea.style.top = "0px";
	this.Nodes.maparea.style.left = "0px";
	this.Nodes.maparea.style.width = "545px";
	this.Nodes.maparea.style.height = "250px";
	//tdMap.appendChild(this.Nodes.maparea);
	
	mapBox.appendContent(this.Nodes.maparea);
	this.SubPartDIVs["anfahrt"].appendChild(mapBox.getNode());
	
	
	//route desc box
	var descBox = new Rf.CContentBox({
		Color: "d0c6b0",
		HeaderLeftText: "Routenbescheschreibung",
		HeaderRightText: ""
	});
	
	this.Nodes["routeDescContent"] = Rf.dc("div");
	//this.Nodes["routeDescContent"].style.display = "none";
	descBox.appendContent(this.Nodes["routeDescContent"]);
	
	var div = Rf.dc("div");
	descBox.appendContent(div);
	this.SubPartDIVs["anfahrt"].appendChild(descBox.getNode());
	
	return true;
	
	
	var request = new Rf.Loading.CRequest();
	request.rfNews = this;
	request.Data = {
		username:Rf.Session.rfAuth.username,
		password:Rf.Session.rfAuth.password,
		userId:Rf.Session.rfAuth.userId,
		action:"getVorstand"
	};
	
	request.onSuccess = function() {
		if(!Rf.empty(this.Response.error)){
			Rf.setError(this.Response.error);
		}
		else{
			var table = Rf.dcTable();
			var tbody = Rf.dc("tbody");
			table.appendChild(tbody);
			
			for(var i=0; i<this.Response.vorstand.length; i++){
				var tr = Rf.dc("tr");
				tbody.appendChild(tr);
				var td = Rf.dc("td");
				tr.appendChild(td);
				
				var name = Rf.dc("div");
				name.style.position = "absolute";
				name.style.top = "0px";
				name.style.right = "0px";
				name.innerHTML = this.Response.vorstand[i].firstname+"&nbsp;"+this.Response.vorstand[i].name;
				
				var image = Rf.dc("div");
				image.style.position = "absolute";
				image.style.top = "4px";
				image.style.right = "0px";
				image.style.width = "128px";
				image.style.height = "148px";
				image.innerHTML = "<img src=\""+this.Response.vorstand[i].image+"\" style=\"width:120px;height:140px;border:4px solid #AAAAAA;\" />";
				
				var city = Rf.dc("div");
				city.style.position = "relative";
				city.style.top = "0px";
				city.style.right = "0px";
				city.style.height = "20px";
				city.innerHTML = "Wohnort:&nbsp;"+this.Response.vorstand[i].city;
				
				var mail = Rf.getIMGButton("images/common/email.png");
				mail.style.position = "absolute";
				mail.style.top = "";
				mail.style.bottom = "4px";
				mail.Person = this.Response.vorstand[i];
				mail.onclick = function(){
					Rf.Session.rfTaube.showTaube({
						to:'person',
						toId:this.Person.id,
						toName:this.Person.firstname+" "+this.Person.name,
						subjectFirst:"TC Kirrberg - Kontakt ("+this.Person.charge_label+"):" + " "
					});
				};
				
				var position = Rf.dc("div");
				position.style.position = "absolute";
				position.style.top = "0px";
				position.style.left = "0px";
				position.style.fontStyle = "italic";
				position.innerHTML = this.Response.vorstand[i].charge_label;
				
				var box = new Rf.Dom.RoundBox();
				box.Nodes.Header.appendChild(position);
				box.Nodes.Header.appendChild(name);
				box.Nodes.Content.style.height = "156px";
				box.Nodes.Content.appendChild(city);
				box.Nodes.Content.appendChild(mail);
				box.Nodes.Content.appendChild(image);
				
				
				td.appendChild(box.DIV);
				
				var tr = Rf.dc("tr");
				tbody.appendChild(tr);
				var td = Rf.dc("td");
				td.style.height = "12px";
				td.style.lineHeight = "1px";
				td.style.fontSize = "1px";
				tr.appendChild(td);
			}
			
			this.rfNews.SubPartDIVs["anfahrt"].innerHTML = "";
			this.rfNews.SubPartDIVs["anfahrt"].appendChild(table);
			
		}
	}
	request.onError = function() { alert("b"); } 
	request.onTimeout = function() { alert("c"); } 
	var conn = new Rf.Loading.CConnectHTTPXML({ServiceUrl: "local/modules/Club/backend.php"}); 
	conn.sendRequest( request );
}

//cI
Rf.CDirections.prototype.showPart = function(aH){
	Rf.Session.resetMaxContentWidth();
	var cIArray = aH.cI.split("|");
	if(Rf.empty(cIArray[1]) || cIArray[1] == "anfahrt"){
		this.fillAnfahrt();
		//this.chooseSubMenuItem({Item:"anfahrt"});
		this.show({name:"anfahrt"});
	}
	Rf.CDirections.createMap( this.InstanceId );
//	Rf.Loading.loadJScriptFile({URL: "http://api.maptp.map24.com/ajax?appkey=FJXa62809459d8e7ca929f26bc235247X13"});
	
}

Rf.CDirections.prototype.initialMLC = function(){
	this.centerClub( this.Nodes["selectTo"].value );
	/*this.LocalConn.mapletRemoteControl(
		new Map24.WebServices.Message.mapletRemoteControlRequest({
			MapletRemoteControlRequest: new Map24.WebServices.MapletRemoteControlRequest({
				Map24MRC: new Map24.WebServices.Map24MRC({
					Commands: [
						new Map24.WebServices.XMLCommandWrapper({
							SetMapView: new Map24.WebServices.SetMapView({
								Coordinates: [
									new Map24.WebServices.Coordinate({
										Longitude: 347.4111111111133,
										Latitude: 2978.760508474572
										}),
									new Map24.WebServices.Coordinate({
										Longitude: 479.63259259259485,
										Latitude: 2945.1147457627076
										})
								]
							})
						})
					]
				})
			})
		})
	);*/
}

//alternative number
Rf.CDirections.prototype.setStart = function(id){
	this.StartIndex = id;
	if(this.StartIndex != null && this.DestIndex != null){
		this.calculateRoute();
	}
}

Rf.CDirections.prototype.showStartChoose = function(){
	this.Nodes["chooseStartBox"].style.display = "";
	var i=0;
	var k=0;
	var address = null;
	var entry = null;
	var rowContent = "";
	this.Nodes["chooseStartContent"].innerHTML = "";
	for(i=0; i<this.StartAlternatives.length; i++){
		entry = this.StartAlternatives[i];

		entry.Properties = {};
		for(k=0; k<entry.PropertiesMinor.length; k++){
			entry.Properties[entry.PropertiesMinor[k].Key] = entry.PropertiesMinor[k].Value;
		}
		for(k=0; k<entry.PropertiesMajor.length; k++){
			entry.Properties[entry.PropertiesMajor[k].Key] = entry.PropertiesMajor[k].Value;
		}

		address = Rf.dc("div");
		address.style.height = "16px";
		address.style.cursor = "pointer";
		address.style.cursor = "hand";
		address.style.padding = "3px 3px 3px 3px";
		address.rfDirection = this;
		address.alernativeNumber = i;
		address.onmouseover = function(){
			this.style.backgroundColor = "#DDDDDD";
		};
		address.onmouseout = function(){
			this.style.backgroundColor = "";
		};
		address.onclick = function(){
			this.rfDirection.setStart(this.alernativeNumber);
			this.rfDirection.Nodes["chooseStartBox"].style.display = "none";
		}
		
		rowContent = "";
		if(typeof entry.Properties.Name == "string" && entry.Properties.Name != ""){
			rowContent += entry.Properties.Name+": ";
		}
		if(typeof entry.Properties.Street == "string" && entry.Properties.Street != ""){
			rowContent += entry.Properties.Street+", ";
		}
		if(typeof entry.Properties.Zip == "string" && entry.Properties.Zip != ""){
			rowContent += entry.Properties.Zip+" ";
		}
		if(typeof entry.Properties.City == "string" && entry.Properties.City != ""){
			rowContent += entry.Properties.City+" ";
		}
		if(typeof entry.Properties.District == "string" && entry.Properties.District != ""){
			rowContent += "("+entry.Properties.District+")";
		}
		address.innerHTML = rowContent;
		this.Nodes["chooseStartContent"].appendChild(address);
	}
}

Rf.CDirections.prototype.geocode = function(){
	var onSuccess = function(con, req, res) {
		Map24.dump("Geocoding Results");
		//Map24.dump(this);
		//Map24.dump(con);
		//Map24.dump(req);
		//Map24.dump(res);
		var response = this.Response.getProperty("MapSearchResponse");
		response.update(true);
		con.rfDirection.StartAlternatives = response.Alternatives;
		//if(response.Alternatives.length > 1){
			con.rfDirection.showStartChoose();
		//}
		//else{
			//con.rfDirection.setStart(0);
		//}
		//callback( this.Response.getProperty("MapSearchResponse").getProperty("Alternatives"), params, instance_id );
	};
	var onError = function() {Map24.dump(this.Response);};
	var onTimeout = function() {Map24.dump("Timeout");};
	
	this.RemoteConn.searchFree( new Map24.WebServices.Message.searchFreeRequest({
		MapSearchFreeRequest: new Map24.WebServices.MapSearchFreeRequest({
			SearchText: this.Nodes["inputFrom"].value,
			MaxNoOfAlternatives: 10
		})
	}),
	onSuccess,
	onError,
	onTimeout
	);
}

Rf.CDirections.prototype.RouteWindow = null;

Rf.CDirections.prototype.printRoute = function(){
	if(this.RouteWindow != null){
		this.RouteWindow.close();
		this.RouteWindow = null;	
	}
	
	this.RouteWindow = window.open("","RouteWindow","width=680,height=520,scrollbars=yes,resizeable=no,menubar=yes");
	//var page = "<html><head><title>Printview</title></head><body><div id=\"m24_routing_overview\" style=\"width:500px;height:500px;background-color:#E0E0E0;\"></div></body></html>";
	//printWindow.document.write(page);
	
	this.RouteWindow.document.writeln("<html>");
	this.RouteWindow.document.writeln("<head>");
	this.RouteWindow.document.writeln("<title>");
	this.RouteWindow.document.writeln("www.tckirrberg.de");
	this.RouteWindow.document.writeln("</title>");
	this.RouteWindow.document.writeln("</head>");
	this.RouteWindow.document.writeln("<body style=\"margin:0px;padding:0px;font-family:Arial;font-size:9pt;line-height:40px;\">");
	//this.RouteWindow.document.writeln("<div style=\"position:absolute; top:5px; right:5px; cursor:pointer; cursor:hand; font-family:Arial; font-size:12px; padding: 2px; border:1px solid #000000;\" onclick=\"window.print();\">drucken</div>");
	//this.RouteWindow.document.writeln("<a href=\"javascript:window.print()\">drucken</a>");
	this.RouteWindow.document.writeln("<div id=\"routediv\" style=\"width:642px;font-size:9px;line-height:40px;\"></div>");
	this.RouteWindow.document.writeln("<div style=\"height:20px;\"></div>");
	this.RouteWindow.document.writeln("<div id=\"destview\" style=\"width:642px;height:480px;\"></div>");
	this.RouteWindow.document.writeln("</body>");
	this.RouteWindow.document.writeln("</html>");
	/*
	var mapview = new Map24.MapView(
		new Map24.Coordinate({
			Longitude: this.Route.Destination.Longitude,
			Latitude: this.Route.Destination.Latitude
		}),
		new Map24.Coordinate({
			Longitude: this.Route.Segments[(this.Route.Segments.length-1)].Start.Longitude,
			Latitude: this.Route.Segments[(this.Route.Segments.length-1)].Start.Latitude
		})
	);
	*/ 
	var mapview = new Map24.MapView(
		new Map24.Coordinate({
			Longitude: this.Route.Destination.Longitude,
			Latitude: (this.Route.Destination.Latitude+0.5)
		}),
		new Map24.Coordinate({
			Longitude: this.Route.Destination.Longitude,
			Latitude: (this.Route.Destination.Latitude-0.5)
		})
	);

	this.Map.paintMapImage( this.RouteWindow.document, "destview", mapview, 642, 480  );

	this.RouteWindow.document.getElementById("routediv").innerHTML = this.writeRouteDescription("print");
	
	this.RouteWindow.print();
}

//type == print|page
Rf.CDirections.prototype.writeRouteDescription = function(type){
	var node = null
	if(type == "page"){
		this.Nodes["routeDescContent"].innerHTML = "";
		node = this.Nodes["routeDescContent"];
	}
	else{
		var printC = Rf.dc("div");
		node = printC;
	}

	//route summary
	var routeHeader = Rf.dc("table");
		var tbody = Rf.dc("tbody");
			//start
			var tr = Rf.dc("tr");
			var td = Rf.dc("td");
			td.innerHTML = "<img src=\"images/route_start.png\" style=\"width:24px;height:25px\" />";
			tr.appendChild(td);
			var td = Rf.dc("td");
			td.innerHTML = "<img src=\"images/space.gif\" style=\"width:10px;height:1px\" />";
			tr.appendChild(td);
			var td = Rf.dc("td");
			td.style.width = "100%";
			if(type == "print"){td.style.fontSize = "12px";}
			var tdC = "";
			var startLoc = this.StartAlternatives[this.StartIndex];
			if(typeof startLoc.Properties.Name == "string" && startLoc.Properties.Name != ""){
				tdC += startLoc.Properties.Name+": ";
			}
			if(typeof startLoc.Properties.Street == "string" && startLoc.Properties.Street != ""){
				tdC += startLoc.Properties.Street+", ";
			}
			if(typeof startLoc.Properties.Zip == "string" && startLoc.Properties.Zip != ""){
				tdC += startLoc.Properties.Zip+" ";
			}
			if(typeof startLoc.Properties.City == "string" && startLoc.Properties.City != ""){
				tdC += startLoc.Properties.City+" ";
			}
			if(typeof startLoc.Properties.District == "string" && startLoc.Properties.District != ""){
				tdC += "("+startLoc.Properties.District+")";
			}
			td.innerHTML = tdC;
			tr.appendChild(td);
			var td = Rf.dc("td");
				if(type == "page"){
					var printB = Rf.dc("div");
					printB.className = "button";
					printB.innerHTML = "drucken";
					printB.rfDirection = this;
					printB.onclick = function(){
						this.rfDirection.printRoute();
					}
					td.appendChild(printB);
				}
				else if(1==2){
					var printB = Rf.dc("div");
					printB.innerHTML = "drucken";
					printB.style.fontWeight = "bold";
					printB.style.border = "1px solid #000000";
					printB.style.padding = "2px";
					printB.style.cursor = "pointer";
					printB.style.cursor = "hand";
					printB.style.fontSize = "12px";
					printB.rfDirection = this;
					printB.onclick = function(){
						alert("test");
						window.print();
					}
					td.appendChild(printB);
				}
			tr.appendChild(td);
		tbody.appendChild(tr);
		
		//dest
		var tr = Rf.dc("tr");
			var td = Rf.dc("td");
			td.innerHTML = "<img src=\"images/route_dest.png\" style=\"width:24px;height:25px\" />";
			tr.appendChild(td);
			var td = Rf.dc("td");
			tr.appendChild(td);
			var td = Rf.dc("td");
			td.style.width = "100%";
			if(type == "print"){td.style.fontSize = "12px";}
			var tdC = "";
			var destLoc = this.ClubData[this.DestIndex];
			if(typeof destLoc.name == "string" && destLoc.name != ""){
				tdC += "<strong>"+destLoc.name+":</strong> ";
			}
			var streetFlag=false;
			if(typeof destLoc.street == "string" && destLoc.street != ""){
				streetFlag=true;
				tdC += destLoc.street;
			}
			if(typeof destLoc.housenumber == "string" && destLoc.housenumber != "" && streetFlag==true){
				tdC += " "+destLoc.housenumber;
			}
			if(streetFlag==true){
				tdC += ", ";
			}
			if(typeof destLoc.zip == "string" && destLoc.zip != ""){
				tdC += destLoc.zip+" ";
			}
			if(typeof destLoc.city == "string" && destLoc.city != ""){
				tdC += destLoc.city;
			}
			td.innerHTML = tdC;
			tr.appendChild(td);
			var td = Rf.dc("td");
			tr.appendChild(td);
		tbody.appendChild(tr);

		//total time
		var totalTime = Rf.getHumanTime(this.Route.TotalTime);
		var tr = Rf.dc("tr");
			var td = Rf.dc("td");
			tr.appendChild(td);
			var td = Rf.dc("td");
			tr.appendChild(td);
			var td = Rf.dc("td");
			td.style.verticalAlign = "top";
			td.style.padding = "2px 0px 2px 0px";
			td.style.lineHeight = "14px";
			if(type == "print"){td.style.fontSize = "12px";}
			td.innerHTML = "Fahrtzeit: "+totalTime;
			tr.appendChild(td);
			var td = Rf.dc("td");
			tr.appendChild(td);
		tbody.appendChild(tr);

		//total length
		var totalLength = Rf.getHumanDistance(this.Route.TotalLength);
		var tr = Rf.dc("tr");
			var td = Rf.dc("td");
			tr.appendChild(td);
			var td = Rf.dc("td");
			tr.appendChild(td);
			var td = Rf.dc("td");
			td.style.verticalAlign = "top";
			td.style.padding = "2px 0px 2px 0px";
			td.style.lineHeight = "14px";
			if(type == "print"){td.style.fontSize = "12px";}
			td.innerHTML = "Entfernung: "+totalLength;
			tr.appendChild(td);
			var td = Rf.dc("td");
			tr.appendChild(td);
		tbody.appendChild(tr);
	
	routeHeader.appendChild(tbody);

	node.appendChild(routeHeader);

	var spaceDiv = Rf.dc("div");
	spaceDiv.style.height = "10px";
	node.appendChild(spaceDiv);
	
	var routeMain = Rf.dc("table");
		var tbody = new Rf.dc("tbody");
		
		var routeSegments = this.Route.Segments;
		var i=0;
		var k=0;
		var stepTime = 0;
		var stepDistance = 0;
		for(i=0; i<routeSegments.length; i++){
			var tr = Rf.dc("tr");
				var td = Rf.dc("td");
				td.style.verticalAlign = "top";
				td.style.padding = "2px 4px 2px 0px";
				td.style.lineHeight = "14px";
				if(type == "print"){td.style.fontSize = "12px";}
				td.innerHTML = (i+1);
				tr.appendChild(td);
				var td = Rf.dc("td");
				td.style.verticalAlign = "top";
				td.style.padding = "2px 4px 2px 4px";
				td.style.lineHeight = "14px";
				if(type == "print"){td.style.fontSize = "12px";}
				td.style.width = "100%";
				for(k=0; k<routeSegments[i].Descriptions.length; k++){
					Map24.dump(routeSegments[i].Descriptions[k]);
					td.innerHTML = routeSegments[i].Descriptions[k].Text.replace(/(\[|\[\/)[0-9A-Z_]+\]/g, '' ) + "</br>";
				}
				tr.appendChild(td);
				var td = Rf.dc("td");
				td.style.verticalAlign = "top";
				td.style.padding = "2px 4px 2px 4px";
				td.style.lineHeight = "14px";
				if(type == "print"){td.style.fontSize = "12px";}
				if(typeof routeSegments[i].City == "string" && routeSegments[i].City != ""){
					td.innerHTML = routeSegments[i].City;
				}
				tr.appendChild(td);
				var td = Rf.dc("td");
				td.style.verticalAlign = "top";
				td.style.padding = "2px 0px 2px 4px";
				td.style.lineHeight = "14px";
				if(type == "print"){td.style.fontSize = "12px";}
				td.style.whiteSpace = "nowrap";
				if(i>0){
					td.innerHTML = Rf.getHumanTime(stepTime)+"<br/>";
					td.innerHTML += Rf.getHumanDistance(stepDistance)+"";
				}
				tr.appendChild(td);
			tbody.appendChild(tr);
				
			stepTime += routeSegments[i].Time;
			stepDistance += routeSegments[i].SegmentLength;
		}
		routeMain.appendChild(tbody);
	
	node.appendChild(routeMain);
	return node.innerHTML;
}

Rf.CDirections.prototype.calculateRoute = function(){
	var onSuccess = function(con, req, res) {
		
		var route = this.Response.getProperty("CalculateRouteResponse").getProperty("Route");
		route.update( true );
		con.rfDirection.Route = route;
		
		
		con.rfDirection.LocalConn.onSuccess = function(){}
		con.rfDirection.LocalConn.mapletRemoteControl(
		new Map24.WebServices.Message.mapletRemoteControlRequest({
			MapletRemoteControlRequest: new Map24.WebServices.MapletRemoteControlRequest({
				Map24MRC: new Map24.WebServices.Map24MRC({
					Commands: [
						new Map24.WebServices.XMLCommandWrapper({
							DeclareMap24RouteObject: new Map24.WebServices.DeclareMap24RouteObject({
								//MapObjectID: route.RouteID,
								MapObjectID: "tckroute",
								Map24RouteID: route.RouteID/*,
								Customize: new Map24.WebServices.MapObjectCustomSettings({
									Handler: "MAP24_ROUTE_DIGITIZER",
									// On submit a javascript function can be called.
									Properties: [
									
										new Map24.WebServices.Property({
											Key: "SUBMIT_URL",
											Value: "javascript:alert('test')"
										})
										
									]
								})*/
							})
						}),
						new Map24.WebServices.XMLCommandWrapper({
							ControlMapObject: new Map24.WebServices.ControlMapObject({
								//MapObjectIDs: [route.RouteID],
								MapObjectIDs: ["tckroute"],
								Control: "ENABLE"
							})
						}),
						new Map24.WebServices.XMLCommandWrapper({
							SetMapView: new Map24.WebServices.SetMapView({
								//MapObjectIDs: [route.RouteID],
								MapObjectIDs: ["tckroute"],
								ClippingWidth: new Map24.WebServices.SetMapViewClippingWidth({
									ViewPercentage: 100
								})
							})
						})
					]
				})
			})
		})
	);
	
	var cmds = [];
		cmds[cmds.length] = new Map24.WebServices.XMLCommandWrapper({
			DeclareMap24Location: new Map24.WebServices.DeclareMap24Location({
				MapObjectID: "routeStart",
				Coordinate: new Map24.WebServices.Coordinate({
					Longitude: route.Start.Longitude,
					Latitude: route.Start.Latitude
				}),
				LogoURL: "http://www.tckirrberg.de/images/route_start.png#hotspot=1,24"
			})
		});
		cmds[cmds.length] = new Map24.WebServices.XMLCommandWrapper({
			DeclareMap24Location: new Map24.WebServices.DeclareMap24Location({
				MapObjectID: "routeDest",
				Coordinate: new Map24.WebServices.Coordinate({
					Longitude: route.Destination.Longitude,
					Latitude: route.Destination.Latitude
				}),
				LogoURL: "http://www.tckirrberg.de/images/route_dest.png#hotspot=1,24"
			})
		});
		cmds[cmds.length] = new Map24.WebServices.XMLCommandWrapper({
			ControlMapObject: new Map24.WebServices.ControlMapObject({
				MapObjectIDs: ["routeStart", "routeDest"],
				Control: "ENABLE"
			})
		});
		con.rfDirection.RemoteConn.mapletRemoteControl(new Map24.WebServices.Message.mapletRemoteControlRequest({
			MapletRemoteControlRequest: new Map24.WebServices.MapletRemoteControlRequest({
				Map24MRC: new Map24.WebServices.Map24MRC({
					Commands: cmds
				})
			})
		}));

	con.rfDirection.writeRouteDescription("page");

	};

	this.RemoteConn.calculateRoute( new Map24.WebServices.Message.calculateRouteRequest({
			CalculateRouteRequest: new Map24.WebServices.CalculateRouteRequest({
				Start: new Map24.WebServices.CoordinateAndAddress({
					Coordinate: new Map24.WebServices.Coordinate({
 						Longitude: this.StartAlternatives[this.StartIndex].Coordinate.Longitude,
						Latitude: this.StartAlternatives[this.StartIndex].Coordinate.Latitude
					})
				}),
				Destination: new Map24.WebServices.CoordinateAndAddress({
					Coordinate: new Map24.WebServices.Coordinate({
						Longitude: this.ClubData[this.DestIndex].longitude,
						Latitude: this.ClubData[this.DestIndex].latitude
					})
				})
			})
		}),
		onSuccess
	);
}

Rf.CDirections.prototype.centerClub = function( index ){
	if(this.ClubData[index].longitude == null || this.ClubData[index].latitude == null){
		return false;
	}
	
	this.LocalConn.mapletRemoteControl(
		new Map24.WebServices.Message.mapletRemoteControlRequest({
			MapletRemoteControlRequest: new Map24.WebServices.MapletRemoteControlRequest({
				Map24MRC: new Map24.WebServices.Map24MRC({
					Commands: [
						new Map24.WebServices.XMLCommandWrapper({
							SetMapView: new Map24.WebServices.SetMapView({
								Coordinates: [
									new Map24.WebServices.Coordinate({
										Longitude: this.ClubData[index].longitude,
										Latitude: this.ClubData[index].latitude
									})
								],
								ClippingWidth: new Map24.WebServices.SetMapViewClippingWidth({
									MinimumWidth: 4000
								})
							})
						})
					]
				})
			})
		})
	);
}

Rf.CDirections.prototype.addClubLocations = function(){
	var cmds = [];
	var i = 0;
	var logoURL = "";
	var mobids = [];
	
	for(i=0; i<this.ClubData.length; i++){
		if(this.ClubData[i].longitude == null || this.ClubData[i].latitude == null){
			continue;
		}
		logoURL = "http://tckirrberg.de/images/common/sport_tennis1.gif";
		//id = 7 = tck
		if(this.ClubData[i].id == 7){
			logoURL = "http://tckirrberg.de/images/common/tennisball_red.gif";
		}
		cmds[cmds.length] = new Map24.WebServices.XMLCommandWrapper({
			DeclareMap24Location: new Map24.WebServices.DeclareMap24Location({
				MapObjectID: "club"+i,
				Coordinate: new Map24.WebServices.Coordinate({
					Longitude: this.ClubData[i].longitude,
					Latitude: this.ClubData[i].latitude }),
				LogoURL: logoURL,
				MaxLogoSizeInMeters: 7500,
				Events: [
					new Map24.WebServices.MapObjectEvent({
						ID: "OnMouseOver",
						Commands: [
							new Map24.WebServices.XMLCommandWrapper({
								Surf: new Map24.WebServices.Surf({
									URL: "javascript:Rf.CDirections.showClubTooltip("+this.InstanceId+", "+i+")",
									TargetFrame: "_self"
								})
							})
						]
					}),
					new Map24.WebServices.MapObjectEvent({
						ID: "OnMouseOut",
						Commands: [
							new Map24.WebServices.XMLCommandWrapper({
								Surf: new Map24.WebServices.Surf({
									URL: "javascript:Rf.CDirections.hideClubTooltip("+this.InstanceId+", "+i+")",
									TargetFrame: "_self"
								})
							})
						]
					})
				]
			})
		});
		mobids[mobids.length] = "club"+i;
	}
	
	cmds[cmds.length] = new Map24.WebServices.XMLCommandWrapper({
		ControlMapObject: new Map24.WebServices.ControlMapObject({
			MapObjectIDs: mobids,
			Control: "ENABLE"
		})
	});
	
	this.LocalConn.mapletRemoteControl(
		new Map24.WebServices.Message.mapletRemoteControlRequest({
			MapletRemoteControlRequest: new Map24.WebServices.MapletRemoteControlRequest({
				Map24MRC: new Map24.WebServices.Map24MRC({
					Commands: cmds
				})
			})
		})
	);
}

Rf.CDirections.goMap24 = function(){
    //Load core API and wrapper classes
   //
    Map24.loadApi( ["core_api", "wrapper_api"] , Rf.CDirections.map24ApiLoaded );
}

Rf.CDirections.prototype.MapCreated = false;
  //If function name was defined in the loadApi() function,  
  //this function is called when the API was loaded
Rf.CDirections.createMap = function( instance_id ){
	var direction = Rf.CModule.Instances[instance_id];
    //if the map has already been created
    if(direction.MapCreated == true){
    	return true;
    }
    //if API loading hasn't been finished
    else if(Rf.Map24ApiLoaded == false || !document.getElementById("maparea")){
    	setTimeout("Rf.CDirections.createMap("+direction.InstanceId+");", 1000);
    	return true;
    }
    //if all is ok, paint the map
    else{
    	direction.MapCreated = true;
   		direction.Map = new Map24.Map();
		
		var mapClickHandler = function(e){
			if( e.TopDown ) return true;
		}
		direction.Map.addListener( "Map24.Event.MapClick", [direction.Map, mapClickHandler] );
		
		direction.LocalConn = direction.Map.Local.openConnection();
		direction.LocalConn.onSuccess = function(connection, request, response){}
		direction.LocalConn.rfDirection = direction;
		direction.RemoteConn = direction.Map.WebServices.openConnection();
		direction.RemoteConn.onSuccess = function(connection, request, response){}
		direction.RemoteConn.rfDirection = direction;
		
		direction.Map.addCanvas( new Map24.Canvas( { NodeName: "maparea" } ), "c" );
		direction.Map.addMapClient( new Map24.MapClient.Static({}), "Static" );
		
		direction.addClubLocations();
		direction.initialMLC();	
		
		direction.Map.onMapClientReady = function( e ) {
			if( e.MapClient.Class == "Applet") {
				setTimeout("Rf.CDirections.refreshFocus('"+direction.InstanceId+"')",10);
				
				direction.Map.show( "Applet", "c" );
				setTimeout("Rf.CDirections.refreshFocus('"+direction.InstanceId+"')",100);
				direction.initialMLC();
				direction.Map.onMapClientReady = null;
				//enable_java_only_fields();
				
			}
		}
		

		// add new default data provider
		//map.addDataProvider( new Map24.DataProvider.Map24DMapDataService(), "dmapservice" );
	
		direction.Map.show( "Static", "c" );
//commented out f.. applet because of performance leaks
//setTimeout("Rf.CDirections.loadApplet("+direction.InstanceId+")", 2000);
		//demo.initialMLC();
    }
}

Rf.CDirections.loadApplet = function( instance_id ){
	var direction = Rf.CModule.Instances[instance_id];
	direction.Map.addMapClient( new Map24.MapClient.Applet( {} ), "Applet" );
}

Rf.CDirections.showClubTooltip = function( instance_id, obj_id ){
	var direction = Rf.CModule.Instances[instance_id];
	var cmds = [];

	if(typeof direction.ClubTooltipAdded[obj_id] == "undefined"){
		direction.ClubTooltipAdded[obj_id] = true;
		
		var html_content = "";
		html_content += "<b>"+direction.ClubData[obj_id].name+"</b><br/>";
		if(direction.ClubData[obj_id].street != null){
			html_content += direction.ClubData[obj_id].street;
			if(direction.ClubData[obj_id].housenumber != null){
				html_content += " "+direction.ClubData[obj_id].housenumber;
			}
			html_content += "<br/>";
		}
		if(direction.ClubData[obj_id].zip != null){
			html_content += direction.ClubData[obj_id].zip;
		}
		if(direction.ClubData[obj_id].city != null){
			html_content += " "+direction.ClubData[obj_id].city;
		}
		
		var html_border = '<div font-family="Arial" style="width:180px; height:58px; overflow:hidden; padding:5px; margin:0px; border:1px solid black;background-color:#ffffff; nose-offset:1px; nose-width:1px;nose-color:#000000;nose-background-color:#ffffff;">'+html_content+'</div>';
	
		
		cmds[cmds.length] = new Map24.WebServices.XMLCommandWrapper({
			DeclareMap24HTMLObject: new Map24.WebServices.DeclareMap24HTMLObject({
				MapObjectID: "clubtooltip"+obj_id,
				Coordinate: new Map24.WebServices.Coordinate({
					Longitude: direction.ClubData[obj_id].longitude,
					Latitude: direction.ClubData[obj_id].latitude
				}),
				HTML: html_border,
				Orientation: new Map24.WebServices.MapObjectOrientation({
					Vertical:'TOP',
					Horizontal:'RIGHT',
					HOffset:-20,
					VOffset:-30
				}),
				Customize: new Map24.WebServices.MapObjectCustomSettings({
					Properties: [
						new Map24.WebServices.Property({
							Key: "NOSE" ,Value: "50"
						}),
						new Map24.WebServices.Property({
							Key: "STAY_IN_VIEW" ,Value: "20"
						})
					]
				})
			})
		});
	}
	
	cmds[cmds.length] = new Map24.WebServices.XMLCommandWrapper({
		ControlMapObject: new Map24.WebServices.ControlMapObject({
			MapObjectIDs: ["clubtooltip"+obj_id],
			Control: "ENABLE"
		})
	});
	
	direction.LocalConn.mapletRemoteControl(
		new Map24.WebServices.Message.mapletRemoteControlRequest({
			MapletRemoteControlRequest: new Map24.WebServices.MapletRemoteControlRequest({
				Map24MRC: new Map24.WebServices.Map24MRC({
					Commands: cmds
				})
			})
		})
	);
}

Rf.CDirections.hideClubTooltip = function( instance_id, obj_id ){
	var direction = Rf.CModule.Instances[instance_id];
	var cmds = [];
	
	cmds[cmds.length] = new Map24.WebServices.XMLCommandWrapper({
		ControlMapObject: new Map24.WebServices.ControlMapObject({
			MapObjectIDs: ["clubtooltip"+obj_id],
			Control: "DISABLE"
		})
	});
	
	direction.LocalConn.mapletRemoteControl(
		new Map24.WebServices.Message.mapletRemoteControlRequest({
			MapletRemoteControlRequest: new Map24.WebServices.MapletRemoteControlRequest({
				Map24MRC: new Map24.WebServices.Map24MRC({
					Commands: cmds
				})
			})
		})
	);
};

Rf.CDirections.refreshFocus = function( instance_id ){
	var direction = Rf.CModule.Instances[instance_id];
	direction.Nodes["selectTo"].focus();
	direction.Nodes["inputFrom"].focus();
};//{Rf.CContent} content, divIdSubMenu
Rf.CImpressum = function(aH){
	
	Rf.CModule.call(this, aH);
	
	this.RfContent = aH.content;
	this.RfAuth = this.RfContent.RfAuth;
	this.DIV = Rf.dcModuleDIV();
	this.RfContent.DIV.appendChild(this.DIV);
	
	this.UserID = this.RfContent.UserID;
	
	this.RegisteredSubMenuItems = {};
	this.SubMenuItemDivs = {};
	this.SubPartDIVs = {};
	
	
	
	this.buildSubParts();
	this.createSiteIndicator({ModuleName: "Impressum"});
	
	//this.RegisteredSubMenuItems["liste"] = {label:"Liste"};
	
	this.createSubMenu();
}
Rf.CImpressum.prototype = new Rf.CModule(false);


Rf.CImpressum.prototype.buildSubParts = function(){
	this.createImpressum();
}

Rf.CImpressum.prototype.createImpressum = function(){
	this.SubPartDIVs["impressum"] = Rf.dc("div");
	this.DIV.appendChild(this.SubPartDIVs["impressum"]);
}



Rf.CImpressum.prototype.fillImpressum = function(aH, force_flag){
	if(typeof aH == "undefined"){
		aH = {};
	}
	if(this.SubPartDIVs["impressum"].innerHTML != "" && (typeof force_flag != "boolean" || force_flag != true)){
		return true;
	}
	
	var request = new Rf.Loading.CRequest();
	request.rfImpressum = this;
	request.Data = {
		username:Rf.Session.rfAuth.username,
		password:Rf.Session.rfAuth.password,
		userId:Rf.Session.rfAuth.userId,
		action:"getData"
	};
	
	request.onSuccess = function() {
		if(!Rf.empty(this.Response.error)){
			Rf.setError(this.Response.error);
		}
		else{
			var impObj = new Rf.CContentBox({
				Color: "d0c6b0",
				HeaderLeftText: "Impressum",
				HeaderRightText: ""
			});
			
			var d = Rf.dc("div");
			d.style.lineHeight = "18px";
			d.innerHTML = this.Response.data;
			impObj.appendContent(d);
			
			this.rfImpressum.SubPartDIVs.impressum.appendChild(impObj.getNode());
		}
	}
	request.onError = function() {  } 
	request.onTimeout = function() {  } 
	var conn = new Rf.Loading.CConnectHTTPXML({ServiceUrl: "local/modules/Impressum/backend.php"}); 
	conn.sendRequest( request );
}


//cI
Rf.CImpressum.prototype.showPart = function(aH){
	Rf.Session.setMaxContentWidth(850);
	var cIArray = aH.cI.split("|");
	if(Rf.empty(cIArray[1]) || cIArray[1] == "liste"){
		this.fillImpressum();
		//this.chooseSubMenuItem({Item:"impressum"});
		this.show({name:"impressum"});
	}
	/*
	else if(cIArray[1] == "kalender"){
		this.fillSatzung();
		this.chooseSubMenuItem({Item:"kalender"});
		this.show({name:"kalender"});
	}
	* */
};
//MooTools, My Object Oriented Javascript Tools. Copyright (c) 2006-2007 Valerio Proietti, <http://mad4milk.net>, MIT Style License.

var MooTools={version:"1.2dev",build:"1555"};var Native=function(J){J=J||{};var F=J.afterImplement||function(){};var G=J.generics;G=(G!==false);var H=J.legacy;var E=J.initialize;var B=J.protect;var A=J.name;var C=E||H;C.constructor=Native;C.$family={name:"native"};if(H&&E){C.prototype=H.prototype}C.prototype.constructor=C;if(A){var D=A.toLowerCase();C.prototype.$family={name:D};Native.typize(C,D)}var I=function(M,K,N,L){if(!B||L||!M.prototype[K]){M.prototype[K]=N}if(G){Native.genericize(M,K,B)}F.call(M,K,N);return M};C.implement=function(L,K,N){if(typeof L=="string"){return I(this,L,K,N)}for(var M in L){I(this,M,L[M],K)}return this};C.alias=function(M,K,N){if(typeof M=="string"){M=this.prototype[M];if(M){I(this,K,M,N)}}else{for(var L in M){this.alias(L,M[L],K)}}return this};return C};Native.implement=function(D,C){for(var B=0,A=D.length;B<A;B++){D[B].implement(C)}};Native.genericize=function(B,C,A){if((!A||!B[C])&&typeof B.prototype[C]=="function"){B[C]=function(){var D=Array.prototype.slice.call(arguments);return B.prototype[C].apply(D.shift(),D)}}};Native.typize=function(A,B){if(!A.type){A.type=function(C){return($type(C)===B)}}};Native.alias=function(E,B,A,F){for(var D=0,C=E.length;D<C;D++){E[D].alias(B,A,F)}};(function(B){for(var A in B){Native.typize(B[A],A)}})({"boolean":Boolean,"native":Native,object:Object});(function(B){for(var A in B){new Native({name:A,initialize:B[A],protect:true})}})({String:String,Function:Function,Number:Number,Array:Array,RegExp:RegExp,Date:Date});(function(B,A){for(var C=A.length;C--;C){Native.genericize(B,A[C],true)}return arguments.callee})(Array,["pop","push","reverse","shift","sort","splice","unshift","concat","join","slice","toString","valueOf","indexOf","lastIndexOf"])(String,["charAt","charCodeAt","concat","indexOf","lastIndexOf","match","replace","search","slice","split","substr","substring","toLowerCase","toUpperCase","valueOf"]);function $chk(A){return !!(A||A===0)}function $clear(A){clearTimeout(A);clearInterval(A);return null}function $defined(A){return(A!=undefined)}function $empty(){}function $arguments(A){return function(){return arguments[A]}}function $lambda(A){return(typeof A=="function")?A:function(){return A}}function $extend(C,A){for(var B in (A||{})){C[B]=A[B]}return C}function $unlink(C){var B;switch($type(C)){case"object":B={};for(var E in C){B[E]=$unlink(C[E])}break;case"hash":B=$unlink(C.getClean());break;case"array":B=[];for(var D=0,A=C.length;D<A;D++){B[D]=$unlink(C[D])}break;default:return C}return B}function $merge(){var E={};for(var D=0,A=arguments.length;D<A;D++){var B=arguments[D];if($type(B)!="object"){continue}for(var C in B){var G=B[C],F=E[C];E[C]=(F&&$type(G)=="object"&&$type(F)=="object")?$merge(F,G):$unlink(G)}}return E}function $pick(){for(var B=0,A=arguments.length;B<A;B++){if(arguments[B]!=undefined){return arguments[B]}}return null}function $random(B,A){return Math.floor(Math.random()*(A-B+1)+B)}function $splat(B){var A=$type(B);return(A)?((A!="array"&&A!="arguments")?[B]:B):[]}var $time=Date.now||function(){return new Date().getTime()};function $try(){for(var B=0,A=arguments.length;B<A;B++){try{return arguments[B]()}catch(C){}}return null}function $type(A){if(A==undefined){return false}if(A.$family){return(A.$family.name=="number"&&!isFinite(A))?false:A.$family.name}if(A.nodeName){switch(A.nodeType){case 1:return"element";case 3:return(/\S/).test(A.nodeValue)?"textnode":"whitespace"}}else{if(typeof A.length=="number"){if(A.callee){return"arguments"}else{if(A.item){return"collection"}}}}return typeof A}var Hash=new Native({name:"Hash",initialize:function(A){if($type(A)=="hash"){A=$unlink(A.getClean())}for(var B in A){this[B]=A[B]}return this}});Hash.implement({getLength:function(){var B=0;for(var A in this){if(this.hasOwnProperty(A)){B++}}return B},forEach:function(B,C){for(var A in this){if(this.hasOwnProperty(A)){B.call(C,this[A],A,this)}}},getClean:function(){var B={};for(var A in this){if(this.hasOwnProperty(A)){B[A]=this[A]}}return B}});Hash.alias("forEach","each");function $H(A){return new Hash(A)}Array.implement({forEach:function(C,D){for(var B=0,A=this.length;B<A;B++){C.call(D,this[B],B,this)}}});Array.alias("forEach","each");function $A(C){if(C.item){var D=[];for(var B=0,A=C.length;B<A;B++){D[B]=C[B]}return D}return Array.prototype.slice.call(C)}function $each(C,B,D){var A=$type(C);((A=="arguments"||A=="collection"||A=="array")?Array:Hash).each(C,B,D)}var Browser=new Hash({Engine:{name:"unknown",version:""},Platform:{name:(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase()},Features:{xpath:!!(document.evaluate),air:!!(window.runtime)},Plugins:{}});if(window.opera){Browser.Engine={name:"presto",version:(document.getElementsByClassName)?950:925}}else{if(window.ActiveXObject){Browser.Engine={name:"trident",version:(window.XMLHttpRequest)?5:4}}else{if(!navigator.taintEnabled){Browser.Engine={name:"webkit",version:(Browser.Features.xpath)?420:419}}else{if(document.getBoxObjectFor!=null){Browser.Engine={name:"gecko",version:(document.getElementsByClassName)?19:18}}}}}Browser.Engine[Browser.Engine.name]=Browser.Engine[Browser.Engine.name+Browser.Engine.version]=true;if(window.orientation!=undefined){Browser.Platform.name="ipod"}Browser.Platform[Browser.Platform.name]=true;Browser.Request=function(){return $try(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("MSXML2.XMLHTTP")})};Browser.Features.xhr=!!(Browser.Request());Browser.Plugins.Flash=(function(){var A=($try(function(){return navigator.plugins["Shockwave Flash"].description},function(){return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")})||"0 r0").match(/\d+/g);return{version:parseInt(A[0]||0+"."+A[1]||0),build:parseInt(A[2]||0)}})();function $exec(B){if(!B){return B}if(window.execScript){window.execScript(B)}else{var A=document.createElement("script");A.setAttribute("type","text/javascript");A.text=B;document.head.appendChild(A);document.head.removeChild(A)}return B}Native.UID=1;var $uid=(Browser.Engine.trident)?function(A){return(A.uid||(A.uid=[Native.UID++]))[0]}:function(A){return A.uid||(A.uid=Native.UID++)};var Window=new Native({name:"Window",legacy:(Browser.Engine.trident)?null:window.Window,initialize:function(A){$uid(A);if(!A.Element){A.Element=$empty;if(Browser.Engine.webkit){A.document.createElement("iframe")}A.Element.prototype=(Browser.Engine.webkit)?window["[[DOMElement.prototype]]"]:{}}return $extend(A,Window.Prototype)},afterImplement:function(B,A){window[B]=Window.Prototype[B]=A}});Window.Prototype={$family:{name:"window"}};new Window(window);var Document=new Native({name:"Document",legacy:(Browser.Engine.trident)?null:window.Document,initialize:function(A){$uid(A);A.head=A.getElementsByTagName("head")[0];A.html=A.getElementsByTagName("html")[0];A.window=A.defaultView||A.parentWindow;if(Browser.Engine.trident4){$try(function(){A.execCommand("BackgroundImageCache",false,true)})}return $extend(A,Document.Prototype)},afterImplement:function(B,A){document[B]=Document.Prototype[B]=A}});Document.Prototype={$family:{name:"document"}};new Document(document);Array.implement({every:function(C,D){for(var B=0,A=this.length;B<A;B++){if(!C.call(D,this[B],B,this)){return false}}return true},filter:function(D,E){var C=[];for(var B=0,A=this.length;B<A;B++){if(D.call(E,this[B],B,this)){C.push(this[B])}}return C},clean:function(){return this.filter($defined)},indexOf:function(C,D){var A=this.length;for(var B=(D<0)?Math.max(0,A+D):D||0;B<A;B++){if(this[B]===C){return B}}return -1},map:function(D,E){var C=[];for(var B=0,A=this.length;B<A;B++){C[B]=D.call(E,this[B],B,this)}return C},some:function(C,D){for(var B=0,A=this.length;B<A;B++){if(C.call(D,this[B],B,this)){return true}}return false},associate:function(C){var D={},B=Math.min(this.length,C.length);for(var A=0;A<B;A++){D[C[A]]=this[A]}return D},link:function(C){var A={};for(var E=0,B=this.length;E<B;E++){for(var D in C){if(C[D](this[E])){A[D]=this[E];delete C[D];break}}}return A},contains:function(A,B){return this.indexOf(A,B)!=-1},extend:function(C){for(var B=0,A=C.length;B<A;B++){this.push(C[B])}return this},getLast:function(){return(this.length)?this[this.length-1]:null},getRandom:function(){return(this.length)?this[$random(0,this.length-1)]:null},include:function(A){if(!this.contains(A)){this.push(A)}return this},combine:function(C){for(var B=0,A=C.length;B<A;B++){this.include(C[B])}return this},erase:function(B){for(var A=this.length;A--;A){if(this[A]===B){this.splice(A,1)}}return this},empty:function(){this.length=0;return this},flatten:function(){var D=[];for(var B=0,A=this.length;B<A;B++){var C=$type(this[B]);if(!C){continue}D=D.concat((C=="array"||C=="collection"||C=="arguments")?Array.flatten(this[B]):this[B])}return D},hexToRgb:function(B){if(this.length!=3){return null}var A=this.map(function(C){if(C.length==1){C+=C}return C.toInt(16)});return(B)?A:"rgb("+A+")"},rgbToHex:function(D){if(this.length<3){return null}if(this.length==4&&this[3]==0&&!D){return"transparent"}var B=[];for(var A=0;A<3;A++){var C=(this[A]-0).toString(16);B.push((C.length==1)?"0"+C:C)}return(D)?B:"#"+B.join("")}});Function.implement({extend:function(A){for(var B in A){this[B]=A[B]}return this},create:function(B){var A=this;B=B||{};return function(D){var C=B.arguments;C=(C!=undefined)?$splat(C):Array.slice(arguments,(B.event)?1:0);if(B.event){C=[D||window.event].extend(C)}var E=function(){return A.apply(B.bind||null,C)};if(B.delay){return setTimeout(E,B.delay)}if(B.periodical){return setInterval(E,B.periodical)}if(B.attempt){return $try(E)}return E()}},pass:function(A,B){return this.create({arguments:A,bind:B})},attempt:function(A,B){return this.create({arguments:A,bind:B,attempt:true})()},bind:function(B,A){return this.create({bind:B,arguments:A})},bindWithEvent:function(B,A){return this.create({bind:B,event:true,arguments:A})},delay:function(B,C,A){return this.create({delay:B,bind:C,arguments:A})()},periodical:function(A,C,B){return this.create({periodical:A,bind:C,arguments:B})()},run:function(A,B){return this.apply(B,$splat(A))}});Number.implement({limit:function(B,A){return Math.min(A,Math.max(B,this))},round:function(A){A=Math.pow(10,A||0);return Math.round(this*A)/A},times:function(B,C){for(var A=0;A<this;A++){B.call(C,A,this)}},toFloat:function(){return parseFloat(this)},toInt:function(A){return parseInt(this,A||10)}});Number.alias("times","each");(function(B){var A={};B.each(function(C){if(!Number[C]){A[C]=function(){return Math[C].apply(null,[this].concat($A(arguments)))}}});Number.implement(A)})(["abs","acos","asin","atan","atan2","ceil","cos","exp","floor","log","max","min","pow","sin","sqrt","tan"]);String.implement({test:function(A,B){return((typeof A=="string")?new RegExp(A,B):A).test(this)},contains:function(A,B){return(B)?(B+this+B).indexOf(B+A+B)>-1:this.indexOf(A)>-1},trim:function(){return this.replace(/^\s+|\s+$/g,"")},clean:function(){return this.replace(/\s+/g," ").trim()},camelCase:function(){return this.replace(/-\D/g,function(A){return A.charAt(1).toUpperCase()})},hyphenate:function(){return this.replace(/[A-Z]/g,function(A){return("-"+A.charAt(0).toLowerCase())})},capitalize:function(){return this.replace(/\b[a-z]/g,function(A){return A.toUpperCase()})},escapeRegExp:function(){return this.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1")},toInt:function(A){return parseInt(this,A||10)},toFloat:function(){return parseFloat(this)},hexToRgb:function(B){var A=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return(A)?A.slice(1).hexToRgb(B):null},rgbToHex:function(B){var A=this.match(/\d{1,3}/g);return(A)?A.rgbToHex(B):null},stripScripts:function(B){var A="";var C=this.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi,function(){A+=arguments[1]+"\n";return""});if(B===true){$exec(A)}else{if($type(B)=="function"){B(A,C)}}return C},substitute:function(A,B){return this.replace(B||(/\\?\{([^}]+)\}/g),function(D,C){if(D.charAt(0)=="\\"){return D.slice(1)}return(A[C]!=undefined)?A[C]:""})}});Hash.implement({has:Object.prototype.hasOwnProperty,keyOf:function(B){for(var A in this){if(this.hasOwnProperty(A)&&this[A]===B){return A}}return null},hasValue:function(A){return(Hash.keyOf(this,A)!==null)},extend:function(A){Hash.each(A,function(C,B){Hash.set(this,B,C)},this);return this},combine:function(A){Hash.each(A,function(C,B){Hash.include(this,B,C)},this);return this},erase:function(A){if(this.hasOwnProperty(A)){delete this[A]}return this},get:function(A){return(this.hasOwnProperty(A))?this[A]:null},set:function(A,B){if(!this[A]||this.hasOwnProperty(A)){this[A]=B}return this},empty:function(){Hash.each(this,function(B,A){delete this[A]},this);return this},include:function(B,C){var A=this[B];if(A==undefined){this[B]=C}return this},map:function(B,C){var A=new Hash;Hash.each(this,function(E,D){A.set(D,B.call(C,E,D,this))},this);return A},filter:function(B,C){var A=new Hash;Hash.each(this,function(E,D){if(B.call(C,E,D,this)){A.set(D,E)}},this);return A},every:function(B,C){for(var A in this){if(this.hasOwnProperty(A)&&!B.call(C,this[A],A)){return false}}return true},some:function(B,C){for(var A in this){if(this.hasOwnProperty(A)&&B.call(C,this[A],A)){return true}}return false},getKeys:function(){var A=[];Hash.each(this,function(C,B){A.push(B)});return A},getValues:function(){var A=[];Hash.each(this,function(B){A.push(B)});return A},toQueryString:function(A){var B=[];Hash.each(this,function(F,E){if(A){E=A+"["+E+"]"}var D;switch($type(F)){case"object":D=Hash.toQueryString(F,E);break;case"array":var C={};F.each(function(H,G){C[G]=H});D=Hash.toQueryString(C,E);break;default:D=E+"="+encodeURIComponent(F)}if(F!=undefined){B.push(D)}});return B.join("&")}});Hash.alias({keyOf:"indexOf",hasValue:"contains"});var Event=new Native({name:"Event",initialize:function(A,F){F=F||window;var K=F.document;A=A||F.event;if(A.$extended){return A}this.$extended=true;var J=A.type;var G=A.target||A.srcElement;while(G&&G.nodeType==3){G=G.parentNode}if(J.test(/key/)){var B=A.which||A.keyCode;var M=Event.Keys.keyOf(B);if(J=="keydown"){var D=B-111;if(D>0&&D<13){M="f"+D}}M=M||String.fromCharCode(B).toLowerCase()}else{if(J.match(/(click|mouse|menu)/i)){K=(!K.compatMode||K.compatMode=="CSS1Compat")?K.html:K.body;var I={x:A.pageX||A.clientX+K.scrollLeft,y:A.pageY||A.clientY+K.scrollTop};var C={x:(A.pageX)?A.pageX-F.pageXOffset:A.clientX,y:(A.pageY)?A.pageY-F.pageYOffset:A.clientY};if(J.match(/DOMMouseScroll|mousewheel/)){var H=(A.wheelDelta)?A.wheelDelta/120:-(A.detail||0)/3}var E=(A.which==3)||(A.button==2);var L=null;if(J.match(/over|out/)){switch(J){case"mouseover":L=A.relatedTarget||A.fromElement;break;case"mouseout":L=A.relatedTarget||A.toElement}if(!(function(){while(L&&L.nodeType==3){L=L.parentNode}return true}).create({attempt:Browser.Engine.gecko})()){L=false}}}}return $extend(this,{event:A,type:J,page:I,client:C,rightClick:E,wheel:H,relatedTarget:L,target:G,code:B,key:M,shift:A.shiftKey,control:A.ctrlKey,alt:A.altKey,meta:A.metaKey})}});Event.Keys=new Hash({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46});Event.implement({stop:function(){return this.stopPropagation().preventDefault()},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation()}else{this.event.cancelBubble=true}return this},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault()}else{this.event.returnValue=false}return this}});var Class=new Native({name:"Class",initialize:function(B){B=B||{};var A=function(E){for(var D in this){this[D]=$unlink(this[D])}for(var F in Class.Mutators){if(!this[F]){continue}Class.Mutators[F](this,this[F]);delete this[F]}this.constructor=A;if(E===$empty){return this}var C=(this.initialize)?this.initialize.apply(this,arguments):this;if(this.options&&this.options.initialize){this.options.initialize.call(this)}return C};$extend(A,this);A.constructor=Class;A.prototype=B;return A}});Class.implement({implement:function(){Class.Mutators.Implements(this.prototype,Array.slice(arguments));return this}});Class.Mutators={Implements:function(A,B){$splat(B).each(function(C){$extend(A,($type(C)=="class")?new C($empty):C)})},Extends:function(self,klass){var instance=new klass($empty);delete instance.parent;delete instance.parentOf;for(var key in instance){var current=self[key],previous=instance[key];if(current==undefined){self[key]=previous;continue}var ctype=$type(current),ptype=$type(previous);if(ctype!=ptype){continue}switch(ctype){case"function":if(!arguments.callee.caller){self[key]=eval("("+String(current).replace(/\bthis\.parent\(\s*(\))?/g,function(full,close){return"arguments.callee._parent_.call(this"+(close||", ")})+")")}self[key]._parent_=previous;break;case"object":self[key]=$merge(previous,current)}}self.parent=function(){return arguments.callee.caller._parent_.apply(this,arguments)};self.parentOf=function(descendant){return descendant._parent_.apply(this,Array.slice(arguments,1))}}};var Chain=new Class({chain:function(){this.$chain=(this.$chain||[]).extend(arguments);return this},callChain:function(){return(this.$chain&&this.$chain.length)?this.$chain.shift().apply(this,arguments):false},clearChain:function(){if(this.$chain){this.$chain.empty()}return this}});var Events=new Class({addEvent:function(C,B,A){C=Events.removeOn(C);if(B!=$empty){this.$events=this.$events||{};this.$events[C]=this.$events[C]||[];this.$events[C].include(B);if(A){B.internal=true}}return this},addEvents:function(A){for(var B in A){this.addEvent(B,A[B])}return this},fireEvent:function(C,B,A){C=Events.removeOn(C);if(!this.$events||!this.$events[C]){return this}this.$events[C].each(function(D){D.create({bind:this,delay:A,"arguments":B})()},this);return this},removeEvent:function(B,A){B=Events.removeOn(B);if(!this.$events||!this.$events[B]){return this}if(!A.internal){this.$events[B].erase(A)}return this},removeEvents:function(C){for(var D in this.$events){if(C&&C!=D){continue}var B=this.$events[D];for(var A=B.length;A--;A){this.removeEvent(D,B[A])}}return this}});Events.removeOn=function(A){return A.replace(/^on([A-Z])/,function(B,C){return C.toLowerCase()})};var Options=new Class({setOptions:function(){this.options=$merge.run([this.options].extend(arguments));if(!this.addEvent){return this}for(var A in this.options){if($type(this.options[A])!="function"||!(/^on[A-Z]/).test(A)){continue}this.addEvent(A,this.options[A]);delete this.options[A]}return this}});Document.implement({newElement:function(A,B){if(Browser.Engine.trident&&B){["name","type","checked"].each(function(C){if(!B[C]){return }A+=" "+C+'="'+B[C]+'"';if(C!="checked"){delete B[C]}});A="<"+A+">"}return $.element(this.createElement(A)).set(B)},newTextNode:function(A){return this.createTextNode(A)},getDocument:function(){return this},getWindow:function(){return this.defaultView||this.parentWindow},purge:function(){var C=this.getElementsByTagName("*");for(var B=0,A=C.length;B<A;B++){Browser.freeMem(C[B])}}});var Element=new Native({name:"Element",legacy:window.Element,initialize:function(A,B){var C=Element.Constructors.get(A);if(C){return C(B)}if(typeof A=="string"){return document.newElement(A,B)}return $(A).set(B)},afterImplement:function(A,B){if(!Array[A]){Elements.implement(A,Elements.multi(A))}Element.Prototype[A]=B}});Element.Prototype={$family:{name:"element"}};Element.Constructors=new Hash;var IFrame=new Native({name:"IFrame",generics:false,initialize:function(){var E=Array.link(arguments,{properties:Object.type,iframe:$defined});var C=E.properties||{};var B=$(E.iframe)||false;var D=C.onload||$empty;delete C.onload;C.id=C.name=$pick(C.id,C.name,B.id,B.name,"IFrame_"+$time());B=new Element(B||"iframe",C);var A=function(){var F=$try(function(){return B.contentWindow.location.host});if(F&&F==window.location.host){var H=new Window(B.contentWindow);var G=new Document(B.contentWindow.document);$extend(H.Element.prototype,Element.Prototype)}D.call(B.contentWindow,B.contentWindow.document)};(!window.frames[C.id])?B.addListener("load",A):A();return B}});var Elements=new Native({initialize:function(F,B){B=$extend({ddup:true,cash:true},B);F=F||[];if(B.ddup||B.cash){var G={},E=[];for(var C=0,A=F.length;C<A;C++){var D=$.element(F[C],!B.cash);if(B.ddup){if(G[D.uid]){continue}G[D.uid]=true}E.push(D)}F=E}return(B.cash)?$extend(F,this):F}});Elements.implement({filter:function(A,B){if(!A){return this}return new Elements(Array.filter(this,(typeof A=="string")?function(C){return C.match(A)}:A,B))}});Elements.multi=function(A){return function(){var B=[];var F=true;for(var D=0,C=this.length;D<C;D++){var E=this[D][A].apply(this[D],arguments);B.push(E);if(F){F=($type(E)=="element")}}return(F)?new Elements(B):B}};Window.implement({$:function(B,C){if(B&&B.$family&&B.uid){return B}var A=$type(B);return($[A])?$[A](B,C,this.document):null},$$:function(A){if(arguments.length==1&&typeof A=="string"){return this.document.getElements(A)}var F=[];var C=Array.flatten(arguments);for(var D=0,B=C.length;D<B;D++){var E=C[D];switch($type(E)){case"element":E=[E];break;case"string":E=this.document.getElements(E,true);break;default:E=false}if(E){F.extend(E)}}return new Elements(F)},getDocument:function(){return this.document},getWindow:function(){return this}});$.string=function(C,B,A){C=A.getElementById(C);return(C)?$.element(C,B):null};$.element=function(A,D){$uid(A);if(!D&&!A.$family&&!(/^object|embed$/i).test(A.tagName)){var B=Element.Prototype;for(var C in B){A[C]=B[C]}}return A};$.object=function(B,C,A){if(B.toElement){return $.element(B.toElement(A),C)}return null};$.textnode=$.whitespace=$.window=$.document=$arguments(0);Native.implement([Element,Document],{getElement:function(A,B){return $(this.getElements(A,true)[0]||null,B)},getElements:function(A,D){A=A.split(",");var C=[];var B=(A.length>1);A.each(function(E){var F=this.getElementsByTagName(E.trim());(B)?C.extend(F):C=F},this);return new Elements(C,{ddup:B,cash:!D})}});Element.Storage={get:function(A){return(this[A]||(this[A]={}))}};Element.Inserters=new Hash({before:function(B,A){if(A.parentNode){A.parentNode.insertBefore(B,A)}},after:function(B,A){if(!A.parentNode){return }var C=A.nextSibling;(C)?A.parentNode.insertBefore(B,C):A.parentNode.appendChild(B)},bottom:function(B,A){A.appendChild(B)},top:function(B,A){var C=A.firstChild;(C)?A.insertBefore(B,C):A.appendChild(B)}});Element.Inserters.inside=Element.Inserters.bottom;Element.Inserters.each(function(C,B){var A=B.capitalize();Element.implement("inject"+A,function(D){C(this,$(D,true));return this});Element.implement("grab"+A,function(D){C($(D,true),this);return this})});Element.implement({getDocument:function(){return this.ownerDocument},getWindow:function(){return this.ownerDocument.getWindow()},getElementById:function(D,C){var B=this.ownerDocument.getElementById(D);if(!B){return null}for(var A=B.parentNode;A!=this;A=A.parentNode){if(!A){return null}}return $.element(B,C)},set:function(D,B){switch($type(D)){case"object":for(var C in D){this.set(C,D[C])}break;case"string":var A=Element.Properties.get(D);(A&&A.set)?A.set.apply(this,Array.slice(arguments,1)):this.setProperty(D,B)}return this},get:function(B){var A=Element.Properties.get(B);return(A&&A.get)?A.get.apply(this,Array.slice(arguments,1)):this.getProperty(B)},erase:function(B){var A=Element.Properties.get(B);(A&&A.erase)?A.erase.apply(this,Array.slice(arguments,1)):this.removeProperty(B);return this},match:function(A){return(!A||Element.get(this,"tag")==A)},inject:function(B,A){Element.Inserters.get(A||"bottom")(this,$(B,true));return this},wraps:function(B,A){B=$(B,true);return this.replaces(B).grab(B,A)},grab:function(B,A){Element.Inserters.get(A||"bottom")($(B,true),this);return this},appendText:function(B,A){return this.grab(this.getDocument().newTextNode(B),A)},adopt:function(){Array.flatten(arguments).each(function(A){A=$(A,true);if(A){this.appendChild(A)}},this);return this},dispose:function(){return(this.parentNode)?this.parentNode.removeChild(this):this},clone:function(D,C){switch($type(this)){case"element":var H={};for(var G=0,E=this.attributes.length;G<E;G++){var B=this.attributes[G],L=B.nodeName.toLowerCase();if(Browser.Engine.trident&&(/input/i).test(this.tagName)&&(/width|height/).test(L)){continue}var K=(L=="style"&&this.style)?this.style.cssText:B.nodeValue;if(!$chk(K)||L=="uid"||(L=="id"&&!C)){continue}if(K!="inherit"&&["string","number"].contains($type(K))){H[L]=K}}var J=new Element(this.nodeName.toLowerCase(),H);if(D!==false){for(var I=0,F=this.childNodes.length;I<F;I++){var A=Element.clone(this.childNodes[I],true,C);if(A){J.grab(A)}}}return J;case"textnode":return document.newTextNode(this.nodeValue)}return null},replaces:function(A){A=$(A,true);A.parentNode.replaceChild(this,A);return this},hasClass:function(A){return this.className.contains(A," ")},addClass:function(A){if(!this.hasClass(A)){this.className=(this.className+" "+A).clean()}return this},removeClass:function(A){this.className=this.className.replace(new RegExp("(^|\\s)"+A+"(?:\\s|$)"),"$1").clean();return this},toggleClass:function(A){return this.hasClass(A)?this.removeClass(A):this.addClass(A)},getComputedStyle:function(B){if(this.currentStyle){return this.currentStyle[B.camelCase()]}var A=this.getWindow().getComputedStyle(this,null);return(A)?A.getPropertyValue([B.hyphenate()]):null},empty:function(){$A(this.childNodes).each(function(A){Browser.freeMem(A);Element.empty(A);Element.dispose(A)},this);return this},destroy:function(){Browser.freeMem(this.empty().dispose());return null},getSelected:function(){return new Elements($A(this.options).filter(function(A){return A.selected}))},toQueryString:function(){var A=[];this.getElements("input, select, textarea").each(function(B){if(!B.name||B.disabled){return }var C=(B.tagName.toLowerCase()=="select")?Element.getSelected(B).map(function(D){return D.value}):((B.type=="radio"||B.type=="checkbox")&&!B.checked)?null:B.value;$splat(C).each(function(D){if(D){A.push(B.name+"="+encodeURIComponent(D))}})});return A.join("&")},getProperty:function(C){var B=Element.Attributes,A=B.Props[C];var D=(A)?this[A]:this.getAttribute(C,2);return(B.Bools[C])?!!D:(A)?D:D||null},getProperties:function(){var A=$A(arguments);return A.map(function(B){return this.getProperty(B)},this).associate(A)},setProperty:function(D,E){var C=Element.Attributes,B=C.Props[D],A=$defined(E);if(B&&C.Bools[D]){E=(E||!A)?true:false}else{if(!A){return this.removeProperty(D)}}(B)?this[B]=E:this.setAttribute(D,E);return this},setProperties:function(A){for(var B in A){this.setProperty(B,A[B])}return this},removeProperty:function(D){var C=Element.Attributes,B=C.Props[D],A=(B&&C.Bools[D]);(B)?this[B]=(A)?false:"":this.removeAttribute(D);return this},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this}});(function(){var A=function(D,B,I,C,F,H){var E=D[I||B];var G=[];while(E){if(E.nodeType==1&&(!C||Element.match(E,C))){G.push(E);if(!F){break}}E=E[B]}return(F)?new Elements(G,{ddup:false,cash:!H}):$(G[0],H)};Element.implement({getPrevious:function(B,C){return A(this,"previousSibling",null,B,false,C)},getAllPrevious:function(B,C){return A(this,"previousSibling",null,B,true,C)},getNext:function(B,C){return A(this,"nextSibling",null,B,false,C)},getAllNext:function(B,C){return A(this,"nextSibling",null,B,true,C)},getFirst:function(B,C){return A(this,"nextSibling","firstChild",B,false,C)},getLast:function(B,C){return A(this,"previousSibling","lastChild",B,false,C)},getParent:function(B,C){return A(this,"parentNode",null,B,false,C)},getParents:function(B,C){return A(this,"parentNode",null,B,true,C)},getChildren:function(B,C){return A(this,"nextSibling","firstChild",B,true,C)},hasChild:function(B){B=$(B,true);return(!!B&&$A(this.getElementsByTagName(B.tagName)).contains(B))}})})();Element.Properties=new Hash;Element.Properties.style={set:function(A){this.style.cssText=A},get:function(){return this.style.cssText},erase:function(){this.style.cssText=""}};Element.Properties.tag={get:function(){return this.tagName.toLowerCase()}};Element.Properties.href={get:function(){return(!this.href)?null:this.href.replace(new RegExp("^"+document.location.protocol+"//"+document.location.host),"")}};Element.Properties.html={set:function(){return this.innerHTML=Array.flatten(arguments).join("")}};Native.implement([Element,Window,Document],{addListener:function(B,A){if(this.addEventListener){this.addEventListener(B,A,false)}else{this.attachEvent("on"+B,A)}return this},removeListener:function(B,A){if(this.removeEventListener){this.removeEventListener(B,A,false)}else{this.detachEvent("on"+B,A)}return this},retrieve:function(B,A){var D=Element.Storage.get(this.uid);var C=D[B];if($defined(A)&&!$defined(C)){C=D[B]=A}return $pick(C)},store:function(B,A){var C=Element.Storage.get(this.uid);C[B]=A;return this},eliminate:function(A){var B=Element.Storage.get(this.uid);delete B[A];return this}});Element.Attributes=new Hash({Props:{html:"innerHTML","class":"className","for":"htmlFor",text:(Browser.Engine.trident)?"innerText":"textContent"},Bools:["compact","nowrap","ismap","declare","noshade","checked","disabled","readonly","multiple","selected","noresize","defer"],Camels:["value","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","maxLength","readOnly","rowSpan","tabIndex","useMap"]});Browser.freeMem=function(A){if(!A){return }if(Browser.Engine.trident&&(/object/i).test(A.tagName)){for(var B in A){if(typeof A[B]=="function"){A[B]=$empty}}Element.dispose(A)}if(A.uid&&A.removeEvents){A.removeEvents()}};(function(B){var C=B.Bools,A=B.Camels;B.Bools=C=C.associate(C);Hash.extend(Hash.combine(B.Props,C),A.associate(A.map(function(D){return D.toLowerCase()})));B.erase("Camels")})(Element.Attributes);window.addListener("unload",function(){window.removeListener("unload",arguments.callee);document.purge();if(Browser.Engine.trident){CollectGarbage()}});Element.Properties.events={set:function(A){this.addEvents(A)}};Native.implement([Element,Window,Document],{addEvent:function(E,G){var H=this.retrieve("events",{});H[E]=H[E]||{keys:[],values:[]};if(H[E].keys.contains(G)){return this}H[E].keys.push(G);var F=E,A=Element.Events.get(E),C=G,I=this;if(A){if(A.onAdd){A.onAdd.call(this,G)}if(A.condition){C=function(J){if(A.condition.call(this,J)){return G.call(this,J)}return false}}F=A.base||F}var D=function(){return G.call(I)};var B=Element.NativeEvents[F]||0;if(B){if(B==2){D=function(J){J=new Event(J,I.getWindow());if(C.call(I,J)===false){J.stop()}}}this.addListener(F,D)}H[E].values.push(D);return this},removeEvent:function(D,C){var B=this.retrieve("events");if(!B||!B[D]){return this}var G=B[D].keys.indexOf(C);if(G==-1){return this}var A=B[D].keys.splice(G,1)[0];var F=B[D].values.splice(G,1)[0];var E=Element.Events.get(D);if(E){if(E.onRemove){E.onRemove.call(this,C)}D=E.base||D}return(Element.NativeEvents[D])?this.removeListener(D,F):this},addEvents:function(A){for(var B in A){this.addEvent(B,A[B])}return this},removeEvents:function(B){var A=this.retrieve("events");if(!A){return this}if(!B){for(var C in A){this.removeEvents(C)}A=null}else{if(A[B]){while(A[B].keys[0]){this.removeEvent(B,A[B].keys[0])}A[B]=null}}return this},fireEvent:function(D,B,A){var C=this.retrieve("events");if(!C||!C[D]){return this}C[D].keys.each(function(E){E.create({bind:this,delay:A,"arguments":B})()},this);return this},cloneEvents:function(D,A){D=$(D);var C=D.retrieve("events");if(!C){return this}if(!A){for(var B in C){this.cloneEvents(D,B)}}else{if(C[A]){C[A].keys.each(function(E){this.addEvent(A,E)},this)}}return this}});Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,load:1,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1};(function(){var A=function(B){var C=B.relatedTarget;if(C==undefined){return true}if(C===false){return false}return($type(this)!="document"&&C!=this&&C.prefix!="xul"&&!this.hasChild(C))};Element.Events=new Hash({mouseenter:{base:"mouseover",condition:A},mouseleave:{base:"mouseout",condition:A},mousewheel:{base:(Browser.Engine.gecko)?"DOMMouseScroll":"mousewheel"}})})();Element.Properties.styles={set:function(A){this.setStyles(A)}};Element.Properties.opacity={set:function(A,B){if(!B){if(A==0){if(this.style.visibility!="hidden"){this.style.visibility="hidden"}}else{if(this.style.visibility!="visible"){this.style.visibility="visible"}}}if(!this.currentStyle||!this.currentStyle.hasLayout){this.style.zoom=1}if(Browser.Engine.trident){this.style.filter=(A==1)?"":"alpha(opacity="+A*100+")"}this.style.opacity=A;this.store("opacity",A)},get:function(){return this.retrieve("opacity",1)}};Element.implement({setOpacity:function(A){return this.set("opacity",A,true)},getOpacity:function(){return this.get("opacity")},setStyle:function(B,A){switch(B){case"opacity":return this.set("opacity",parseFloat(A));case"float":B=(Browser.Engine.trident)?"styleFloat":"cssFloat"}B=B.camelCase();if($type(A)!="string"){var C=(Element.Styles.get(B)||"@").split(" ");A=$splat(A).map(function(E,D){if(!C[D]){return""}return($type(E)=="number")?C[D].replace("@",Math.round(E)):E}).join(" ")}else{if(A==String(Number(A))){A=Math.round(A)}}this.style[B]=A;return this},getStyle:function(G){switch(G){case"opacity":return this.get("opacity");case"float":G=(Browser.Engine.trident)?"styleFloat":"cssFloat"}G=G.camelCase();var A=this.style[G];if(!$chk(A)){A=[];for(var F in Element.ShortStyles){if(G!=F){continue}for(var E in Element.ShortStyles[F]){A.push(this.getStyle(E))}return A.join(" ")}A=this.getComputedStyle(G)}if(A){A=String(A);var C=A.match(/rgba?\([\d\s,]+\)/);if(C){A=A.replace(C[0],C[0].rgbToHex())}}if(Browser.Engine.presto||(Browser.Engine.trident&&!$chk(parseInt(A)))){if(G.test(/^(height|width)$/)){var B=(G=="width")?["left","right"]:["top","bottom"],D=0;B.each(function(H){D+=this.getStyle("border-"+H+"-width").toInt()+this.getStyle("padding-"+H).toInt()},this);return this["offset"+G.capitalize()]-D+"px"}if(Browser.Engine.presto&&String(A).test("px")){return A}if(G.test(/(border(.+)Width|margin|padding)/)){return"0px"}}return A},setStyles:function(B){for(var A in B){this.setStyle(A,B[A])}return this},getStyles:function(){var A={};Array.each(arguments,function(B){A[B]=this.getStyle(B)},this);return A}});Element.Styles=new Hash({left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@"});Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}};["Top","Right","Bottom","Left"].each(function(G){var F=Element.ShortStyles;var B=Element.Styles;["margin","padding"].each(function(H){var I=H+G;F[H][I]=B[I]="@px"});var E="border"+G;F.border[E]=B[E]="@px @ rgb(@, @, @)";var D=E+"Width",A=E+"Style",C=E+"Color";F[E]={};F.borderWidth[D]=F[E][D]=B[D]="@px";F.borderStyle[A]=F[E][A]=B[A]="@";F.borderColor[C]=F[E][C]=B[C]="rgb(@, @, @)"});(function(){Element.implement({scrollTo:function(H,I){if(B(this)){this.getWindow().scrollTo(H,I)}else{this.scrollLeft=H;this.scrollTop=I}return this},getSize:function(){if(B(this)){return this.getWindow().getSize()}return{x:this.offsetWidth,y:this.offsetHeight}},getScrollSize:function(){if(B(this)){return this.getWindow().getScrollSize()}return{x:this.scrollWidth,y:this.scrollHeight}},getScroll:function(){if(B(this)){return this.getWindow().getScroll()}return{x:this.scrollLeft,y:this.scrollTop}},getScrolls:function(){var I=this,H={x:0,y:0};while(I&&!B(I)){H.x+=I.scrollLeft;H.y+=I.scrollTop;I=I.parentNode}return H},getOffsetParent:function(){var H=this;if(B(H)){return null}if(!Browser.Engine.trident){return H.offsetParent}while((H=H.parentNode)&&!B(H)){if(D(H,"position")!="static"){return H}}return null},getOffsets:function(){var I=this,H={x:0,y:0};if(B(this)){return H}while(I&&!B(I)){H.x+=I.offsetLeft;H.y+=I.offsetTop;if(Browser.Engine.gecko){if(!F(I)){H.x+=C(I);H.y+=G(I)}var J=I.parentNode;if(J&&D(J,"overflow")!="visible"){H.x+=C(J);H.y+=G(J)}}else{if(I!=this&&(Browser.Engine.trident||Browser.Engine.webkit)){H.x+=C(I);H.y+=G(I)}}I=I.offsetParent;if(Browser.Engine.trident){while(I&&!I.currentStyle.hasLayout){I=I.offsetParent}}}if(Browser.Engine.gecko&&!F(this)){H.x-=C(this);H.y-=G(this)}return H},getPosition:function(K){if(B(this)){return{x:0,y:0}}var L=this.getOffsets(),I=this.getScrolls();var H={x:L.x-I.x,y:L.y-I.y};var J=(K&&(K=$(K)))?K.getPosition():{x:0,y:0};return{x:H.x-J.x,y:H.y-J.y}},getCoordinates:function(J){if(B(this)){return this.getWindow().getCoordinates()}var H=this.getPosition(J),I=this.getSize();var K={left:H.x,top:H.y,width:I.x,height:I.y};K.right=K.left+K.width;K.bottom=K.top+K.height;return K},computePosition:function(H){return{left:H.x-E(this,"margin-left"),top:H.y-E(this,"margin-top")}},position:function(H){return this.setStyles(this.computePosition(H))}});Native.implement([Document,Window],{getSize:function(){var I=this.getWindow();if(Browser.Engine.presto||Browser.Engine.webkit){return{x:I.innerWidth,y:I.innerHeight}}var H=A(this);return{x:H.clientWidth,y:H.clientHeight}},getScroll:function(){var I=this.getWindow();var H=A(this);return{x:I.pageXOffset||H.scrollLeft,y:I.pageYOffset||H.scrollTop}},getScrollSize:function(){var I=A(this);var H=this.getSize();return{x:Math.max(I.scrollWidth,H.x),y:Math.max(I.scrollHeight,H.y)}},getPosition:function(){return{x:0,y:0}},getCoordinates:function(){var H=this.getSize();return{top:0,left:0,bottom:H.y,right:H.x,height:H.y,width:H.x}}});var D=Element.getComputedStyle;function E(H,I){return D(H,I).toInt()||0}function F(H){return D(H,"-moz-box-sizing")=="border-box"}function G(H){return E(H,"border-top-width")}function C(H){return E(H,"border-left-width")}function B(H){return(/^(?:body|html)$/i).test(H.tagName)}function A(H){var I=H.getDocument();return(!I.compatMode||I.compatMode=="CSS1Compat")?I.html:I.body}})();Native.implement([Window,Document,Element],{getHeight:function(){return this.getSize().y},getWidth:function(){return this.getSize().x},getScrollTop:function(){return this.getScroll().y},getScrollLeft:function(){return this.getScroll().x},getScrollHeight:function(){return this.getScrollSize().y},getScrollWidth:function(){return this.getScrollSize().x},getTop:function(){return this.getPosition().y},getLeft:function(){return this.getPosition().x}});Element.Events.domready={onAdd:function(A){if(Browser.loaded){A.call(this)}}};(function(){var B=function(){if(Browser.loaded){return }Browser.loaded=true;window.fireEvent("domready");document.fireEvent("domready")};switch(Browser.Engine.name){case"webkit":(function(){(["loaded","complete"].contains(document.readyState))?B():arguments.callee.delay(50)})();break;case"trident":var A=document.createElement("div");(function(){($try(function(){A.doScroll("left");return $(A).inject(document.body).set("html","temp").dispose()}))?B():arguments.callee.delay(50)})();break;default:window.addEvent("load",B);document.addEvent("DOMContentLoaded",B)}})();var Fx=new Class({Implements:[Chain,Events,Options],options:{fps:50,unit:false,duration:500,link:"ignore",transition:function(A){return -(Math.cos(Math.PI*A)-1)/2}},initialize:function(A){this.subject=this.subject||this;this.setOptions(A);this.options.duration=Fx.Durations[this.options.duration]||this.options.duration.toInt();var B=this.options.wait;if(B===false){this.options.link="cancel"}},step:function(){var A=$time();if(A<this.time+this.options.duration){var B=this.options.transition((A-this.time)/this.options.duration);this.set(this.compute(this.from,this.to,B))}else{this.set(this.compute(this.from,this.to,1));this.complete()}},set:function(A){return A},compute:function(C,B,A){return Fx.compute(C,B,A)},check:function(A){if(!this.timer){return true}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(A.bind(this,Array.slice(arguments,1)));return false}return false},start:function(B,A){if(!this.check(arguments.callee,B,A)){return this}this.from=B;this.to=A;this.time=0;this.startTimer();this.onStart();return this},complete:function(){if(this.stopTimer()){this.onComplete()}return this},cancel:function(){if(this.stopTimer()){this.onCancel()}return this},onStart:function(){this.fireEvent("start",this.subject)},onComplete:function(){this.fireEvent("complete",this.subject);if(!this.callChain()){this.fireEvent("chainComplete",this.subject)}},onCancel:function(){this.fireEvent("cancel",this.subject).clearChain()},pause:function(){this.stopTimer();return this},resume:function(){this.startTimer();return this},stopTimer:function(){if(!this.timer){return false}this.time=$time()-this.time;this.timer=$clear(this.timer);return true},startTimer:function(){if(this.timer){return false}this.time=$time()-this.time;this.timer=this.step.periodical(Math.round(1000/this.options.fps),this);return true}});Fx.compute=function(C,B,A){return(B-C)*A+C};Fx.Durations={"short":250,normal:500,"long":1000};Fx.CSS=new Class({Extends:Fx,prepare:function(D,E,B){B=$splat(B);var C=B[1];if(!$chk(C)){B[1]=B[0];B[0]=D.getStyle(E)}var A=B.map(this.parse);return{from:A[0],to:A[1]}},parse:function(A){A=$lambda(A)();A=(typeof A=="string")?A.split(" "):$splat(A);return A.map(function(C){C=String(C);var B=false;Fx.CSS.Parsers.each(function(F,E){if(B){return }var D=F.parse(C);if($chk(D)){B={value:D,parser:F}}});B=B||{value:C,parser:Fx.CSS.Parsers.String};return B})},compute:function(D,C,B){var A=[];(Math.min(D.length,C.length)).times(function(E){A.push({value:D[E].parser.compute(D[E].value,C[E].value,B),parser:D[E].parser})});A.$family={name:"fx:css:value"};return A},serve:function(C,B){if($type(C)!="fx:css:value"){C=this.parse(C)}var A=[];C.each(function(D){A=A.concat(D.parser.serve(D.value,B))});return A},render:function(A,D,C,B){A.setStyle(D,this.serve(C,B))},search:function(A){if(Fx.CSS.Cache[A]){return Fx.CSS.Cache[A]}var B={};Array.each(document.styleSheets,function(E,D){var C=E.href;if(C&&C.contains("://")&&!C.contains(document.domain)){return }var F=E.rules||E.cssRules;Array.each(F,function(I,G){if(!I.style){return }var H=(I.selectorText)?I.selectorText.replace(/^\w+/,function(J){return J.toLowerCase()}):null;if(!H||!H.test("^"+A+"$")){return }Element.Styles.each(function(K,J){if(!I.style[J]||Element.ShortStyles[J]){return }K=String(I.style[J]);B[J]=(K.test(/^rgb/))?K.rgbToHex():K})})});return Fx.CSS.Cache[A]=B}});Fx.CSS.Cache={};Fx.CSS.Parsers=new Hash({Color:{parse:function(A){if(A.match(/^#[0-9a-f]{3,6}$/i)){return A.hexToRgb(true)}return((A=A.match(/(\d+),\s*(\d+),\s*(\d+)/)))?[A[1],A[2],A[3]]:false},compute:function(C,B,A){return C.map(function(E,D){return Math.round(Fx.compute(C[D],B[D],A))})},serve:function(A){return A.map(Number)}},Number:{parse:parseFloat,compute:Fx.compute,serve:function(B,A){return(A)?B+A:B}},String:{parse:$lambda(false),compute:$arguments(1),serve:$arguments(0)}});Fx.Tween=new Class({Extends:Fx.CSS,initialize:function(B,A){this.element=this.subject=$(B);this.parent(A)},set:function(B,A){if(arguments.length==1){A=B;B=this.property||this.options.property}this.render(this.element,B,A,this.options.unit);return this},start:function(C,E,D){if(!this.check(arguments.callee,C,E,D)){return this}var B=Array.flatten(arguments);this.property=this.options.property||B.shift();var A=this.prepare(this.element,this.property,B);return this.parent(A.from,A.to)}});Element.Properties.tween={set:function(A){var B=this.retrieve("tween");if(B){B.cancel()}return this.eliminate("tween").store("tween:options",$extend({link:"cancel"},A))},get:function(A){if(A||!this.retrieve("tween")){if(A||!this.retrieve("tween:options")){this.set("tween",A)}this.store("tween",new Fx.Tween(this,this.retrieve("tween:options")))}return this.retrieve("tween")}};Element.implement({tween:function(A,C,B){this.get("tween").start(arguments);return this},fade:function(C){var E=this.get("tween"),D="opacity",A;C=$pick(C,"toggle");switch(C){case"in":E.start(D,1);break;case"out":E.start(D,0);break;case"show":E.set(D,1);break;case"hide":E.set(D,0);break;case"toggle":var B=this.retrieve("fade:flag",this.get("opacity")==1);E.start(D,(B)?0:1);this.store("fade:flag",!B);A=true;break;default:E.start(D,arguments)}if(!A){this.eliminate("fade:flag")}return this},highlight:function(C,A){if(!A){A=this.retrieve("highlight:original",this.getStyle("background-color"));A=(A=="transparent")?"#fff":A}var B=this.get("tween");B.start("background-color",C||"#ffff88",A).chain(function(){this.setStyle("background-color",this.retrieve("highlight:original"));B.callChain()}.bind(this));return this}});Fx.Morph=new Class({Extends:Fx.CSS,initialize:function(B,A){this.element=this.subject=$(B);this.parent(A)},set:function(A){if(typeof A=="string"){A=this.search(A)}for(var B in A){this.render(this.element,B,A[B],this.options.unit)}return this},compute:function(E,D,C){var A={};for(var B in E){A[B]=this.parent(E[B],D[B],C)}return A},start:function(B){if(!this.check(arguments.callee,B)){return this}if(typeof B=="string"){B=this.search(B)}var E={},D={};for(var C in B){var A=this.prepare(this.element,C,B[C]);E[C]=A.from;D[C]=A.to}return this.parent(E,D)}});Element.Properties.morph={set:function(A){var B=this.retrieve("morph");if(B){B.cancel()}return this.eliminate("morph").store("morph:options",$extend({link:"cancel"},A))},get:function(A){if(A||!this.retrieve("morph")){if(A||!this.retrieve("morph:options")){this.set("morph",A)}this.store("morph",new Fx.Morph(this,this.retrieve("morph:options")))}return this.retrieve("morph")}};Element.implement({morph:function(A){this.get("morph").start(A);return this}});/*
	Slimbox v1.63 - The ultimate lightweight Lightbox clone
	(c) 2007-2008 Christophe Beyls <http://www.digitalia.be>
	MIT-style license.
*/
var Slimbox;(function(){var G={},H=0,F,M,B,T,U,P,E,N,K=new Image(),L=new Image(),Y,b,Q,I,X,a,J,Z,C;window.addEvent("domready",function(){$(document.body).adopt($$([Y=new Element("div",{id:"lbOverlay"}).addEvent("click",O),b=new Element("div",{id:"lbCenter"}),a=new Element("div",{id:"lbBottomContainer"})]).setStyle("display","none"));Q=new Element("div",{id:"lbImage"}).injectInside(b).adopt(I=new Element("a",{id:"lbPrevLink",href:"#"}).addEvent("click",D),X=new Element("a",{id:"lbNextLink",href:"#"}).addEvent("click",S));J=new Element("div",{id:"lbBottom"}).injectInside(a).adopt(new Element("a",{id:"lbCloseLink",href:"#"}).addEvent("click",O),Z=new Element("div",{id:"lbCaption"}),C=new Element("div",{id:"lbNumber"}),new Element("div",{styles:{clear:"both"}}));E={overlay:new Fx.Tween(Y,{property:"opacity",duration:500}).set(0),image:new Fx.Tween(Q,{property:"opacity",duration:500,onComplete:A}),bottom:new Fx.Tween(J,{property:"margin-top",duration:400})}});Slimbox={open:function(f,e,d){F=$extend({loop:false,overlayOpacity:0.8,resizeDuration:400,resizeTransition:false,initialWidth:250,initialHeight:250,animateCaption:true,showCounter:true,counterText:"Bild {x} von {y}"},d||{});if(typeof f=="string"){f=[[f,e]];e=0}M=f;F.loop=F.loop&&(M.length>1);c();R(true);P=window.getScrollTop()+(window.getHeight()/15);E.resize=new Fx.Morph(b,$extend({duration:F.resizeDuration,onComplete:A},F.resizeTransition?{transition:F.resizeTransition}:{}));b.setStyles({top:P,width:F.initialWidth,height:F.initialHeight,marginLeft:-(F.initialWidth/2),display:""});E.overlay.start(F.overlayOpacity);H=1;return V(e)}};Element.implement({slimbox:function(d,e){$$(this).slimbox(d,e);return this}});Elements.implement({slimbox:function(d,g,f){g=g||function(h){return[h.href,h.title]};f=f||function(){return true};var e=this;e.removeEvents("click").addEvent("click",function(){var h=e.filter(f,this);return Slimbox.open(h.map(g),h.indexOf(this),d)});return e}});function c(){Y.setStyles({top:window.getScrollTop(),height:window.getHeight()})}function R(d){["object",window.ie?"select":"embed"].forEach(function(f){Array.forEach(document.getElementsByTagName(f),function(g){if(d){G[g]=g.style.visibility}g.style.visibility=d?"hidden":G[g]})});Y.style.display=d?"":"none";var e=d?"addEvent":"removeEvent";window[e]("scroll",c)[e]("resize",c);document[e]("keydown",W)}function W(d){switch(d.code){case 27:case 88:case 67:O();break;case 37:case 80:D();break;case 39:case 78:S()}return false}function D(){return V(T)}function S(){return V(U)}function V(d){if((H==1)&&(d>=0)){H=2;B=d;T=((B||!F.loop)?B:M.length)-1;U=B+1;if(U==M.length){U=F.loop?0:-1}$$(I,X,Q,a).setStyle("display","none");E.bottom.cancel().set(0);E.image.set(0);b.className="lbLoading";N=new Image();N.onload=A;N.src=M[d][0]}return false}function A(){switch(H++){case 2:b.className="";Q.setStyles({backgroundImage:"url("+M[B][0]+")",display:""});$$(Q,J).setStyle("width",N.width);$$(Q,I,X).setStyle("height",N.height);Z.set("html",M[B][1]||"");C.set("html",(F.showCounter&&(M.length>1))?F.counterText.replace(/{x}/,B+1).replace(/{y}/,M.length):"");if(T>=0){K.src=M[T][0]}if(U>=0){L.src=M[U][0]}if(b.clientHeight!=Q.offsetHeight){E.resize.start({height:Q.offsetHeight});break}H++;case 3:if(b.clientWidth!=Q.offsetWidth){E.resize.start({width:Q.offsetWidth,marginLeft:-Q.offsetWidth/2});break}H++;case 4:a.setStyles({top:P+b.clientHeight,marginLeft:b.style.marginLeft,visibility:"hidden",display:""});E.image.start(1);break;case 5:if(T>=0){I.style.display=""}if(U>=0){X.style.display=""}if(F.animateCaption){E.bottom.set(-J.offsetHeight).start(0)}a.style.visibility="";H=1}}function O(){if(H){H=0;N.onload=$empty;for(var d in E){E[d].cancel()}$$(b,a).setStyle("display","none");E.overlay.chain(R).start(0)}return false}})();

// AUTOLOAD CODE BLOCK (MAY BE CHANGED OR REMOVED)
Slimbox.scanPage = function() {
	var links = $$("a").filter(function(el) {
		return el.rel && el.rel.test(/^lightbox/i);
	});
	$$(links).slimbox({/* Put custom options here */}, null, function(el) {
		return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
	});
};
window.addEvent("domready", Slimbox.scanPage);
//{Rf.CContent} content, divIdSubMenu
Rf.CImageGallery = function(aH){
	
	Rf.CModule.call(this, aH);
	
	this.RfContent = aH.content;
	this.RfAuth = this.RfContent.RfAuth;
	this.DIV = Rf.dcModuleDIV();
	this.RfContent.DIV.appendChild(this.DIV);
	
	this.UserID = this.RfContent.UserID;
	
	this.RegisteredSubMenuItems = {};
	this.SubMenuItemDivs = {};
	this.SubPartDIVs = {};
	
	this.buildSubParts();
	this.createSiteIndicator({ModuleName: "Bilder"});
	
	//this.RegisteredSubMenuItems["liste"] = {label:"Liste"};
	
	this.createSubMenu();
}
Rf.CImageGallery.prototype = new Rf.CModule(false);

Rf.CImageGallery.prototype.Categories = null;
//e.g. Year
Rf.CImageGallery.prototype.CurrentCategoryIndex = null;
//e.g. Herren 40 - Ausflug
Rf.CImageGallery.prototype.CurrentSubCategoryIndex = null;

Rf.CImageGallery.prototype.CurrentImageData = null;

Rf.CImageGallery.prototype.buildSubParts = function(){
	this.create();
}

Rf.CImageGallery.prototype.create = function(){
	this.SubPartDIVs["imageGallery"] = Rf.dc("div");
	this.DIV.appendChild(this.SubPartDIVs["imageGallery"]);
	
	this.Nodes.galleryChooser = Rf.dc("div");
	this.SubPartDIVs["imageGallery"].appendChild(this.Nodes.galleryChooser);
	
	this.Nodes.galleryContent = Rf.dc("div");
	//this.Nodes.galleryContent.innerHTML = "<img src='images/tck_08.jpg' />";
	this.SubPartDIVs["imageGallery"].appendChild(this.Nodes.galleryContent);
	
//return;
//	this.SubPartDIVs["galleryContent"] = Rf.dc("div");
//	this.DIV.appendChild(this.SubPartDIVs["galleryContent"]);

	var galleryContent = new Rf.CContentBox({
		Color: "d0c6b0",
		HeaderLeftText: "",
		HeaderRightText: ""
	});

	galleryContent.ContentNode.innerHTML = "<br/><table style='width:100%'><tbody><tr><td style='width=50%'></td><td style='text-align:center; width:534px;'><img src='images/tck_08_s.jpg' /></td><td style='width=50%'></td></tr></tbody></table>";
	this.Nodes.galleryContent.appendChild(galleryContent.getNode());
	
//	this.SubPartDIVs.galleryContent.appendChild(galleryContent.getNode());
}


Rf.CImageGallery.prototype.loadChooseData = function(aH, force_flag){
	if(typeof aH == "undefined"){
		aH = {};
	}
	/*if(this.SubPartDIVs["galleryContent"].innerHTML != "" && (typeof force_flag != "boolean" || force_flag != true)){
		return true;
	}*/
	
	var request = new Rf.Loading.CRequest();
	request.rfImageGallery = this;
	request.Data = {
		username:Rf.Session.rfAuth.username,
		password:Rf.Session.rfAuth.password,
		userId:Rf.Session.rfAuth.userId,
		action:"getChooseData",
		categorie:this.CurrentCategorieId,
		subCategorie:this.CurrentSubCategorieId
	};
	
	request.onSuccess = function() {
		if(!Rf.empty(this.Response.error)){
			Rf.setError(this.Response.error);
		}
		else{
			this.rfImageGallery.Categories = this.Response.data;		
			this.rfImageGallery.fillChooser();
		}
	}
	request.onError = function() {  } 
	request.onTimeout = function() {  } 
	var conn = new Rf.Loading.CConnectHTTPXML({ServiceUrl: "local/modules/ImageGallery/backend.php"}); 
	conn.sendRequest( request );
}

Rf.CImageGallery.prototype.fillChooser = function(){
	if(this.Nodes.galleryChooser.innerHTML == ""){
		
		var galleryChoose = new Rf.CContentBox({
			Color: "d0c6b0",
			HeaderLeftText: "Galerie w&auml;hlen",
			HeaderRightText: ""
		});
		
		this.Nodes.SelectCategory = Rf.dc("select");
		this.Nodes.SelectCategory.style.width = "120px";
		this.Nodes.SelectCategory.rfImageGallery = this;
		this.Nodes.SelectCategory.onchange = function(){
			this.rfImageGallery.CurrentCategoryIndex = this.value;
			this.rfImageGallery.fillChooser();
		}
		galleryChoose.appendContent(this.Nodes.SelectCategory);
		
		this.Nodes.SelectSep = Rf.dc("span");
		this.Nodes.SelectSep.innerHTML = "&nbsp;-&gt;&nbsp;";
		galleryChoose.appendContent(this.Nodes.SelectSep);
		
		this.Nodes.SelectSubCategory = Rf.dc("select");
		this.Nodes.SelectSubCategory.style.width = "300px";
		this.Nodes.SelectSubCategory.rfImageGallery = this;
		this.Nodes.SelectSubCategory.onchange = function(){
			this.rfImageGallery.CurrentSubCategoryIndex = this.value;
			this.rfImageGallery.loadGalleryContent();
		}
		galleryChoose.appendContent(this.Nodes.SelectSubCategory);
		
		this.Nodes.galleryChooser.appendChild(galleryChoose.getNode());
	}

	if(this.CurrentCategoryIndex == null){
		this.Nodes.SelectCategory.innerHTML = "";
		var option = Rf.dc("option");
		option.innerHTML = "Kategorie w&auml;hlen";
		option.value = -1;
		this.Nodes.SelectCategory.appendChild(option);
		for(var i=0; i<this.Categories.length; i++){
			var option = Rf.dc("option");
			option.innerHTML = this.Categories[i].title;
			option.value = i;
			this.Nodes.SelectCategory.appendChild(option);
		}
	}
	else{
		this.Nodes.SelectSubCategory.innerHTML = "";
		var option = Rf.dc("option");
		option.innerHTML = "Unter-Kategorie w&auml;hlen";
		option.value = -1;
		this.Nodes.SelectSubCategory.appendChild(option);
		if(this.Categories[this.CurrentCategoryIndex].subcategories instanceof Array){
			for(var i=0; i<this.Categories[this.CurrentCategoryIndex].subcategories.length; i++){
				var option = Rf.dc("option");
				option.innerHTML = this.Categories[this.CurrentCategoryIndex].subcategories[i].title;
				option.value = i;
				this.Nodes.SelectSubCategory.appendChild(option);
			}
		}
	}
}

Rf.CImageGallery.prototype.loadGalleryContent = function(aH, force_flag){
	if(typeof aH == "undefined"){
		aH = {};
	}

	var request = new Rf.Loading.CRequest();
	request.rfImageGallery = this;
	request.Data = {
		username:Rf.Session.rfAuth.username,
		password:Rf.Session.rfAuth.password,
		userId:Rf.Session.rfAuth.userId,
		action:"getGalleryContent",
		subCategorie:this.Categories[this.CurrentCategoryIndex].subcategories[this.CurrentSubCategoryIndex].id
	};
	
	request.onSuccess = function() {
		if(!Rf.empty(this.Response.error)){
			Rf.setError(this.Response.error);
		}
		else{
			this.rfImageGallery.CurrentImageData = this.Response.data;
			this.rfImageGallery.showCurrentGallery();
		}
	}
	request.onError = function() {  } 
	request.onTimeout = function() {  } 
	var conn = new Rf.Loading.CConnectHTTPXML({ServiceUrl: "local/modules/ImageGallery/backend.php"}); 
	conn.sendRequest( request );
}

Rf.CImageGallery.prototype.showCurrentGallery = function(){
	this.Nodes.galleryContent.innerHTML = "";
	
	var galleryContent = new Rf.CContentBox({
		Color: "d0c6b0",
		HeaderLeftText: "Galerie:&nbsp;&nbsp;"+this.Categories[this.CurrentCategoryIndex].title+" - "+this.Categories[this.CurrentCategoryIndex].subcategories[this.CurrentSubCategoryIndex].title,
		HeaderRightText: ""
	});
	/*
	var d = Rf.dc("div");
	d.style.lineHeight = "18px";
	d.innerHTML = this.Response.data;
	
	*/
	
	var table = Rf.dc("table");
	var tbody = Rf.dc("tbody");
	table.appendChild(tbody);
	var tr = Rf.dc("tr");
	tbody.appendChild(tr);
	var td = Rf.dc("td");
	tr.appendChild(td);
	for(var i=0; i<this.CurrentImageData.length; i++){
		var a = Rf.dc("a");
		a.href = "images/galleries/"+this.CurrentImageData[i].path+this.CurrentImageData[i].filename;
		a.rel = "lightboxatomium";
		if(typeof this.CurrentImageData[i].title == "string" && this.CurrentImageData[i].title != ""){
			a.title = this.CurrentImageData[i].title;
		}
		a.innerHTML = "<img src='images/galleries/"+this.CurrentImageData[i].path.replace(this.CurrentImageData[i].basedir, "thumbs/")+this.CurrentImageData[i].filename+"' />";
		//galleryContent.appendContent(a);
		td.appendChild(a);
		var space = Rf.dc("span");
		space.innerHTML = "&nbsp;";
		//galleryContent.appendContent(space);
		td.appendChild(space);
		
		if(i%5 == 4){
			var br = Rf.dc("span");
			br.innerHTML = "<br/>";
			td.appendChild(br);
		}
	}
	galleryContent.appendContent(table);
	
	this.Nodes.galleryContent.appendChild(galleryContent.getNode());
	Slimbox.scanPage();
}

//cI
Rf.CImageGallery.prototype.showPart = function(aH){
	Rf.Session.setMaxContentWidth(746);
	var cIArray = aH.cI.split("|");
	if(Rf.empty(cIArray[1]) || cIArray[1] == "liste"){
		this.loadChooseData();
		//this.chooseSubMenuItem({Item:"imageGallery"});
		this.show({name:"imageGallery"});
	}
	/*
	else if(cIArray[1] == "kalender"){
		this.fillSatzung();
		this.chooseSubMenuItem({Item:"kalender"});
		this.show({name:"kalender"});
	}
	* */
};//{Rf.CContent} content, divIdSubMenu
Rf.CLinks = function(aH){
	
	Rf.CModule.call(this, aH);
	
	this.RfContent = aH.content;
	this.RfAuth = this.RfContent.RfAuth;
	this.DIV = Rf.dcModuleDIV();
	this.RfContent.DIV.appendChild(this.DIV);
	
	this.UserID = this.RfContent.UserID;
	
	this.RegisteredSubMenuItems = {};
	this.SubMenuItemDivs = {};
	this.SubPartDIVs = {};
	
	this.buildSubParts();
	this.createSiteIndicator({ModuleName: "Links"});
	
	//this.RegisteredSubMenuItems["liste"] = {label:"Liste"};
	
	this.createSubMenu();
}
Rf.CLinks.prototype = new Rf.CModule(false);


Rf.CLinks.prototype.buildSubParts = function(){
	this.createLinks();
}

Rf.CLinks.prototype.createLinks = function(){
	this.SubPartDIVs["links"] = Rf.dc("div");
	this.DIV.appendChild(this.SubPartDIVs["links"]);
}



Rf.CLinks.prototype.fillLinks = function(aH, force_flag){
	if(typeof aH == "undefined"){
		aH = {};
	}
	if(this.SubPartDIVs["links"].innerHTML != "" && (typeof force_flag != "boolean" || force_flag != true)){
		return true;
	}
	
	var request = new Rf.Loading.CRequest();
	request.rfLinks = this;
	request.Data = {
		username:Rf.Session.rfAuth.username,
		password:Rf.Session.rfAuth.password,
		userId:Rf.Session.rfAuth.userId,
		action:"getData"
	};
	
	request.onSuccess = function() {
		if(!Rf.empty(this.Response.error)){
			Rf.setError(this.Response.error);
		}
		else{
			var container = null;
			var t = null;
			var tb = null;
			var td = null;
			var tr = null;
			var i = 0;
			var j = 0;
			
			//iterate categories
			for(i=0; i<this.Response.data.length; i++){
				container = new Rf.CContentBox({
					Color: "d0c6b0",
					HeaderLeftText: this.Response.data[i]['label'],
					HeaderRightText: ""
				});
				
				t = Rf.dc("table");
				tb = Rf.dc("tbody");
				t.appendChild(tb);
				
				//iterate links
				for(j=0; j<this.Response.data[i]['links'].length; j++){
					
					tr = Rf.dc("tr");
						td = Rf.dc("td");
						td.innerHTML = this.Response.data[i]['links'][j]['name'];
						td.style.width = "220px";
						tr.appendChild(td);
						td = Rf.dc("td");
						td.innerHTML = "&nbsp;";
						tr.appendChild(td);
						td = Rf.dc("td");
						td.innerHTML = "<a href=\""+this.Response.data[i]['links'][j]['url']+"\" target=\"_blank\">"+this.Response.data[i]['links'][j]['url']+"</a>";
						tr.appendChild(td);
					tb.appendChild(tr);	
				}
				
				container.appendContent(t);
				this.rfLinks.SubPartDIVs.links.appendChild(container.getNode());
			}
		}
	}
	request.onError = function() {  } 
	request.onTimeout = function() {  } 
	var conn = new Rf.Loading.CConnectHTTPXML({ServiceUrl: "local/modules/Links/backend.php"}); 
	conn.sendRequest( request );
}


//cI
Rf.CLinks.prototype.showPart = function(aH){
	Rf.Session.setMaxContentWidth(850);
	var cIArray = aH.cI.split("|");
	if(Rf.empty(cIArray[1]) || cIArray[1] == "liste"){
		this.fillLinks();
		//this.chooseSubMenuItem({Item:"links"});
		this.show({name:"links"});
	}
	/*
	else if(cIArray[1] == "kalender"){
		this.fillSatzung();
		this.chooseSubMenuItem({Item:"kalender"});
		this.show({name:"kalender"});
	}
	* */
};
Rf.init();
