/*
##################### Do Not Remove This Header #####################
#                                                                   #
# Title: historyManager                                             #
# Description: <Fill in dsecription>                                #       
# Author: Jonathan Merriweather                                     #
# Company: Mertech Solutions                                        #
# Date Created: 7/18/2008, 2008                                     #
# License: Licensed for use with websites built                     #
#          by Mertech Solutions.                                    #
#                                                                   #
#####################################################################
*/
var historyManager=function(){var _getHash=function(){return location.hash.substring(1);};var _setHash=function($newHash){window.location.hash=$newHash;};var iframe=function(fn){$.frameReady(fn,"top.site",{remote:false});};$(function(){iframe(function(){historyManager.listener(_getHash());});});var checkContactUs=function(itemID){if(itemID=="contactUs"){top.site.content.scroll("#nationalPromotions",1000,function(){top.site.content.showItem("#"+itemID,function(){top.site.content.currentIndex=$.inArray("#"+itemID,top.site.content.items);});});_setHash(itemID);lastItem=itemID;return true;}else if(lastItem=="contactUs"&&itemID!="contactUs"){top.site.content.hideItem("#contactUs",function(){top.site.content.scroll("#"+itemID,1000);});_setHash(itemID);lastItem=itemID;return true;}return false;};var lastItem="";return{listener:function(historyHash){if(historyHash!=undefined&&historyHash!=""&&historyHash!="#"&&lastItem!=historyHash){historyManager.browse(historyHash);}},navigate:function(url){window.self.location=url;},browse:function(itemID){if(top.site.content==null){setTimeout("historyManager.browse('"+itemID+"');",20);return;}if(lastItem!=itemID){if(checkContactUs(itemID)==true){return;}top.site.content.scroll("#"+itemID,1000);_setHash(itemID);}},go:function(itemID){if(itemID.indexOf("#")!=-1){itemID=itemID.substring(1);}if(lastItem!=itemID){if(checkContactUs(itemID)==true){return;}top.site.content.scroll("#"+itemID,1000);_setHash(itemID);lastItem=itemID;}},back:function(){var newIndex=top.site.content.currentIndex-1;var item=top.site.content.items[newIndex];if(item!=undefined){historyManager.go(item);}},forward:function(){var newIndex=top.site.content.currentIndex+1;var item=top.site.content.items[newIndex];if(item!=undefined){historyManager.go(item);}}}}();