/*--------------------------------------------------------------------------*
 *-- GZipped/Cached by ScripZip (c)2006-2007( http://www.php-vision.de/ ) --*
 *--------------------------------------------------------------------------*
 *   Orginal Script Filesize: 26428    Bytes             
 *   GZipped Script Filesize: 5021    Bytes             
 *   GZip Compression Level : 9 GZip Compression Rate : 19.00% of Org. File *
 *   Last Time File Changed : Tue, 07 Sep 2010 12:37:16 GMT                 *
 *   Last Browser Load File : Tue, 07 Sep 2010 12:37:20 GMT                 *
 *   Cached File Expires on : Tue, 14 Sep 2010 12:37:20 GMT                 *
 *--------------------------------------------------------------------------*
 *-- Download ScripZip and speed up your Page on http://www.php-vision.de/  *
 *--------------------------------------------------------------------------*/




var Rico = {
 Version: '1.1.2',
 prototypeVersion: parseFloat(Prototype.Version.split(".")[0] + "." + Prototype.Version.split(".")[1])
}




document.getElementsByTagAndClassName = function(tagName, className) {
 if ( tagName == null )
 tagName = '*';
 var children = document.getElementsByTagName(tagName) || document.all; var elements = new Array();
 if ( className == null )
 return children;
 for (var i = 0; i < children.length; i++) {
 var child = children[i]; var classNames = child.className.split(' '); for (var j = 0; j < classNames.length; j++) {
 if (classNames[j] == className) {
 elements.push(child); break; }
 }
 }

 return elements;}


Rico.Accordion = Class.create();
Rico.Accordion.prototype = {

 initialize: function(container, options) {
 this.container = $(container); this.lastExpandedTab = null; this.accordionTabs = new Array(); this.setOptions(options); this._attachBehaviors(); if(!container) return;
 this.container.style.borderBottom = '1px solid ' + this.options.borderColor; if (this.options.onLoadShowTab >= this.accordionTabs.length)
 this.options.onLoadShowTab = 0;
 for ( var i=0 ; i < this.accordionTabs.length ; i++ ){ if (i != this.options.onLoadShowTab){
 this.accordionTabs[i].collapse(); this.accordionTabs[i].content.style.display = 'none'; }
 }
 this.lastExpandedTab = this.accordionTabs[this.options.onLoadShowTab]; if (this.options.panelHeight == 'auto'){
 var tabToCheck = (this.options.onloadShowTab === 0)? 1 : 0; var titleBarSize = parseInt(RicoUtil.getElementsComputedStyle(this.accordionTabs[tabToCheck].titleBar, 'height')); if (isNaN(titleBarSize))
 titleBarSize = this.accordionTabs[tabToCheck].titleBar.offsetHeight; 
 var totalTitleBarSize = this.accordionTabs.length * titleBarSize; var parentHeight = parseInt(RicoUtil.getElementsComputedStyle(this.container.parentNode, 'height')); if (isNaN(parentHeight))
 parentHeight = this.container.parentNode.offsetHeight; 
 this.options.panelHeight = parentHeight - totalTitleBarSize-2; }
 
 this.lastExpandedTab.content.style.height = this.options.panelHeight + "px"; this.lastExpandedTab.showExpanded(); this.lastExpandedTab.titleBar.style.fontWeight = this.options.expandedFontWeight;
 },

 setOptions: function(options) {
 this.options = {
 expandedBg : '#63699c',
 hoverBg : '#63699c',
 collapsedBg : '#6b79a5',
 expandedTextColor : '#ffffff',
 expandedFontWeight : 'bold',
 hoverTextColor : '#ffffff',
 collapsedTextColor : '#ced7ef',
 collapsedFontWeight : 'normal',
 hoverTextColor : '#ffffff',
 borderColor : '#1f669b',
 panelHeight : 200,
 onHideTab : null,
 onShowTab : null,
 onLoadShowTab : 0
 }
 Object.extend(this.options, options || {}); },

 showTabByIndex: function( anIndex, animate ) {
 var doAnimate = arguments.length == 1 ? true : animate; this.showTab( this.accordionTabs[anIndex], doAnimate ); },

 showTab: function( accordionTab, animate ) {
 if ( this.lastExpandedTab == accordionTab )
 return;
 var doAnimate = arguments.length == 1 ? true : animate;
 if ( this.options.onHideTab )
 this.options.onHideTab(this.lastExpandedTab);
 this.lastExpandedTab.showCollapsed(); var accordion = this; var lastExpandedTab = this.lastExpandedTab;
 this.lastExpandedTab.content.style.height = (this.options.panelHeight - 1) + 'px'; accordionTab.content.style.display = '';
 accordionTab.titleBar.style.fontWeight = this.options.expandedFontWeight;
 if ( doAnimate ) {
 new Rico.Effect.AccordionSize( this.lastExpandedTab.content,
 accordionTab.content,
 1,
 this.options.panelHeight,
 100, 10,
 { complete: function() {accordion.showTabDone(lastExpandedTab)} } ); this.lastExpandedTab = accordionTab; }
 else {
 this.lastExpandedTab.content.style.height = "1px"; accordionTab.content.style.height = this.options.panelHeight + "px"; this.lastExpandedTab = accordionTab; this.showTabDone(lastExpandedTab); }
 },

 showTabDone: function(collapsedTab) {
 collapsedTab.content.style.display = 'none'; this.lastExpandedTab.showExpanded(); if ( this.options.onShowTab )
 this.options.onShowTab(this.lastExpandedTab); },

 _attachBehaviors: function() {
 var panels = this._getDirectChildrenByTag(this.container, 'DIV'); for ( var i = 0 ; i < panels.length ; i++ ) {

 var tabChildren = this._getDirectChildrenByTag(panels[i],'DIV'); if ( tabChildren.length != 2 )
 continue; var tabTitleBar = tabChildren[0]; var tabContentBox = tabChildren[1]; this.accordionTabs.push( new Rico.Accordion.Tab(this,tabTitleBar,tabContentBox) ); }
 },

 _getDirectChildrenByTag: function(e, tagName) {
 var kids = new Array(); var allKids = e.childNodes; for( var i = 0 ; i < allKids.length ; i++ )
 if ( allKids[i] && allKids[i].tagName && allKids[i].tagName == tagName )
 kids.push(allKids[i]); return kids; }

};



Rico.Color = Class.create();
Rico.Color.prototype = {

 initialize: function(red, green, blue) {
 this.rgb = { r: red, g : green, b : blue }; },

 setRed: function(r) {
 this.rgb.r = r; },

 setGreen: function(g) {
 this.rgb.g = g; },

 setBlue: function(b) {
 this.rgb.b = b; },

 setHue: function(h) {

 var hsb = this.asHSB(); hsb.h = h;
 this.rgb = Rico.Color.HSBtoRGB(hsb.h, hsb.s, hsb.b); },

 setSaturation: function(s) {
 var hsb = this.asHSB(); hsb.s = s;
 this.rgb = Rico.Color.HSBtoRGB(hsb.h, hsb.s, hsb.b); },

 setBrightness: function(b) {
 var hsb = this.asHSB(); hsb.b = b;
 this.rgb = Rico.Color.HSBtoRGB( hsb.h, hsb.s, hsb.b ); },

 darken: function(percent) {
 var hsb = this.asHSB(); this.rgb = Rico.Color.HSBtoRGB(hsb.h, hsb.s, Math.max(hsb.b - percent,0)); },

 brighten: function(percent) {
 var hsb = this.asHSB(); this.rgb = Rico.Color.HSBtoRGB(hsb.h, hsb.s, Math.min(hsb.b + percent,1)); },

 blend: function(other) {
 this.rgb.r = Math.floor((this.rgb.r + other.rgb.r)/2); this.rgb.g = Math.floor((this.rgb.g + other.rgb.g)/2); this.rgb.b = Math.floor((this.rgb.b + other.rgb.b)/2); },

 isBright: function() {
 var hsb = this.asHSB(); return this.asHSB().b > 0.5; },

 isDark: function() {
 return ! this.isBright(); },

 asRGB: function() {
 return "rgb(" + this.rgb.r + "," + this.rgb.g + "," + this.rgb.b + ")"; },

 asHex: function() {
 return "#" + this.rgb.r.toColorPart() + this.rgb.g.toColorPart() + this.rgb.b.toColorPart(); },

 asHSB: function() {
 return Rico.Color.RGBtoHSB(this.rgb.r, this.rgb.g, this.rgb.b); },

 toString: function() {
 return this.asHex(); }

};
Rico.Color.createFromHex = function(hexCode) {
 if(hexCode.length==4) {
 var shortHexCode = hexCode; var hexCode = '#'; for(var i=1;i<4;i++) hexCode += (shortHexCode.charAt(i) + 
shortHexCode.charAt(i)); }
 if ( hexCode.indexOf('#') == 0 )
 hexCode = hexCode.substring(1); var red = hexCode.substring(0,2); var green = hexCode.substring(2,4); var blue = hexCode.substring(4,6); return new Rico.Color( parseInt(red,16), parseInt(green,16), parseInt(blue,16) );}


Rico.Color.createColorFromBackground = function(elem) {

 var actualColor = RicoUtil.getElementsComputedStyle($(elem), "backgroundColor", "background-color");
 if ( actualColor == "transparent" && elem.parentNode )
 return Rico.Color.createColorFromBackground(elem.parentNode);
 if ( actualColor == null )
 return new Rico.Color(255,255,255);
 if ( actualColor.indexOf("rgb(") == 0 ) {
 var colors = actualColor.substring(4, actualColor.length - 1 ); var colorArray = colors.split(","); return new Rico.Color( parseInt( colorArray[0] ),
 parseInt( colorArray[1] ),
 parseInt( colorArray[2] ) );
 }
 else if ( actualColor.indexOf("#") == 0 ) {
 return Rico.Color.createFromHex(actualColor); }
 else
 return new Rico.Color(255,255,255);}

Rico.Color.HSBtoRGB = function(hue, saturation, brightness) {

 var red = 0; var green = 0; var blue = 0;
 if (saturation == 0) {
 red = parseInt(brightness * 255.0 + 0.5);  green = red;  blue = red; }
 else {
 var h = (hue - Math.floor(hue)) * 6.0; var f = h - Math.floor(h); var p = brightness * (1.0 - saturation); var q = brightness * (1.0 - saturation * f); var t = brightness * (1.0 - (saturation * (1.0 - f)));
 switch (parseInt(h)) {
 case 0:
 red = (brightness * 255.0 + 0.5); green = (t * 255.0 + 0.5); blue = (p * 255.0 + 0.5); break; case 1:
 red = (q * 255.0 + 0.5); green = (brightness * 255.0 + 0.5); blue = (p * 255.0 + 0.5); break; case 2:
 red = (p * 255.0 + 0.5); green = (brightness * 255.0 + 0.5); blue = (t * 255.0 + 0.5); break; case 3:
 red = (p * 255.0 + 0.5); green = (q * 255.0 + 0.5); blue = (brightness * 255.0 + 0.5); break; case 4:
 red = (t * 255.0 + 0.5); green = (p * 255.0 + 0.5); blue = (brightness * 255.0 + 0.5); break; case 5:
 red = (brightness * 255.0 + 0.5); green = (p * 255.0 + 0.5); blue = (q * 255.0 + 0.5); break;  }
 }

 return { r : parseInt(red), g : parseInt(green) , b : parseInt(blue) };}

Rico.Color.RGBtoHSB = function(r, g, b) {

 var hue; var saturation; var brightness;
 var cmax = (r > g) ? r : g; if (b > cmax)
 cmax = b;
 var cmin = (r < g) ? r : g; if (b < cmin)
 cmin = b;
 brightness = cmax / 255.0; if (cmax != 0)
 saturation = (cmax - cmin)/cmax; else
 saturation = 0;
 if (saturation == 0)
 hue = 0; else {
 var redc = (cmax - r)/(cmax - cmin);  var greenc = (cmax - g)/(cmax - cmin);  var bluec = (cmax - b)/(cmax - cmin);
  if (r == cmax)
   hue = bluec - greenc;  else if (g == cmax)
   hue = 2.0 + redc - bluec; else
   hue = 4.0 + greenc - redc;
  hue = hue / 6.0;  if (hue < 0)
   hue = hue + 1.0; }

 return { h : hue, s : saturation, b : brightness };}


Rico.Corner = {

 round: function(e, options) {
 var e = $(e); this._setOptions(options);
 var color = this.options.color; if ( this.options.color == "fromElement" )
 color = this._background(e);
 var bgColor = this.options.bgColor; if ( this.options.bgColor == "fromParent" )
 bgColor = this._background(e.offsetParent);
 this._roundCornersImpl(e, color, bgColor); },

 _roundCornersImpl: function(e, color, bgColor) {
 if(this.options.border)
 this._renderBorder(e,bgColor); if(this._isTopRounded())
 this._roundTopCorners(e,color,bgColor); if(this._isBottomRounded())
 this._roundBottomCorners(e,color,bgColor); },

 _renderBorder: function(el,bgColor) {
 var borderValue = "1px solid " + this._borderColor(bgColor); var borderL = "border-left: " + borderValue; var borderR = "border-right: " + borderValue; var style = "style='" + borderL + ";" + borderR + "'"; el.innerHTML = "<div " + style + ">" + el.innerHTML + "</div>"
 },

 _roundTopCorners: function(el, color, bgColor) {
 var corner = this._createCorner(bgColor); for(var i=0 ; i < this.options.numSlices ; i++ )
 corner.appendChild(this._createCornerSlice(color,bgColor,i,"top")); el.style.paddingTop = 0; el.insertBefore(corner,el.firstChild); },

 _roundBottomCorners: function(el, color, bgColor) {
 var corner = this._createCorner(bgColor); for(var i=(this.options.numSlices-1) ; i >= 0 ; i-- )
 corner.appendChild(this._createCornerSlice(color,bgColor,i,"bottom")); el.style.paddingBottom = 0; el.appendChild(corner); },

 _createCorner: function(bgColor) {
 var corner = document.createElement("div"); corner.style.backgroundColor = (this._isTransparent() ? "transparent" : bgColor); return corner; },

 _createCornerSlice: function(color,bgColor, n, position) {
 var slice = document.createElement("span");
 var inStyle = slice.style; inStyle.backgroundColor = color; inStyle.display = "block"; inStyle.height = "1px"; inStyle.overflow = "hidden"; inStyle.fontSize = "1px";
 var borderColor = this._borderColor(color,bgColor); if ( this.options.border && n == 0 ) {
 inStyle.borderTopStyle = "solid"; inStyle.borderTopWidth = "1px"; inStyle.borderLeftWidth = "0px"; inStyle.borderRightWidth = "0px"; inStyle.borderBottomWidth = "0px"; inStyle.height = "0px"; inStyle.borderColor = borderColor; }
 else if(borderColor) {
 inStyle.borderColor = borderColor; inStyle.borderStyle = "solid"; inStyle.borderWidth = "0px 1px"; }

 if ( !this.options.compact && (n == (this.options.numSlices-1)) )
 inStyle.height = "2px";
 this._setMargin(slice, n, position); this._setBorder(slice, n, position); return slice; },

 _setOptions: function(options) {
 this.options = {
 corners : "all",
 color : "fromElement",
 bgColor : "fromParent",
 blend : true,
 border : false,
 compact : false
 }
 Object.extend(this.options, options || {});
 this.options.numSlices = this.options.compact ? 2 : 4; if ( this._isTransparent() )
 this.options.blend = false; },

 _whichSideTop: function() {
 if ( this._hasString(this.options.corners, "all", "top") )
 return "";
 if ( this.options.corners.indexOf("tl") >= 0 && this.options.corners.indexOf("tr") >= 0 )
 return "";
 if (this.options.corners.indexOf("tl") >= 0)
 return "left"; else if (this.options.corners.indexOf("tr") >= 0)
 return "right"; return ""; },

 _whichSideBottom: function() {
 if ( this._hasString(this.options.corners, "all", "bottom") )
 return "";
 if ( this.options.corners.indexOf("bl")>=0 && this.options.corners.indexOf("br")>=0 )
 return "";
 if(this.options.corners.indexOf("bl") >=0)
 return "left"; else if(this.options.corners.indexOf("br")>=0)
 return "right"; return ""; },

 _borderColor : function(color,bgColor) {
 if ( color == "transparent" )
 return bgColor; else if ( this.options.border )
 return this.options.border; else if ( this.options.blend )
 return this._blend( bgColor, color ); else
 return ""; },


 _setMargin: function(el, n, corners) {
 var marginSize = this._marginSize(n); var whichSide = corners == "top" ? this._whichSideTop() : this._whichSideBottom();
 if ( whichSide == "left" ) {
 el.style.marginLeft = marginSize + "px"; el.style.marginRight = "0px"; }
 else if ( whichSide == "right" ) {
 el.style.marginRight = marginSize + "px"; el.style.marginLeft = "0px"; }
 else {
 el.style.marginLeft = marginSize + "px"; el.style.marginRight = marginSize + "px"; }
 },

 _setBorder: function(el,n,corners) {
 var borderSize = this._borderSize(n); var whichSide = corners == "top" ? this._whichSideTop() : this._whichSideBottom(); if ( whichSide == "left" ) {
 el.style.borderLeftWidth = borderSize + "px"; el.style.borderRightWidth = "0px"; }
 else if ( whichSide == "right" ) {
 el.style.borderRightWidth = borderSize + "px"; el.style.borderLeftWidth = "0px"; }
 else {
 el.style.borderLeftWidth = borderSize + "px"; el.style.borderRightWidth = borderSize + "px"; }
 if (this.options.border != false)
 el.style.borderLeftWidth = borderSize + "px"; el.style.borderRightWidth = borderSize + "px"; },

 _marginSize: function(n) {
 if ( this._isTransparent() )
 return 0;
 var marginSizes = [ 5, 3, 2, 1 ]; var blendedMarginSizes = [ 3, 2, 1, 0 ]; var compactMarginSizes = [ 2, 1 ]; var smBlendedMarginSizes = [ 1, 0 ];
 if ( this.options.compact && this.options.blend )
 return smBlendedMarginSizes[n]; else if ( this.options.compact )
 return compactMarginSizes[n]; else if ( this.options.blend )
 return blendedMarginSizes[n]; else
 return marginSizes[n]; },

 _borderSize: function(n) {
 var transparentBorderSizes = [ 5, 3, 2, 1 ]; var blendedBorderSizes = [ 2, 1, 1, 1 ]; var compactBorderSizes = [ 1, 0 ]; var actualBorderSizes = [ 0, 2, 0, 0 ];
 if ( this.options.compact && (this.options.blend || this._isTransparent()) )
 return 1; else if ( this.options.compact )
 return compactBorderSizes[n]; else if ( this.options.blend )
 return blendedBorderSizes[n]; else if ( this.options.border )
 return actualBorderSizes[n]; else if ( this._isTransparent() )
 return transparentBorderSizes[n]; return 0; },

 _hasString: function(str) { for(var i=1 ; i<arguments.length ; i++) if (str.indexOf(arguments[i]) >= 0) return true; return false; },
 _blend: function(c1, c2) { var cc1 = Rico.Color.createFromHex(c1); cc1.blend(Rico.Color.createFromHex(c2)); return cc1; },
 _background: function(el) { try { return Rico.Color.createColorFromBackground(el).asHex(); } catch(err) { return "#ffffff"; } },
 _isTransparent: function() { return this.options.color == "transparent"; },
 _isTopRounded: function() { return this._hasString(this.options.corners, "all", "top", "tl", "tr"); },
 _isBottomRounded: function() { return this._hasString(this.options.corners, "all", "bottom", "bl", "br"); },
 _hasSingleTextChild: function(el) { return el.childNodes.length == 1 && el.childNodes[0].nodeType == 3; }
}


var RicoUtil = {

 getElementsComputedStyle: function ( htmlElement, cssProperty, mozillaEquivalentCSS) {
 if ( arguments.length == 2 )
 mozillaEquivalentCSS = cssProperty;
 var el = $(htmlElement); if ( el.currentStyle )
 return el.currentStyle[cssProperty]; else
 return document.defaultView.getComputedStyle(el, null).getPropertyValue(mozillaEquivalentCSS); },

 createXmlDocument : function() {
 if (document.implementation && document.implementation.createDocument) {
 var doc = document.implementation.createDocument("", "", null);
 if (doc.readyState == null) {
 doc.readyState = 1; doc.addEventListener("load", function () {
 doc.readyState = 4; if (typeof doc.onreadystatechange == "function")
 doc.onreadystatechange(); }, false); }

 return doc; }

 if (window.ActiveXObject)
 return Try.these(
 function() { return new ActiveXObject('MSXML2.DomDocument') },
 function() { return new ActiveXObject('Microsoft.DomDocument')},
 function() { return new ActiveXObject('MSXML.DomDocument') },
 function() { return new ActiveXObject('MSXML3.DomDocument') }
 ) || false;
 return null; },

 getContentAsString: function( parentNode ) {
 return parentNode.xml != undefined ? 
 this._getContentAsStringIE(parentNode) :
 this._getContentAsStringMozilla(parentNode); },

 _getContentAsStringIE: function(parentNode) {
 var contentStr = ""; for ( var i = 0 ; i < parentNode.childNodes.length ; i++ ) {
 var n = parentNode.childNodes[i]; if (n.nodeType == 4) {
 contentStr += n.nodeValue; }
 else {
 contentStr += n.xml; }
 }
 return contentStr; },

 _getContentAsStringMozilla: function(parentNode) {
 var xmlSerializer = new XMLSerializer(); var contentStr = ""; for ( var i = 0 ; i < parentNode.childNodes.length ; i++ ) {
 var n = parentNode.childNodes[i]; if (n.nodeType == 4) { contentStr += n.nodeValue; }
 else {
 contentStr += xmlSerializer.serializeToString(n); }
 }
 return contentStr; },

 toViewportPosition: function(element) {
 return this._toAbsolute(element,true); },

 toDocumentPosition: function(element) {
 return this._toAbsolute(element,false); },

 
 _toAbsolute: function(element,accountForDocScroll) {

 if ( navigator.userAgent.toLowerCase().indexOf("msie") == -1 )
 return this._toAbsoluteMozilla(element,accountForDocScroll);
 var x = 0; var y = 0; var parent = element; while ( parent ) {

 var borderXOffset = 0; var borderYOffset = 0; if ( parent != element ) {
 var borderXOffset = parseInt(this.getElementsComputedStyle(parent, "borderLeftWidth" )); var borderYOffset = parseInt(this.getElementsComputedStyle(parent, "borderTopWidth" )); borderXOffset = isNaN(borderXOffset) ? 0 : borderXOffset; borderYOffset = isNaN(borderYOffset) ? 0 : borderYOffset; }

 x += parent.offsetLeft - parent.scrollLeft + borderXOffset; y += parent.offsetTop - parent.scrollTop + borderYOffset; parent = parent.offsetParent; }

 if ( accountForDocScroll ) {
 x -= this.docScrollLeft(); y -= this.docScrollTop(); }

 return { x:x, y:y }; },

 
 _toAbsoluteMozilla: function(element,accountForDocScroll) {
 var x = 0; var y = 0; var parent = element; while ( parent ) {
 x += parent.offsetLeft; y += parent.offsetTop; parent = parent.offsetParent; }

 parent = element; while ( parent &&
 parent != document.body &&
 parent != document.documentElement ) {
 if ( parent.scrollLeft )
 x -= parent.scrollLeft; if ( parent.scrollTop )
 y -= parent.scrollTop; parent = parent.parentNode; }

 if ( accountForDocScroll ) {
 x -= this.docScrollLeft(); y -= this.docScrollTop(); }

 return { x:x, y:y }; },

 docScrollLeft: function() {
 if ( window.pageXOffset )
 return window.pageXOffset; else if ( document.documentElement && document.documentElement.scrollLeft )
 return document.documentElement.scrollLeft; else if ( document.body )
 return document.body.scrollLeft; else
 return 0; },

 docScrollTop: function() {
 if ( window.pageYOffset )
 return window.pageYOffset; else if ( document.documentElement && document.documentElement.scrollTop )
 return document.documentElement.scrollTop; else if ( document.body )
 return document.body.scrollTop; else
 return 0; }

};