/* JSMin */
/* 2011-10-28T21:59:08Z */
// MenuControl_jq.js

MenuEffect={Regular:1,Animated:2,Slide:3}
var desiredEffect=MenuEffect.Animated;sfHover=function()
{var webTimeout=1500;var tabletInterval=5000;var cssClass="sfhover";var tabletQueue;var liQueue=[];var divQueue=[];var LIs=$("#MainMenu").find("li");LIs.hover(function()
{if(isTablet)
{ShowMenu(this,tabletInterval);}
else
{ShowMenu(this,webTimeout);}},function()
{if(!isTablet)
{HideMenu(this);}});function ShowMenu(item,timeoutPeriod)
{var timeout=$(item).data("timeout");if(timeout)
{clearTimeout(timeout);}
var span=$(item).find("span:first");var link=$(item).find("a:first");var isValidMenu=$(item).hasClass("rmItem");if(isValidMenu)
{var isTopLevel=$(item).parent().hasClass("rmRootGroup");var thisDiv=$(item).find("div:first");if(desiredEffect==MenuEffect.Slide)
{if(isTablet)
{ClearAllMenus();}
thisDiv.css("z-index","10");if(!(thisDiv).is(':visible'))
{if(isTopLevel)
{thisDiv.addClass("hover").stop().show("slide",{direction:"up"},300);}
else
{thisDiv.addClass("hover").stop().show("slide",{direction:"left"},300);}}}
else if(desiredEffect==MenuEffect.Animated)
{if(isTopLevel)
{if(isTablet)
{ClearAllMenus();}
thisDiv.slideDown(300);}
else
{thisDiv.fadeIn(300);}}
else
{if(isTablet)
{ClearAllMenus();}
if(!(thisDiv).is(':visible'))
{thisDiv.show();}}
link.addClass(cssClass);if(isTablet)
{$(item).data("timeout",setTimeout
($.proxy(function(){HideMenu(this,true);},item),timeoutPeriod));}}}
function HideMenu(item,clearParentLinks)
{var isValidMenu=$(item).hasClass("rmItem");var isTopLevel=$(item).parent().hasClass("rmRootGroup");if(isValidMenu)
{var thisDiv=$(item).find("div:first");var link=$(item).find("a:first");if(desiredEffect==MenuEffect.Slide)
{if(isTopLevel)
{thisDiv.removeClass("hover").stop().hide("slide",{direction:"up"},300);}
else
{thisDiv.removeClass("hover").stop().hide("slide",{direction:"left"},300);}}
else if(desiredEffect==MenuEffect.Animated)
{if(isTopLevel)
{thisDiv.fadeOut(300);}
else
{thisDiv.fadeOut(300);}}
else
{if((thisDiv).is(':visible'))
{thisDiv.hide();}}
link.removeClass(cssClass);}
if(clearParentLinks)
{var parentLinks=$(item).parents("a.rmLink");for(i=0;i<parentLinks.length;i++)
{parentLinks.removeClass(cssClass);}}}
function fadeCallback()
{this.hide();};ClearQueue=function(item)
{for(i=0;i<LIs.length;i++)
{var thisLI=$(LIs[i]);if(LIs[i]!=item)
{var timeout=thisLI.data("timeout");if(timeout)
{thisLI.find("div:first").hide();clearTimeout(timeout);}}}}
ClearAllMenus=function()
{for(i=0;i<LIs.length;i++)
{HideMenu(LIs[i]);}}
getParentLinks=function(item)
{var aLinks=[];var myTest="";while(item!=null&&item.id!="MainMenu")
{var parentItem=item.parentNode.parentNode.parentNode;if(parentItem!=null)
{if(parentItem.tagName.toLowerCase()=="li"&&$(parentItem).children().length>0)
{aLinks.push($(parentItem).find("a:first").get());item=parentItem;}
else
{item=null;}}
else
{item=null;}}
return aLinks;}}
var myCount=0;var myLevel=0;var MenuController=jQuery.Class.create({init:function()
{this.Loaded=false;this.menu=$("#MainMenu");this.links=$("#MainMenu > a");this.submenus=$("#MainMenu > div");this.RightHandSpacer=10;this.ExtendedSpacer=30;this.DIVs=this.menu.find('.rmSlide');this.ULs=this.menu.find('ul');this.parentDivsEnable=new Array();this.DivsToHide=new Array();this.ULsEnable=new Array();if(isIE&&isIE6)
{for(var i=0;i<this.DIVs.length;i++)
{this.DIVs[i].innerHTML='<iframe style="border-right: 0px; border-top: 0px; filter: progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0); left: 0px; border-left: 0px; border-bottom: 0px; position: absolute; top: 0px;" tabIndex=-1 src="javascript:\'\';" frameBorder=0>Your browser does not support inline frames or is currently configured not to display inline frames.</iframe>'+this.DIVs[i].innerHTML;}}
var windowWidth=$(window).width();for(var j=0;j<this.ULs.length;j++)
{var thisUL=$(this.ULs[j]);var thisULClassNames=thisUL.attr("class");thisUL.css({"display":"block"});var ulWidth=thisUL.outerWidth();var ulHeight=thisUL.outerHeight();var maxDIVWidth=ulWidth+"px";var maxDIVHeight=ulHeight+"px";var maxLIWidth=(ulWidth-4)+"px";var hostingDiv=thisUL.parent();var MenuTitle=thisUL.parents("li:first").find("span:first").text();if(thisUL.hasClass("rmRootGroup"))
{myLevel=0;this.processUL(hostingDiv,this.ULs[j],true);}
else if(thisUL.hasClass("rmLevel1"))
{thisUL.css({"visibility":"hidden"});var leftPos="0px";if((hostingDiv.viewportOffset().left+ulWidth)>(windowWidth-this.RightHandSpacer))
{leftPos=((windowWidth-this.RightHandSpacer)-(hostingDiv.viewportOffset().left+ulWidth))+"px";}
hostingDiv.css({"display":"block","visibility":"hidden","width":maxDIVWidth,"height":maxDIVHeight,"overflow":"visible","z-index":"1","left":leftPos,"top":"23px"});thisUL.css({"display":"block","visibility":"visible","top":"0px","left":"0px","z-index":"14"});this.parentDivsEnable.push(hostingDiv);if(this.DivsToHide[1]==null)
{this.DivsToHide[1]=new Array();}
this.DivsToHide[1].push(hostingDiv);myLevel=1;this.processUL(hostingDiv,this.ULs[j]);}
else
{var startPos=thisULClassNames.indexOf("rmLevel")+"rmLevel".length;var levelCount=parseInt(thisULClassNames.substring(startPos));myLevel=levelCount;var parentDiv=hostingDiv.parents("div:first");var parentDivWidth=parentDiv.outerWidth();var parentDivViewPortLeft=parentDiv.viewportOffset().left;var leftPos=(parentDivWidth-11)+"px";var maxWidth=this.getMaxWidth(parentDiv);if((parentDivViewPortLeft+parentDivWidth+ulWidth)>(windowWidth-this.RightHandSpacer))
{leftPos=(-(maxWidth)+5)+"px";}
if(myLevel==2||myLevel==3)
{}
hostingDiv.css
({"display":"block","visibility":"hidden","width":maxDIVWidth,"height":maxDIVHeight,"overflow":"visible","left":leftPos,"top":"0px","z-index":"1"});thisUL.css({"display":"block","visibility":"visible","top":"0px","left":"0px"});this.parentDivsEnable.push(hostingDiv);if(this.DivsToHide[myLevel]==null)
{this.DivsToHide[myLevel]=new Array();}
this.DivsToHide[myLevel].push(hostingDiv);this.processUL(hostingDiv,this.ULs[j]);}
myCount++;}
for(var k=0;k<this.parentDivsEnable.length;k++)
{var tempDiv=$(this.parentDivsEnable[k]);if(isIE&&isIE6)
{var tempWidth=tempDiv.outerWidth()+"px";var tempHeight=tempDiv.outerHeight()+"px";var iframe=tempDiv.find("iframe")
if(iframe!=null)
{iframe.css({"width":tempWidth,"height":tempHeight});}}}
this.showHideDivs(false);this.Loaded=true;},processUL:function(parentDiv,ul,isTopLevel)
{if(isTopLevel==true)
{this.processLIs(ul,true);}
else
{var maxDIVWidth=$(ul).outerWidth();var maxLIWidth=(maxDIVWidth-4);this.processLIs(ul,false,maxLIWidth);}},processLIs:function(ul,isTopLevel,liWidth)
{if(!isTopLevel)
{var aWidthVal=(liWidth-4)+"px";var listItems=$(ul).find(" > li");var LIs=new Array();for(var i=0;i<listItems.length;i++)
{if($(listItems[i]).hasClass("rmItem"))
{if(liWidth!=null)
{$(listItems[i]).find("> a").css({"width":aWidthVal});}
LIs.push(listItems[i]);ul.removeChild(listItems[i]);}}
if(liWidth!=null)
{var isOldIE=false;if(isIE&&(isIE6||isIE7||IEState.QuirksMode||IEState.IE7StandardsMode))
{isOldIE=true;}
var newLI=document.createElement("li");newLI.setAttribute('class','rmTopRight rmTopShadowRight');if(isOldIE)
{$(newLI).css({"position":"absolute","width":"5px","height":"100%","top":"0","right":"-8px","padding":"0","backgroundImage":"url("+baseURL+"styles/Common/Menu/RoundedShadowRight.png)","backgroundPosition":"100% 0","backgroundAttachment":"scroll"});this.fixForIE(newLI);}
ul.appendChild(newLI);var newLI=document.createElement("li");newLI.setAttribute('class','rmBottomLeft rmBottomShadowLeft');if(isOldIE)
{$(newLI).css({"position":"absolute","width":"100%","height":"5px","bottom":"-8px","left":"1px","padding":"0","backgroundImage":"url("+baseURL+"styles/Common/Menu/RoundedShadowBottom.png)","backgroundPosition":"0 100%","backgroundAttachment":"scroll"});this.fixForIE(newLI);}
ul.appendChild(newLI);var newLI=document.createElement("li");newLI.setAttribute('class','rmBottomRight rmBottomShadowRight');if(isOldIE)
{$(newLI).css({"position":"absolute","width":"7px","height":"8px","bottom":"-8px","right":"-8px","padding":"0","backgroundImage":"url("+baseURL+"styles/Common/Menu/RoundedShadowBottom.png)","backgroundPosition":"100% 100%","backgroundAttachment":"scroll"});this.fixForIE(newLI);}
ul.appendChild(newLI);var newLI=document.createElement("li");newLI.setAttribute('class','rmTopRight');if(isOldIE)
{$(newLI).css({"position":"absolute","width":"4px","height":"100%","top":"0","right":"-4px","padding":"0","backgroundImage":"url("+baseURL+"styles/Black/Menu/rmRoundedRight.png)","backgroundPosition":"100% 0","backgroundAttachment":"scroll"});this.fixForIE(newLI);}
ul.appendChild(newLI);var newLI=document.createElement("li");newLI.setAttribute('class','rmBottomLeft');if(isOldIE)
{$(newLI).css({"position":"absolute","height":"4px","width":"5px","bottom":"-4px","left":"0px","padding":"0","backgroundImage":"url("+baseURL+"styles/Black/Menu/rmRoundedLeft.png)","backgroundPosition":"0 100%","backgroundAttachment":"scroll"});this.fixForIE(newLI);}
ul.appendChild(newLI);var newLI=document.createElement("li");newLI.setAttribute('class','rmBottomRight');if(isOldIE)
{$(newLI).css({"position":"absolute","height":"4px","width":"4px","bottom":"-4px","right":"-4px","padding":"0","backgroundImage":"url("+baseURL+"styles/Black/Menu/rmRoundedRight.png)","backgroundPosition":"100% 100%","backgroundAttachment":"scroll"});this.fixForIE(newLI);}
ul.appendChild(newLI);var newLI=document.createElement("li");newLI.setAttribute('class','rmTopFix');if(isOldIE)
{$(newLI).css({"position":"absolute","height":"4px","left":"5px","right":"0","top":"0","padding":"0","backgroundColor":"#4F4F4F","borderTopStyle":"solid","borderTopWidth":"1px","borderColor":"#080808","backgroundImage":"url("+baseURL+"styles/Black/Menu/rmVSprite.png)","backgroundPosition":"-1px 0","backgroundRepeat":"repeat-y"});this.fixForIE(newLI,liWidth,false);}
ul.appendChild(newLI);var newLI=document.createElement("li");newLI.setAttribute('class','rmBottomFix');if(isOldIE)
{$(newLI).css({"position":"absolute","height":"4px","bottom":"-4px","left":"5px","right":"0","padding":"0","backgroundColor":"#4F4F4F","borderBottomStyle":"solid","borderBottomWidth":"1px","borderColor":"#080808","backgroundImage":"url("+baseURL+"styles/Black/Menu/rmVSprite.png)","backgroundPosition":"-1px 0","backgroundRepeat":"repeat-y"});this.fixForIE(newLI,liWidth,false);}
ul.appendChild(newLI);}
for(i=0;i<LIs.length;i++)
{ul.appendChild(LIs[i]);}}},fixForIE:function(el,liWidth,setHeight)
{$(el).css({"fontSize":"0","lineHeight":"0"});},getMaxWidth:function(ul)
{var items=$(ul).children("> li");var maxWidth=0;for(i=0;i<items.length;i++)
{var width=$(items[i]).outerWidth();if(maxWidth<width)
{maxWidth=width;}}
return maxWidth;},fixULPositions:function()
{var windowWidth=$(window).width();this.showHideDivs(true);for(var j=0;j<this.ULs.length;j++)
{var thisUL=$(this.ULs[j]);var width=thisUL.outerWidth();var height=thisUL.outerHeight();var maxDIVWidth=width+"px";var maxDIVHeight=height+"px";var maxLIWidth=(width-4)+"px";var hostingDiv=thisUL.parent();if(thisUL.hasClass('rmRootGroup'))
{}
else if(thisUL.hasClass('rmLevel1'))
{var leftPos="0px";if((hostingDiv.viewportOffset().left+width)>(windowWidth-this.ExtendedSpacer))
{leftPos=((windowWidth-this.ExtendedSpacer)-(hostingDiv.viewportOffset().left+width))+"px";}
hostingDiv.css({"left":leftPos});}
else
{var parentDiv=hostingDiv.parents("div:eq(0)");var parentDivWidth=parentDiv.outerWidth();var parentDivViewPortLeft=parentDiv.viewportOffset().left;var leftPos=(parentDivWidth-11)+"px";var maxWidth=this.getMaxWidth(parentDiv);if((parentDivViewPortLeft+parentDivWidth+maxWidth)>(windowWidth-this.ExtendedSpacer))
{leftPos=(-(width)+1)+"px";}
hostingDiv.css({"left":leftPos});}}
this.showHideDivs(false);},showHideDivs:function(show)
{for(var l=this.DivsToHide.length-1;l>=0;l--)
{if(this.DivsToHide[l]!=null)
{for(var m=0;m<this.DivsToHide[l].length;m++)
{if(show)
{$(this.DivsToHide[l][m]).css({"display":"block","visibility":"hidden"});}
else
{$(this.DivsToHide[l][m]).css({"display":"none","visibility":"visible"});}}}}},hideDivsForIE7:function()
{if(isIE7||IEMode==IEState.IE7StandardsMode)
{for(i=0;i<this.DivsToHide.length;i++)
{var el=$(this.DivsToHide[i]);var linkName=el.parents("li:eq(0)").find("span:eq(0)").text();el.css({"display":""});if(el.css("display")=="block")
{el.css({"display":""});}
else
{}}}
else
{}}});var resizeTimeoutId;function window_resize()
{window.clearTimeout(resizeTimeoutId);resizeTimeoutId=window.setTimeout('window.MenuC.fixULPositions()',500);}
$(document).ready(function()
{window.MenuC=new MenuController();sfHover();});$(document).click(function(event)
{window.MenuC.fixULPositions();ClearAllMenus();});$(window).resize(function(event)
{if(!isIE6)
{window_resize();}});

