$(document).ready(function() {
	$("#nav").css("margin-top", "35px");
	
	$(".downloads a").css("text-decoration", "none");
	$("ul.downloads li").css("cursor", "pointer");
	$("ul.downloads li").click(function() {
		window.open($(this).children("a").attr("href"));
	});
	$("ul.downloads li a").click(function(e) {
		e.preventDefault();
	});
	
	// Process Line Styling
	$(".process_line li").mouseover(function() {
		$(this).css("color", "#000");
		$(this).css("background-color", "#ccc");
	});
	$(".process_line li").mouseout(function() {
		$(this).css("color", "#fff");
		$(this).css("background-color", "#A31C49");
	});	
	$(".process_line li").each(function() {
		current_height = $(this).height();
		apply_padding = (60 - current_height) / 2;
		$(this).css("padding-top", apply_padding);
		$(this).css("padding-bottom", apply_padding);
	});
	$(".process_line li").click(function() {
		link = $(this).attr("goto");
		$(this).css("color", "#fff");
		$(this).css("background-color", "#A31C49");		
		if (link == "") {
			link = "/p/price-on-application";
		}
		document.location.href = link;
	});
	

	// Common
	
	// Scroller
	$jScroller.add("#ticker_container","#ticker","left",7,1);
	$jScroller.start();
	
	// Drop Down Menus
	$("ul.sf-menu li a:last").css("border", "none");
	$("ul.sf-menu").superfish();
	
	// PNG Fix
	$("#snacks").pngFix();
	
	// Snacks
	$(".snack").mouseover(function() {
		jQuery(this).children(".snack_title").children("a").css("color", "#A31C49");
	});
	$(".snack").mouseout(function() {
		jQuery(this).children(".snack_title").children("a").css("color", "#fff");
	});
	
	// Common - End
});

(function ($) {
$.fn.vAlign = function() {
	return this.each(function(i){
	var h = $(this).height();
	var oh = $(this).outerHeight();
	var mt = (h + (oh - h)) / 2;	
	$(this).css("margin-top", "-" + mt + "px");	
	$(this).css("top", "50%");
	$(this).css("position", "absolute");	
	});	
};
})(jQuery);
