function clog(message) {
	if(console.log) {
		console.log(message);
	}
}
$(document).ready(function() {
	// sidebar menu
	if(typeof menuh == 'function') {
		//menuh();
	}
	
	// menuh
	
	$("#menuh .top_parent").mouseenter(function() {
		var t = $(this);
		var dropdown = t.parent().find("ul:first");
		$("#menuh ul li").not(t.parent()).find("ul:visible").stop(true, true).hide();
		dropdown.stop(true, true).show();
	});
	$("#menuh ul li ul").mouseleave(function() {
		$(this).stop(true, true).hide();
	});
	
	/* menuv(); */
	$("#menuv-container").each(function() {
		var t = $(this);
		t.find("ul").each(function() {
			var ul = $(this);
			ul.find("li").mouseenter(function() {
				$(this).find("ul").slideDown();
			});
		});
		t.mouseleave(function() {
			t.find("ul li ul").slideUp();
		});
	});
													 
	$("#show-step-3").click(function() {
		$("#step-3").slideDown("slow");
		$(this).hide();
  });
	if($("#story").length > 0) {
		new nicEditor({iconsPath : '/library/js/nicEditorIcons.gif', buttonList : ['bold','italic','subscript','superscript','ol','ul','removeformat','indent','outdent','link','unlink','fontFamily','xhtml']}).panelInstance('story');
	}
	if($("#blurb").length > 0) {
		new nicEditor({iconsPath : '/library/js/nicEditorIcons.gif', buttonList : ['bold','italic','subscript','superscript','ol','ul','removeformat','indent','outdent','link','unlink','fontFamily','xhtml']}).panelInstance('blurb');
	}
	if($("#wlan_splash").length > 0) { 
		var wtitle = $("#wlan_title");
		var wrel = $("#wlan_splash_reliability");
		var wsec = $("#wlan_splash_security");
		var wroi_tco = $("#wlan_splash_roi-tco");
		var wgear = $("#wlan_gear");
		var wlogos = $("#wlan_logos");
		var woverlay = $("#wlan_overlay");
		
		// wlan_title animation ****************************************
		wtitle.animate({ top:120 }, 1000, function() {
			wtitle.fadeIn(2500, function() {
				wtitle.animate({ top:120 }, 100, function() { 
					wtitle.fadeOut(2500, function() {
						// wlan_splash_reliability animation ****************************************
						wrel.show().animate({ left:40 }, 1000, function() {
							wrel.fadeIn(2500, function() {
								wrel.animate({ left:40 }, 100, function() { 
									// wlan_splash_security animation ****************************************
									wsec.show().animate({ left:40 }, 1000, function() {
										wsec.fadeIn(2500, function() {
											wsec.animate({ left:40 }, 100, function() { 
												// wlan_splash_roi-tco animation ****************************************
												wroi_tco.show().animate({ left:40 }, 1000, function() {
													wroi_tco.fadeIn(2500, function() {
														wroi_tco.animate({ left:40 }, 100, function() { 
															// wlan_gear animation ****************************************
															wgear.animate({ left:10 }, 1000, function() {
																wgear.fadeIn(2500, function() {
																	wgear.animate({ left:10 }, 100, function() { 
																		// wlan_overlay animation ****************************************
																		woverlay.animate({ left:10 }, 100, function() {
																			woverlay.find("div").fadeIn(2000);
																			woverlay.animate({ left:10 }, 1500, function() { 
																				// wlan_logos animation ****************************************
																				wlogos.show().animate({ right:50 }, 1000, function() {
																					wlogos.fadeIn(2500, function() {
																						wlogos.animate({ right:50 }, 100, function() { 
																						});
																					});
																				});
																			});
																		}); // end wlan_overlay animation 
																	});
																});
															}); // end wlan_gear animation 
														});
													});
												}); // end wlan_splash_roi-tco animation 
											});
										});
									}); // end wlan_splash_security animation 
								});
							});
						}); // end wlan_reliability animation 
					});
				});
			});
		}); // end wlan_title animation 
	}
	
	if($("span.tab").length > 0) {
		$("span.tab:first").addClass("active");
		$("div.panel").not("div.panel:first").hide();
		$("span.tab").click(function() {
			var t = $(this);
			var target = t.attr("target");
			$(".panel").hide();
			$("#" + target).show();
			$("span.tab").removeClass("active");
			t.addClass("active");
		});
	}
	$("a.confirm").click(function() {
		var message = $(this).attr("confirmtext");
		if(confirm(message)) {
			return true;
		} else {
			return false;
		}
	});
	$("div.portfolio_item").hover(function() {
		/*$(this).css("background-color", "#EFEFEF");*/
	}, function() {
		$(this).css("background-color", "white");
	});
});