
var HORIZONTAL=0;var VERTICAL=1;var NORMAL=0;var TABBED=1;var ACCORDION=4;var ANIMATED_TABBED=5;


var SECTION_GROUP={};SECTION_GROUP.HasStyle=function(sSrcClassName,sStyleToCheck){var arrClassNames=sSrcClassName.split(" ");for(var i=0;i<arrClassNames.length;i++){if(arrClassNames[i]==sStyleToCheck)return true;}
return false;}
SECTION_GROUP.ReplaceStyle=function(sSrcClassName,sStyleToCheck,sStyleToReplace){var arrClassNames=sSrcClassName.split(" ");for(var i=0;i<arrClassNames.length;i++){if(arrClassNames[i]==sStyleToCheck)arrClassNames[i]=sStyleToReplace;}
return arrClassNames.join(" ");}
SECTION_GROUP.AddStyle=function(sSrcClassName,sStyleToAdd){var arrClassNames=sSrcClassName.split(" ");for(var i=0;i<arrClassNames.length;i++){if(arrClassNames[i]==sStyleToAdd)return sSrcClassName;}
arrClassNames.push(sStyleToAdd);return arrClassNames.join(" ");}
SECTION_GROUP.RemoveStyle=function(sSrcClassName,sStyleToRemove){var arrClassNames=sSrcClassName.split(" ");var arrClassNamesTmp=[];for(var i=0;i<arrClassNames.length;i++){if(arrClassNames[i]!=sStyleToRemove)arrClassNamesTmp.push(arrClassNames[i]);}
arrClassNames=arrClassNamesTmp;return arrClassNames.join(" ");}
SECTION_GROUP.DisplayCollapseIcon=function(sCollapseIconCellId,hashCollapseIconClassNames){var oCollapseIconCell=document.getElementById(sCollapseIconCellId);if(!oCollapseIconCell||typeof oCollapseIconCell=='undefined')
return;oCollapseIconCell.style.backgroundImage='';oCollapseIconCell.className=SECTION_GROUP.ReplaceStyle(oCollapseIconCell.className,hashCollapseIconClassNames.expand,hashCollapseIconClassNames.collapse);}
SECTION_GROUP.DisplayExpandIcon=function(sCollapseIconCellId,hashCollapseIconClassNames){var oCollapseIconCell=document.getElementById(sCollapseIconCellId);if(!oCollapseIconCell||typeof oCollapseIconCell=='undefined')
return;oCollapseIconCell.style.backgroundImage='';oCollapseIconCell.className=SECTION_GROUP.ReplaceStyle(oCollapseIconCell.className,hashCollapseIconClassNames.collapse,hashCollapseIconClassNames.expand);}
SECTION_GROUP.HideCollapseIcon=function(sCollapseIconCellId){var oCollapseIconCell=document.getElementById(sCollapseIconCellId);if(!oCollapseIconCell||typeof oCollapseIconCell=='undefined')
return;oCollapseIconCell.style.backgroundImage='none';}
SECTION_GROUP.SetSectionState=function(sRootID,hashHeaderClassNames,iMode){var arrChildren=SECTION_GROUP.GetDOMChildren(document.getElementById(sRootID));if(!arrChildren||typeof arrChildren=='undefined'){return;}
for(var i=0;i<arrChildren.length;i++){var oChild=arrChildren[i];if(typeof oChild.className!='undefined'){if(hashHeaderClassNames&&typeof hashHeaderClassNames!='undefined'){if(iMode==0){oChild.className=SECTION_GROUP.ReplaceStyle(oChild.className,hashHeaderClassNames.active,hashHeaderClassNames.inactive);}else{oChild.className=SECTION_GROUP.ReplaceStyle(oChild.className,hashHeaderClassNames.inactive,hashHeaderClassNames.active);}}}}}
SECTION_GROUP.SetActiveSectionState=function(sRootID,hashHeaderClassNames){SECTION_GROUP.SetSectionState(sRootID,hashHeaderClassNames,1);}
SECTION_GROUP.RemoveActiveSectionState=function(sRootID,hashHeaderClassNames){SECTION_GROUP.SetSectionState(sRootID,hashHeaderClassNames,0);}
SECTION_GROUP.SwapCollapseState=function(sCollapseIconCellId,sRootID,hashCollapseIconClassNames,hashHeaderClassNames){var oCollapseIconCell=document.getElementById(sCollapseIconCellId);if(SECTION_GROUP.HasStyle(oCollapseIconCell.className,hashCollapseIconClassNames.collapse)){SECTION_GROUP.DisplayExpandIcon(sCollapseIconCellId,hashCollapseIconClassNames);if(SECTION_GROUP.Effects[sRootID]&&typeof SECTION_GROUP.Effects[sRootID]!='undefiend'){SECTION_GROUP.Animations.Slide.show(SECTION_GROUP.Effects[sRootID]);}else{SECTION_GROUP.SetActiveSectionState(sRootID,hashHeaderClassNames);}}else{SECTION_GROUP.DisplayCollapseIcon(sCollapseIconCellId,hashCollapseIconClassNames);if(SECTION_GROUP.Effects[sRootID]&&typeof SECTION_GROUP.Effects[sRootID]!='undefiend'){SECTION_GROUP.Animations.Slide.hide(SECTION_GROUP.Effects[sRootID]);}else{SECTION_GROUP.RemoveActiveSectionState(sRootID,hashHeaderClassNames);}}}
SECTION_GROUP.OnSectionTitleClick=function(sUrl,sTarget,sCollapseIconCellId,sRootID,hashCollapseIconClassNames,hashHeaderClassNames,isSlidingTitle){if(typeof sUrl!='undefined'&&sUrl!='javascript:void(null)'){if(document.all&&isSlidingTitle)
window.open(sUrl,sTarget);return;}
var oCollapseIconCell=document.getElementById(sCollapseIconCellId);if(oCollapseIconCell&&typeof oCollapseIconCell!='undefined')
SECTION_GROUP.SwapCollapseState(sCollapseIconCellId,sRootID,hashCollapseIconClassNames,hashHeaderClassNames);}
SECTION_GROUP.GetDOMChildren=function(oRoot){if(!oRoot)return;var arrChildren=[oRoot];if(oRoot.childNodes&&oRoot.childNodes.length>0){for(var i=0;i<oRoot.childNodes.length;i++){var arrTempChildren=SECTION_GROUP.GetDOMChildren(oRoot.childNodes[i]);for(var j=0;j<arrTempChildren.length;j++){arrChildren.push(arrTempChildren[j]);}}}
return arrChildren;}
SECTION_GROUP.PushTab=function(iNodeID,iParentID,iPosition,iOrderIndex){var oHolder=document.getElementById('tab_button_container'+iParentID);var oCaption=document.getElementById('tab_caption_'+iNodeID);if(!oHolder||!oCaption)return;var attrClass=document.createAttribute('class');attrClass.nodeValue='tabButtonCell noactive';var attrId=document.createAttribute('id');attrId.nodeValue='tab_button_cell_'+iNodeID;var placeholder_id='placeholder_'+iParentID+'_'+iOrderIndex;var placeholder=$(placeholder_id);if(HORIZONTAL==iPosition){if(iOrderIndex>0){var oDelim=document.createElement('TD');var delimClass=document.createAttribute('class');delimClass.nodeValue='tabSeparator';oDelim.setAttributeNode(delimClass);oHolder.appendChild(oDelim);}
var oTD=document.createElement('TD');oTD.setAttributeNode(attrClass);oTD.setAttributeNode(attrId);oTD.appendChild(oCaption);oHolder.appendChild(oTD);if(placeholder){var ph=document.createElement('TD');ph.setAttribute('width','1');ph.innerHTML=placeholder.innerHTML;placeholder.dispose();oHolder.appendChild(ph);}}else{if(iOrderIndex>0){var oDelimTR=document.createElement('TR');var oDelimTD=document.createElement('TD');var delimClass=document.createAttribute('class');delimClass.nodeValue='tabSeparator';oDelimTD.setAttributeNode(delimClass);oDelimTR.appendChild(oDelimTD);oHolder.appendChild(oDelimTR);}
var oTR=document.createElement('TR');var oTD=document.createElement('TD');oTD.setAttributeNode(attrClass);oTD.setAttributeNode(attrId);oTD.appendChild(oCaption);oTR.appendChild(oTD);oHolder.appendChild(oTR);if(placeholder){var phw=document.createElement('TR');var ph=document.createElement('TD');ph.innerHTML=placeholder.innerHTML;placeholder.dispose();phw.appendChild(ph);oHolder.appendChild(phw);}}}
SECTION_GROUP.ShowCaption=function(oRoot,hashHeaderClassNames){if(typeof oRoot.className=='undefined'||!SECTION_GROUP.HasStyle(oRoot.className,'secTitle'))
{return;}
var arrChildren=SECTION_GROUP.GetDOMChildren(oRoot);for(var i=0;i<arrChildren.length;i++){var oChild=arrChildren[i];if(typeof oChild.className!='undefined'){if(SECTION_GROUP.HasStyle(oRoot.className,hashHeaderClassNames.inactive)){if(SECTION_GROUP.HasStyle(oChild.className,'imgExpanded')){oChild.className=SECTION_GROUP.ReplaceStyle(oChild.className,hashHeaderClassNames.active,hashHeaderClassNames.inactive);}
if(SECTION_GROUP.HasStyle(oChild.className,'imgCollapsed')){oChild.className=SECTION_GROUP.ReplaceStyle(oChild.className,hashHeaderClassNames.inactive,hashHeaderClassNames.active);}}else{if(SECTION_GROUP.HasStyle(oChild.className,'imgExpanded')){oChild.className=SECTION_GROUP.ReplaceStyle(oChild.className,hashHeaderClassNames.inactive,hashHeaderClassNames.active);}
if(SECTION_GROUP.HasStyle(oChild.className,'imgCollapsed')){oChild.className=SECTION_GROUP.ReplaceStyle(oChild.className,hashHeaderClassNames.active,hashHeaderClassNames.inactive);}}}}}
SECTION_GROUP.AnimateFade=function(id,direction,callback){var e=$(id);if(direction=='in'){e.setStyles({visibility:'visible',opacity:0});e.set('tween',{duration:200,onComplete:function(){callback(id,direction);}});e.tween('opacity',[0.0,1.0]);}
if(direction=='out'){e.setStyles({visibility:'visible',opacity:1});e.set('tween',{duration:200,onComplete:function(){callback(id,direction);}});e.tween('opacity',[1.0,0.0]);}}
SECTION_GROUP.AnimateNone=function(id,direction,callback){callback(id,direction);}
SECTION_GROUP.ShowTab=function(sNodeID,sID,hashCollapseIconClassNames,hashHeaderClassNames,callbacks){var oIcon=null;var arrChildren=SECTION_GROUP.GetDOMChildren(document.getElementById(sID));var objectToHide=null;var objectToDisplay=null;var inactivate=[];var activate=[];var elementClassToFade='secBody';if(!$defined(callbacks)){callbacks={animate:SECTION_GROUP.AnimateNone}}
if(arrChildren){for(var i=0;i<arrChildren.length;i++){var oChild=arrChildren[i];if(typeof oChild.className!='undefined'){if(SECTION_GROUP.HasStyle(oChild.className,hashHeaderClassNames.active)){if($(oChild).hasClass(elementClassToFade)){objectToHide=$(oChild);}
inactivate.push(oChild);}
SECTION_GROUP.ShowCaption(oChild,hashHeaderClassNames);if(SECTION_GROUP.HasStyle(oChild.className,'secIconCol'))oIcon=oChild;}}}
var oTab=document.getElementById('tab_button_cell_'+sNodeID);arrChildren=SECTION_GROUP.GetDOMChildren(oTab);if(arrChildren){for(var i=0;i<arrChildren.length;i++){var oChild=arrChildren[i];if(typeof oChild.className!='undefined'){if(SECTION_GROUP.HasStyle(oChild.className,hashHeaderClassNames.inactive)){activate.push(oChild);}}}}
var oSectionWrapper=document.getElementById('section_wrapper'+sNodeID);arrChildren=SECTION_GROUP.GetDOMChildren(oSectionWrapper.parentNode);if(arrChildren){for(var i=0;i<arrChildren.length;i++){var oChild=arrChildren[i];if(typeof oChild.className!='undefined'){if(SECTION_GROUP.HasStyle(oChild.className,hashHeaderClassNames.inactive)){if($(oChild).hasClass(elementClassToFade)){objectToDisplay=$(oChild);}
activate.push(oChild);}}}}
if(objectToHide!=null){if(objectToDisplay!=null){if(objectToHide.get('id')==null)objectToHide.set('id','sectionUniqueID'+Math.random());callbacks.animate($(objectToHide).get('id'),'out',function(id,direction){inactivate.each(function(oChild){oChild.className=SECTION_GROUP.ReplaceStyle(oChild.className,hashHeaderClassNames.active,hashHeaderClassNames.inactive);});activate.each(function(oChild){oChild.className=SECTION_GROUP.ReplaceStyle(oChild.className,hashHeaderClassNames.inactive,hashHeaderClassNames.active);});if(objectToDisplay.get('id')==null)$(objectToDisplay).set('id','sectionUniqueID'+Math.random());callbacks.animate($(objectToDisplay).get('id'),'in',function(id,direction){});});}}else{inactivate.each(function(oChild){oChild.className=SECTION_GROUP.ReplaceStyle(oChild.className,hashHeaderClassNames.active,hashHeaderClassNames.inactive);});activate.each(function(oChild){oChild.className=SECTION_GROUP.ReplaceStyle(oChild.className,hashHeaderClassNames.inactive,hashHeaderClassNames.active);});}}
SECTION_GROUP.getStyleProperty=function(obj,IEStyleProp,CSSStyleProp){if(obj.currentStyle)
return obj.currentStyle[IEStyleProp];else if(window.getComputedStyle)
return window.getComputedStyle(obj,"").getPropertyValue(CSSStyleProp);return null;}
SECTION_GROUP.OnLoad=function(sID,has_children){var oSGTable=document.getElementById(sID);var bFullWidth=0;if(oSGTable.className&&oSGTable.className.indexOf('sgHC')!=-1){var arrChildren=SECTION_GROUP.GetDOMChildren(oSGTable);if(arrChildren){for(var i=0;i<arrChildren.length;i++){if(arrChildren[i].className&&arrChildren[i].className.indexOf('sectionCell')!=-1){if(arrChildren[i].width){var sWidth=arrChildren[i].width;sWidth=sWidth.toString();if(sWidth.indexOf('%')!=-1){bFullWidth=1;}}else{bFullWidth=1;}}}}
if(has_children&&!bFullWidth)
oSGTable.width='';}}
SECTION_GROUP.GetAnchorName=function(){var anchor='';if(document.location.href.indexOf('#')!=-1)
anchor=document.location.href.substr(document.location.href.indexOf('#')+1);return anchor;}
SECTION_GROUP.BringAnchoredTabToFront=function(sgID,secNodeID){var anchor_name=SECTION_GROUP.GetAnchorName();var section=document.getElementById('section_wrapper'+secNodeID);var arrChildren=SECTION_GROUP.GetDOMChildren(section);if(arrChildren)
for(var i=0;i<arrChildren.length;i++)
if(arrChildren[i].type&&arrChildren[i].type=='anchor'&&arrChildren[i].name&&arrChildren[i].name==anchor_name)
ONLOAD_FUNCTIONS[ONLOAD_FUNCTIONS.length]="SECTION_GROUP.ShowTab("+
+secNodeID+","
+"'"+sgID+"',"
+"{collapse: 'secIconCol', expand: 'secIconExp'},"
+"{active: 'active', inactive: 'noactive'}"
+");";}
SECTION_GROUP.SetVisibleAccordionSectionOnInit=function(sgID,secNodeID,secIndex){var anchor_name=SECTION_GROUP.GetAnchorName();var section=document.getElementById('section_wrapper'+secNodeID);var arrChildren=SECTION_GROUP.GetDOMChildren(section);if(arrChildren)
for(var i=0;i<arrChildren.length;i++)
if(arrChildren[i].type&&arrChildren[i].type=='anchor'&&arrChildren[i].name&&arrChildren[i].name==anchor_name)
SECTION_GROUP.Animations.Accordion.options.show=secIndex;}
SECTION_GROUP.SetImagenEncoding=function(arrImages){if(!arrImages||typeof arrImages=='undefined'){return}
for(var i=0;i<arrImages.length;i++){var oImage=document.getElementById(arrImages[i]);if(!oImage||typeof oImage=='undefined'){return;}
if(oImage.src.indexOf('encoding=')==-1){oImage.src+='&encoding=%22'+SK.Singletons.env.get('encoding')+'%22';}}}


SECTION_GROUP.Effects={};SECTION_GROUP.Animations={};SECTION_GROUP.Animations.Slide={"effect":function(holder,options){var sec_body=holder.getParent('.secBody');if(sec_body.getStyle('padding')!='0px 0px 0px 0px'){var inner_wrapper=holder.getElements('.secBodyInnerWrapper');inner_wrapper.setStyle('padding',sec_body.getStyle('padding'));sec_body.setStyle('padding','0px');}
return new Fx.Slide(holder,options);},"show":function(fx){fx.cancel();fx.slideIn();},"hide":function(fx){fx.cancel();fx.slideOut();},"reset":function(fx){fx.cancel();fx.hide();},"options":{"transition":Fx.Transitions.Cubic.easeOut,"section_state_classes":{active:'active',inactive:'noactive'},"onStart":function(){if(this.to[0]==0){SECTION_GROUP.SetActiveSectionState(this.element.getProperty('root_id'),this.options.section_state_classes);}},"onComplete":function(){if(this.to[0]<0){SECTION_GROUP.RemoveActiveSectionState(this.element.getProperty('root_id'),this.options.section_state_classes);}}}};SECTION_GROUP.Animations.Accordion={"effect":function(togglers,elements,options){for(var i=0;i<elements.length;i++){var sec_body=elements[i].getParent('.secBody');if(sec_body.getStyle('padding')!='0px 0px 0px 0px'){var inner_wrapper=elements[i].getElements('.secBodyInnerWrapper');inner_wrapper.setStyle('padding',sec_body.getStyle('padding'));sec_body.setStyle('padding','0px');}}
if(SECTION_GROUP.Animations.Accordion.options.show==null){for(var i=0;i<elements.length;i++){var sec_body=elements[i].getParent('.secBody');section=elements[i];if(section&&section.hasClass('active')==false&&section.hasClass('noactive')==true){SECTION_GROUP.Animations.Accordion.options.show=i;break;}}}
return new Accordion(togglers,elements,options);},"options":{"show":null,"opacity":false,"transition":Fx.Transitions.Cubic.easeInOut,"section_state_classes":{active:'active',inactive:'noactive'},"collapse_icon_cell_classes":{collapse:'secIconCol',expand:'secIconExp'},"onActive":function(){SECTION_GROUP.SetActiveSectionState(this.elements[this.previous].getProperty('root_id'),this.options.section_state_classes);SECTION_GROUP.HideCollapseIcon(this.elements[this.previous].getProperty('collapse_icon_cell_id'));},"onComplete":function(){for(var i=0;i<this.elements.length;i++){if(i!=this.previous){SECTION_GROUP.RemoveActiveSectionState(this.elements[i].getProperty('root_id'),this.options.section_state_classes);SECTION_GROUP.DisplayCollapseIcon(this.elements[i].getProperty('collapse_icon_cell_id'),this.options.collapse_icon_cell_classes);}else{SECTION_GROUP.HideCollapseIcon(this.elements[i].getProperty('collapse_icon_cell_id'));}}}}};

