
/* this function is used to resolve the browser rendering difference associated with partial pixel values
** associated with the white background of the sub-menu. */
function resetWhiteBg() {
	//Safari or IE7
	if ($.browser.safari || ($.browser.msie && $.browser.version == '7.0') ) {
		$(".nav_container_white").addClass("nav_white_safari");  
	}
  
  
	//Firefox 2 (Mozilla 1.8.x.x)
	if ($.browser.mozilla && $.browser.version.substr(0,3) == '1.8') {
		var img = new Image();
		img.src = "../images/navigation_white_bg_enhanceright.png";
		
		$(".nav_container_white").addClass("nav_white_ff2");
	}
  
}



/* the setting below is used with the dynamic/scroll pages (the h3 tag is appended to this:*/
var page_title_prefix = 'ARS | ';
var slide_header_height = 273;


var services_slides_animating = false;
var nav_container_white_visible = false;
var currently_animating = false;
var current_home_idx = 0;





function deep_link_handler() {
	
				   
				   
	/*************
	* DEEP LINKS *
	*************/
	var hash = self.document.location.hash;
	hash = (hash != "") ? hash.substring(1) : "";
	switch (main_nav) {	/*main_nav set via server-side */
		case "services":
			if (hash == "")
				break;
		
			//remove current from whatever is currently selected
			$("li#nav_services ul.sub_nav li.current").removeClass("current");
			
			//change menu accordingly
			$("li#nav_services ul.sub_nav li#nav_" + hash).addClass("current");
			
			//reset all other slides
			$(".services_container a.deep_link").parent().css('display', 'none');
			
			//set deep linked slide
			var current_slide = $(".services_container a#slide_nav_" + hash);
			
			current_slide.parent().css('display', 'block');
			current_slide.parent().children(".main_body").css( {left: '-500px', opacity: 1} );
			current_slide.parent().children(".header").css( {left: '0', opacity: 1} );
			
			$(".services_container").css('height', (slide_header_height + current_slide.parent().children(".main_body").height()));
			document.title = page_title_prefix + current_slide.parent().children(".header").children("h3").text();
			
		break;
		
		
		case "industry":
			if (hash == "") break;
		
			//remove current from whatever is currently selected
			$("li#nav_industry ul.sub_nav li.current").removeClass("current");
			
			//change menu accordingly
			$("li#nav_industry ul.sub_nav li#nav_" + hash).addClass("current");
			
			//reset all other slides
			$(".industry_container a.deep_link").parent().css('display', 'none');
			
			//set deep linked slide
			var current_slide = $(".industry_container a#slide_nav_" + hash);
			
			current_slide.parent().css('display', 'block');
			current_slide.parent().children(".main_body").css( {left: '-500px', opacity: 1} );
			current_slide.parent().children(".header").css( {left: '0', opacity: 1} );
			
			$(".industry_container").css('height', (slide_header_height + current_slide.parent().children(".main_body").height()));
			document.title = page_title_prefix + current_slide.parent().children(".header").children("h3").text();
			
		break;
		
		case "company":
			if (hash == "")
				break;
		
			//remove current from whatever is currently selected
			$("li#nav_company ul.sub_nav li.current").removeClass("current");
			
			//change menu accordingly
			$("li#nav_company ul.sub_nav li#nav_" + hash).addClass("current");
			
			//reset all other slides
			$(".company_container a.deep_link").parent().css('display', 'none');
			
			//set deep linked slide
			var current_slide = $(".company_container a#slide_nav_" + hash);
			
			current_slide.parent().css('display', 'block');
			current_slide.parent().children(".main_body").css( {left: '-500px', opacity: 1} );
			current_slide.parent().children(".header").css( {left: '0', opacity: 1} );
			
			$(".company_container").css('height', (slide_header_height + current_slide.parent().children(".main_body").height()));
			document.title = page_title_prefix + current_slide.parent().children(".header").children("h3").text();
			
		break;
		
		
	};  

}



window.onload = function() {
	
	deep_link_handler();

};







$(document).ready(function() {
	resetWhiteBg();
	deep_link_handler();

	jQuery.preloadImages = function() {
	  for(var i = 0; i<arguments.length; i++)
		jQuery("<img>").attr("src", arguments[i]);
	}
	
	/***************************
	* PRELOAD IMPORTANT IMAGES *
	***************************/
	  
	if (page_idx == 0) {	// set by PHP - value of 0 if this is the user's first page on the site.
		  
		  
		///////////////////// NAVIGATION ELEMENTS (define these manually) /////////////////////////
		  
		  
		//IE6 Images
		if ($.browser.msie && $.browser.version == '6.0') {
			$.preloadImages("/images/navigation_top.gif", "/images/navigation_sub_services.gif", "/images/navigation_sub_industry.gif", "/images/navigation_sub_company.gif", "/images/navigation_white_bg.gif");
							
		//all other (modern) browser images
		} else {
			$.preloadImages("/images/navigation_top.png", "/images/navigation_white_bg.png", "/images/navigation_white_bg_enhanceleft.png", "/images/navigation_white_bg_safari.png", "/images/navigation_top.png", "/images/navigation_sub_services.png", "/images/navigation_sub_industry.png", "/images/navigation_sub_company.png");
			
		}
    }
	
	$.preloadImages("/images/navigation_black_bg2.gif");
	
	///////////////// HEADER BACKGROUND IMAGES (read dynamically) ///////////////////
	$(".header").each(function() {	// all lifestyle images are set as background-image for .header
	
		var img_url = $(this).css('background-image');

		if (img_url != 'none') {
			img_url = img_url.substr(4);
			img_url = img_url.substr(0, img_url.length-1);	// remove url( and ) [css]
			$.preloadImages(img_url);
		}
	
	});
	
	

	
	
	
	/********************
	* INITIAL NAV SETUP *
	********************/
	//find .current links & add .ahover
	$("ul.main_nav>li.current>a").addClass("ahover");				   
						   

	
	// if there is a li.current with ul.sub_nav, show .nav_container_white.
	$("ul.main_nav>li.current:has(ul.sub_nav)").each(function() {
		nav_container_white_visible = true;
		$(".nav_container_white").css( { display: 'block', height: "34px"} );
		
		//add ahover class
		//$(this).children('a').addClass("ahover");

	});

	var main_nav_element_config = {
		over: function() {
			//console.log("ul.main_nav>li>a HOVER OVER");
			
			var this_sub_nav = $(this).parent().children("ul.sub_nav");
			
			//find ul.main_nav>li.ahover and remove, only added on hover out..
			$("ul.main_nav>li>a.ahover").each(function() {
				$(this).removeClass("ahover");
			});
			
			//if there is a sub_nav, make sure the main_nav>li stays hovered.
			if (this_sub_nav.length > 0) {
				//console.log("found ul.sub_nav, make sure main_nav>li stays hovered");
				$(this).addClass("ahover");
			}
			
			//this li has ul.sub_nav && .nav_container_white is DOWN && this li IS NOT CURRENT
			if (this_sub_nav.length > 0 && nav_container_white_visible && !$(this).parent().hasClass("current") && !currently_animating) {
				//console.log("this li has ul.sub_nav && nav_container_white is DOWN && this li is not current");
				$("ul.sub_nav").css('height', '0px');
				this_sub_nav.css('height', '34px');
				
			//if this li has ul.sub_nav && .nav_container_white is UP
			} else if (this_sub_nav.length > 0 && !nav_container_white_visible) {
				//console.log("if this li has ul.sub_nav && .nav_container_white is UP");
				currently_animating = true;
				$(".nav_container_white").animate( {height: '34px'}, {queue: true, duration: 300, easing: 'easeOutExpo'});
				this_sub_nav.animate( {height: '34px'}, {queue: true, duration: 300, easing: 'easeOutExpo', complete: function() { currently_animating = false; }});
				nav_container_white_visible = true;
				
				
				
			//if this li does NOT have ul.sub_nav && nav_container_white is DOWN
			} else if (this_sub_nav.length == 0 && nav_container_white_visible) {
				//console.log("if this li does NOT have ul.sub_nav && nav_container_white is DOWN");
				//alert("roll up");
				$(".nav_container_white").stop().animate( { height: '0px'}, {queue: true, duration: 300, easing: 'easeOutExpo', complete: function() { $(".nav_container_white").css("display", "none"); }});
				$("ul.sub_nav").stop().animate( { height: '0px'}, {queue: true, duration: 300, easing: 'easeOutExpo', complete: function() { }  });
				nav_container_white_visible = false;
				
				
			} else if (this_sub_nav.length > 0 && nav_container_white_visible && !currently_animating) {
				//console.log("if has ul.sub_nav && nav_container_white is DOWN");
				//alert("this_sub_nav.length: " + this_sub_nav.le0ngth + "\nnav_container_white_visible: " + nav_container_white_visible);	
				$("ul.sub_nav").css('height', '0px');
				this_sub_nav.css('height', '34px');
			}
			
	
			
			
			
			//alert($(this).parent().children("ul.sub_nav").length);
			
		},
		
		out: function() {
			//console.log("ul.main_nav>li>a HOVER OUT");
			
		},
		sensitivity: 1,
		interval: 100,
		timeout: 300
	};
	
	var main_nav_config = {
		over: function() {
			//console.log("ul.main_nav HOVER OVER");
			
		},
		
		out: function() {
			//console.log("ul.main_nav HOVER OUT");
			
			var current_sub_nav = null;
			
			//find ul.sub_nav if there is a "current" one. 
			//$("ul.main_nav>li").find("ul.sub_nav>li.current").parent().each(function() { current_sub_nav = $(this);	});
			
			
			$("ul.main_nav>li.current").find("ul.sub_nav").each(function() { current_sub_nav = $(this); } );
			
			
			
			//find ul.main_nav>li.current and add class "ahover"
			$("ul.main_nav>li>a").removeClass("ahover");
			$("ul.main_nav>li.current").children('a').each(function() {
				$(this).addClass("ahover");
			});
			
			//if .nav_container_white IS down & there is ul.main_nav li.current ul.sub_nav 
			if (nav_container_white_visible && current_sub_nav != null) {	//there is a current sub nav to roll down
				$("ul.sub_nav").css('height', '0');
				current_sub_nav.css('height', '34px');
				
			//else if ul.main_nav li.current HAS sub menu, roll down
			} else if (!nav_container_white_visible && current_sub_nav != null) {
				$(".nav_container_white").animate( {height: '34px'}, {queue: true, duration: 300, easing: 'easeOutExpo'});
				current_sub_nav.animate( {height: '34px'}, {queue: true, duration: 300, easing: 'easeOutExpo', complete: function() {  }});
				nav_container_white_visible = true;
				

			} else {
				$(".nav_container_white").stop().animate( { height: '0px'}, {queue: true, duration: 300, easing: 'easeOutExpo',  complete: function() { $(".nav_container_white").css("display", "none"); }});
				$("ul.sub_nav").stop().animate( { height: '0px'}, {queue: true, duration: 300, easing: 'easeOutExpo', complete: function() { }  });
				nav_container_white_visible = false;	
			}
			
			
			
		},
		sensitivity: 1,
		interval: 100,
		timeout: 300
	};
	
	
	
	$("ul.main_nav>li>a").hoverIntent(main_nav_element_config);
	$("ul.main_nav").hoverIntent(main_nav_config);
	


 


	/*****************
	** SERVICES PAGE *
	*****************/
	$("li#nav_services.current ul.sub_nav li a").click(function() {
		debug_log("services:sub_nav click - animating?:" + services_slides_animating);
														
		//so animations don't get messed up, check this. variable is set right before animations start and released
		//when the last animation is completed.
		if (services_slides_animating)	return false;

		//gives current index: (0 - x)
		var clicked_idx = $("li#nav_services ul.sub_nav li a").index(this);
		var selected_slide_idx = $("li#nav_services ul.sub_nav li a").index($("li#nav_services ul.sub_nav li.current a"));
		
		//if the user clicks on the selected slide, do nothing.
		if (clicked_idx == selected_slide_idx) return false;
		
		services_slides_animating = true;
		services_toggle(selected_slide_idx, clicked_idx);
		
		//alert(document.location.href);

		//cancel the link if already on the page.
		//if (document.location.href.indexOf('#') != -1);
		//	return false;
		
	});	
	

	function services_toggle(current_idx, goto_idx) {	
		var services_slide_current = '#services_' + current_idx;
		var services_slide_next = '#services_' + goto_idx;
		
		//change @class="current" to the current slide.
		$("li#nav_services ul.sub_nav li:eq(" + current_idx + ")").removeClass("current");
		$("li#nav_services ul.sub_nav li:eq(" + goto_idx + ")").addClass("current");
	
		var total_slides = $("li#nav_services ul.sub_nav li a").size() -1;	
		
		$(services_slide_current + " .main_body").css('display', 'none');

		$(services_slide_next).css('display', 'block');
		$(services_slide_next + " .main_body").css('display', 'block');
		
		
		
		$(services_slide_next + " .header").css( { left: "0", display: 'block', opacity: 0  } );
		
		//services_slides_animating = true;
		$(services_slide_current + " .header").animate({
			opacity: 0
		}, {
			duration: 1000,
			easing: 'easeOutQuad',
			complete: function() { }
		});
		
		//animate next slide in
		$(services_slide_next + " .header").animate({
			opacity: 1.0
		}, {
			duration: 1000,
			easing: 'easeOutQuad',
			complete: function() { services_slides_animating = false;  }
		});


		
		
		$(".services_container").css('height', (slide_header_height + $(services_slide_next + " .main_body").height()));
		document.title = page_title_prefix + $(services_slide_next + " .header h3").text();
		
	}
	
	
	
	
	
	
	
	/*****************************************
	* SERVICES PAGE - NEXT / PREVIOUS TOGGLE *
	*****************************************/
	$(".services_container a#next_service").click(function() {
		debug_log("services:next - animating?:" + services_slides_animating);
		if (services_slides_animating)	return false;
		var selected_slide_idx = $("li#nav_services ul.sub_nav li a").index($("li#nav_services ul.sub_nav li.current a"));
		var total_slides = $("li#nav_services ul.sub_nav li a").size() -1;
		var next_slide = (selected_slide_idx+1 > total_slides) ? 0 : selected_slide_idx+1;
		
		//find slide id for deep link by index & remove slide_nav_
		var next_slide_deep_link = $("a.deep_link:eq(" + next_slide + ")").attr("id").substr(10);
		window.location = '#' + next_slide_deep_link;
		//scrollTo(0,0);
		
		services_slides_animating = true;
		services_toggle(selected_slide_idx, next_slide);
	});
	
	$(".services_container a#prev_service").click(function() {
		debug_log("services:prev - animating?:" + services_slides_animating);
		if (services_slides_animating)	return false;
			
		var selected_slide_idx = $("li#nav_services ul.sub_nav li a").index($("li#nav_services ul.sub_nav li.current a"));
		var total_slides = $("li#nav_services ul.sub_nav li a").size() -1;

		var prev_slide = (selected_slide_idx == 0) ? total_slides : selected_slide_idx-1;
		
		//find slide id for deep link by index & remove slide_nav_
		var prev_slide_deep_link = $("a.deep_link:eq(" + prev_slide + ")").attr("id").substr(10);
		window.location = '#' + prev_slide_deep_link;

		services_slides_animating = true;
		services_toggle(selected_slide_idx, prev_slide);
	});
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	$("li#nav_industry ul.sub_nav li a").click(function() {
		//so animations don't get messed up, check this. variable is set right before animations start and released
		//when the last animation is completed.
		if (services_slides_animating)	return false;
			
		//gives current index: (0 - x)
		var clicked_idx = $("li#nav_industry ul.sub_nav li a").index(this);
		var selected_slide_idx = $("li#nav_industry ul.sub_nav li a").index($("li#nav_industry ul.sub_nav li.current a"));
		
		//alert("clicked_idx: " + clicked_idx + "\nselected_slide_idx: " + selected_slide_idx);
		
		//if the user clicks on the selected slide, do nothing.
		if (clicked_idx == selected_slide_idx) return false;
		
		services_slides_animating = true;
		industry_toggle(selected_slide_idx, clicked_idx);
		
		//cancel the link if already on the page.
		//if (document.location.href.indexOf('#') != -1);
		//	return false;
	});	
	
	
	
	
	
	
	function industry_toggle(current_idx, goto_idx) {	
		var services_slide_current = '#industry_' + current_idx;
		var services_slide_next = '#industry_' + goto_idx;
		
		//change @class="current" to the current slide.
		$("li#nav_industry ul.sub_nav li:eq(" + current_idx + ")").removeClass("current");
		$("li#nav_industry ul.sub_nav li:eq(" + goto_idx + ")").addClass("current");
	
		var total_slides = $("li#nav_industry ul.sub_nav li a").size() -1;	
		
		// if slide is after OR the current slide is the last slide & the next slide is the first
		if (goto_idx > current_idx || current_idx == total_slides && goto_idx == 0) {

	
			/*******************
			* ANIMATE TO LEFT  *
			*******************/
			
			$(services_slide_next).css( { left: "0", display: 'block' } );
			$(services_slide_next + " .header").css( { left: "0", display: 'block', opacity: 0  } );
			
			//services_slides_animating = true;
			$(services_slide_current + " .header").animate({
				opacity: 0
			}, {
				duration: 1000,
				easing: 'easeOutQuad',
				complete: function() { }
			});
			
			//animate next slide in
			$(services_slide_next + " .header").animate({
				opacity: 1
			}, {
				duration: 1000,
				easing: 'easeOutQuad',
				complete: function() {  }
			});
			
			
			
			$(services_slide_next + " .main_body").css( { left: "0", opacity: 0  } );
	
			
			$(services_slide_current + " .main_body").animate({
				opacity: 0,
				left: "-1500px"
		
	
			}, {
				duration: 1000,
				easing: 'easeInOutQuint',
				complete: function() { }
			});
			
			//animate next slide in
			$(services_slide_next + " .main_body").animate({
				opacity: 1,
				left: "-500px"
			}, {
				duration: 1000,
				easing: 'easeInOutQuint',
				complete: function() { services_slides_animating = false; }
			});
		
	
	
	
		} else {
	
	
			
			
			/*******************
			* ANIMATE TO RIGHT *
			*******************/
			$(services_slide_next).css( { left: "0", display: 'block' } );
			$(services_slide_next + " .header").css( { left: "0", display: 'block', opacity: 0  } );
			
			//services_slides_animating = true;
			$(services_slide_current + " .header").animate({
				opacity: 0
			}, {
				duration: 1000,
				easing: 'easeOutQuad',
				complete: function() { }
			});
			
			//animate next slide in
			$(services_slide_next + " .header").animate({
				opacity: 1
			}, {
				duration: 1000,
				easing: 'easeOutQuad',
				complete: function() {  }
			});
			
			
			
			$(services_slide_next + " .main_body").css( { left: "-1500px", opacity: 0  } );	
			$(services_slide_current + " .main_body").animate({
				opacity: 0,
				left: "1500px"
			}, {
				duration: 1000,
				easing: 'easeInOutQuint',
				complete: function() { }
			});
			
			//animate next slide in
			$(services_slide_next + " .main_body").animate({
				opacity: 1,
				left: "-500px"
			}, {
				duration: 1000,
				easing: 'easeInOutQuint',
				complete: function() { services_slides_animating = false; }
			});
			
		
		}

		
	}
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	$(".industry_container a#next_industry").click(function() {
		debug_log("industry:next - animating?:" + services_slides_animating);
		if (services_slides_animating)	return false;
		var selected_slide_idx = $("li#nav_industry ul.sub_nav li a").index($("li#nav_industry ul.sub_nav li.current a"));
		var total_slides = $("li#nav_industry ul.sub_nav li a").size() -1;
		var next_slide = (selected_slide_idx+1 > total_slides) ? 0 : selected_slide_idx+1;
		
		//find slide id for deep link by index & remove slide_nav_
		var next_slide_deep_link = $("a.deep_link:eq(" + next_slide + ")").attr("id").substr(10);
		window.location = '#' + next_slide_deep_link;
		//scrollTo(0,0);
		
		services_slides_animating = true;
		industry_toggle(selected_slide_idx, next_slide);
	});
	
	$(".industry_container a#prev_industry").click(function() {
		debug_log("industry:prev - animating?:" + services_slides_animating);
		if (services_slides_animating)	return false;
			
		var selected_slide_idx = $("li#nav_industry ul.sub_nav li a").index($("li#nav_industry ul.sub_nav li.current a"));
		var total_slides = $("li#nav_industry ul.sub_nav li a").size() -1;

		var prev_slide = (selected_slide_idx == 0) ? total_slides : selected_slide_idx-1;
		
		//find slide id for deep link by index & remove slide_nav_
		var prev_slide_deep_link = $("a.deep_link:eq(" + prev_slide + ")").attr("id").substr(10);
		window.location = '#' + prev_slide_deep_link;

		services_slides_animating = true;
		industry_toggle(selected_slide_idx, prev_slide);
	});
	
	
	
	
	
	
	
	
	
	
	
	
	$("li#nav_company.current ul.sub_nav li a").click(function() {
   		debug_log("company:sub_nav click - animating?:" + services_slides_animating);
		//so animations don't get messed up, check this. variable is set right before animations start and released
		//when the last animation is completed.
		if (services_slides_animating)	return false;
			
		//gives current index: (0 - x)
		var clicked_idx = $("li#nav_company ul.sub_nav li a").index(this);
		var selected_slide_idx = $("li#nav_company ul.sub_nav li a").index($("li#nav_company ul.sub_nav li.current a"));
		
		//if the user clicks on the selected slide, do nothing.
		if (clicked_idx == selected_slide_idx) return false;
		
		services_slides_animating = true;
		company_toggle(selected_slide_idx, clicked_idx);

		//cancel the link if already on the page.
		//if (document.location.href.indexOf('#') != -1);
		//	return false;
	});	
	

	function company_toggle(current_idx, goto_idx) {
		var services_slide_current = '#company_' + current_idx;
		var services_slide_next = '#company_' + goto_idx;
		
		//change @class="current" to the current slide.
		$("li#nav_company ul.sub_nav li:eq(" + current_idx + ")").removeClass("current");
		$("li#nav_company ul.sub_nav li:eq(" + goto_idx + ")").addClass("current");
	
		var total_slides = $("li#nav_company ul.sub_nav li a").size() -1;	
		
		// if slide is after OR the current slide is the last slide & the next slide is the first
		
		$(services_slide_current + " .main_body").css('display', 'none');

		$(services_slide_next).css('display', 'block');
		$(services_slide_next + " .main_body").css('display', 'block');
		
		
		
		$(services_slide_next + " .header").css( { left: "0", display: 'block', opacity: 0  } );
		
		//services_slides_animating = true;
		$(services_slide_current + " .header").animate({
			opacity: 0
		}, {
			duration: 1000,
			easing: 'easeOutQuad',
			complete: function() { }
		});
		
		//animate next slide in
		$(services_slide_next + " .header").animate({
			opacity: 1.0
		}, {
			duration: 1000,
			easing: 'easeOutQuad',
			complete: function() { services_slides_animating = false;  }
		});
		
		
		


		
		
		$(".company_container").css('height', (slide_header_height + $(services_slide_next + " .main_body").height()));
		document.title = page_title_prefix + $(services_slide_next + " .header h3").text();
		
		
		
		
		
		

		

		
	}
	
	
	
	
	/*****************************************
	* COMPANY PAGE - NEXT / PREVIOUS TOGGLE  *
	*****************************************/
	$(".company_container a#next_company").click(function() {
		debug_log("company:next - animating?:" + services_slides_animating);
														  
		if (services_slides_animating)	return false;
		

		
		var selected_slide_idx = $("li#nav_company ul.sub_nav li a").index($("li#nav_company ul.sub_nav li.current a"));
		var total_slides = $("li#nav_company ul.sub_nav li a").size() -1;
		var next_slide = (selected_slide_idx+1 > total_slides) ? 0 : selected_slide_idx+1;
		
		//find slide id for deep link by index & remove slide_nav_
		var next_slide_deep_link = $("a.deep_link:eq(" + next_slide + ")").attr("id").substr(10);
		window.location = '#' + next_slide_deep_link;
		//scrollTo(0,0);
		
		services_slides_animating = true;
		company_toggle(selected_slide_idx, next_slide);
	});
	
	$(".company_container a#prev_company").click(function() {
		debug_log("company:prev - animating?:" + services_slides_animating);

		if (services_slides_animating)	return false;
			
		var selected_slide_idx = $("li#nav_company ul.sub_nav li a").index($("li#nav_company ul.sub_nav li.current a"));
		var total_slides = $("li#nav_company ul.sub_nav li a").size() -1;

		var prev_slide = (selected_slide_idx == 0) ? total_slides : selected_slide_idx-1;
		
		//find slide id for deep link by index & remove slide_nav_
		var prev_slide_deep_link = $("a.deep_link:eq(" + prev_slide + ")").attr("id").substr(10);
		window.location = '#' + prev_slide_deep_link;

		services_slides_animating = true;
		company_toggle(selected_slide_idx, prev_slide);
	});
	
	
	
	
	
	
	
	debug_log("page init");
	
	
	 

});




function debug_log(txt) {
	//$("#debug").html($("#debug").html() + txt + "<br>");
}










