
	/* javascript functions that will be used on all pages ////////////////////////////////////////////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
		
		//--- nav fix
		
			/*var myWidth = $(document).width();
				$(".mainNav").width(myWidth);*/
		
		//--- get url path
		
			function getAbsolutePath() {
				var loc = window.location;
				var pathName = loc.pathname.substring(0, loc.pathname.lastIndexOf('/') + 1);
				return loc.href.substring(0, loc.href.length - ((loc.pathname + loc.search + loc.hash).length - pathName.length));
			}
			
		//--- open popup window
		
			function cchEcontentShowHideItemjs(daId){
			
				newwindow2=window.open('','name','height=600,width=800');
				
				var daDiv = "#cch_econtent_show_hide_item2_" + daId;
				var getText = $(daDiv).html();
				
				//alert(daDiv);				
				var tmp = newwindow2.document;
					tmp.write('<html><head><title></title>');
					tmp.write('');
					tmp.write('</head><body>');
					tmp.write('<p>'+getText+'</p>');
					tmp.write('</body></html>');
					tmp.close();
				
			}
			
		//-- functions --
		
			$(document).ready(function() {
				
				// calendar
				var ishere1 = $('#jMonthCalendar').get();
				if ( ishere1.length > 0 ){
					var param = '';
					GetCCHEcontent('calendar', param, 'contnet');
				}
				
				// federal forms
				var ishere2 = $('#cch_irs').get();
				if ( ishere2.length > 0 ){
					var param = '';
					GetCCHEcontent('irs', param, 'cch_irs');
				}
				
				// industry news
				var ishere3 = $('#cch_tax_alerts').get();
				if ( ishere3.length > 0 ){
					var param = '';
					GetCCHEcontent('tax_alerts', param, 'cch_tax_alerts');
				}
				
				var ishere4 = $('#cch_newsletters').get();
				if ( ishere4.length > 0 ){
					var param = '';
					GetCCHEcontent('newsletters', param, 'cch_newsletters');
				}
				
				var ishere5 = $('#cch_newslettersFooter').get();
				if ( ishere5.length > 0 ){
					var param = ''; //alert("get");
					GetCCHEcontent('newslettersFooter', param, 'cch_newslettersFooter');
				}
				
				// top nav drop-down servNav
				 $("ul.mainNav li").hover(function(){
    
					//$(this).addClass("hover");
					$('ul:first',this).css('visibility', 'visible');
				
				}, function(){
				
					//$(this).removeClass("hover");
					$('ul:first',this).css('visibility', 'hidden');
				
				});
				
				// client feed back ul
				$('.feedBack').click(function() {
					
					var getId = "#" + this.id + "Div";
					
					$('.open').slideUp('fast', function() {
						
						$(this).removeClass("open");
						$(getId).slideDown("slow").addClass("open");
						
					});
					
					return false;
					
				});
				
				// display services slider
				$('#rotate').cycle({
					fx: 'fade',
					speed:    3000, 
    				timeout:  5000 
				});
				
				// display services slider
				/*$('#slider').cycle({
					fx: 'fade',
					speed:    5000, 
    				timeout:  5000
				});*/
				
				//cch_tax_alerts
				/*$('#cch_tax_alerts').cycle({
					fx: 'scrollUp',
					speed:    3000, 
    				timeout:  5000
				});*/
				
				// navigation animation
				$('#sideBar ul li a').hover(function() { //mouse in
					$(this).animate({ paddingLeft: '10px' }, 200);
				}, function() { //mouse out
					$(this).animate({ paddingLeft: 0 }, 200);
				});
				
				// javascript opne 
				// window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=800,height=600');
				$('.openWindow').click(function() {
					
					var daURL = $(this).attr("href");
					window.open(daURL, 'win1', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=800,height=600');
					return false;
					
				});
				
				// search field -----
				$("#s").click(function() { 	if( $(this).val() == "Search Our Site" ){ $(this).val(""); } });
				
			});
		
		//---- open news article is there is a hash mark -------------- >>
			/*var articlei = 0;
			function openArticle(){
				
				if ( articlei == 1){
					
					// get the path and if there is a # see if we can do smothing with it
					var daAnchor = location.hash;
					var hashRemoved = daAnchor.split("#");
						
					if ( hashRemoved[1] != "" ){ cchEcontentShowHideItem( hashRemoved[1] ); alert( hashRemoved[1] ); }
					clearInterval( openArticleWait );
					
				} else { articlei = articlei+1; alert("added: " + articlei); }
			
			} var openArticleWait = setInterval(openArticle(), 500);*/
			
		//---
		
	/* end functions //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/

