function myFontSize(fontMod, setCookie)
{
	newFontSize = parseInt(document.getElementById("main").style.fontSize);
	if (fontMod == "n")
		newFontSize = 12;
	else
		newFontSize = newFontSize+fontMod;
	if (newFontSize > 20)
		newFontSize = 20;
	if (newFontSize < 6)
		newFontSize = 6;
	document.getElementById("main").style.fontSize=newFontSize+"px";
	if (setCookie != false)
		myCookie(newFontSize);
}

function myCookie(fontSize)
{
	document.getElementById("pIFrame").src = "_shared/p_cookie.php?cookieNameArray=fontSize&cookieValueArray="+fontSize;
}

// Loginbox hook (jQuery)
$(function() {
	var isHighlighted = $("li#members_only").hasClass("nav_active");	
	$("li#members_only").css({ position: "relative" });
	$("div#loginbox").css({ position: "absolute", top: 37, left: -140, zIndex: 99999 }).appendTo("li#members_only");

	var hideCallback = function() {
		$("div#loginbox").slideUp(500, function(){
			if(!isHighlighted)
				$("li#members_only").removeClass("nav_active").addClass("nav_inactive");
		});
	};
	
	$("li#members_only").hover(function() {
		if($("div#loginbox").is(":hidden")) {
			$(this).addClass("nav_active").removeClass("nav_inactive");						
			$("div#loginbox").slideDown(500, function() {
				$("input#loginbox_username").select();
			});
		} else
			hideCallback();
	}, function() {
		hideCallback();
	}).click(function() { return false; });
});

// Dropdown menu
// Author: Marcel Stegmann
// Tested in: IE6+, Firefox 3, Safari 4
// Usage: 
// js:
// $(function() { $("ul#navigation").dropdown(); });
//
// html:
// <ul id="navigation">
//   <li>
//	   <a href="#">About us</a>
//	   <ul class="dropdown">
//       <li>..</li>
//		 ...
//     </ul>
//   </li>
//   ...
// </ul>
jQuery.fn.extend({
	dropdown: function(set) {
		set = jQuery.extend({
			duration: 400,
			activeClass: "nav_active",
			inactiveClass: "nav_inactive",
			dropdownClass: "dropdown"
		}, set);

		var highlighted_nav = $(this).find("li."+set["activeClass"])[0];
		 $(this).find("li ul."+set["dropdownClass"]).css({ display: "none", position: "absolute", zIndex: 99999 });
		 $(this).find("li:has(ul."+set["dropdownClass"]+")").hover(function() {
			 	$(this).addClass(set["activeClass"]).removeClass(set["inactiveClass"]);
				$(this).children("ul."+set["dropdownClass"]+":not(:animated)").css({
					top: $(this).children("a").position()["top"] + $(this).children("a").height(),
					left: $(this).children("a").position()["left"]
				}).slideDown(set["duration"]);
			}, function() {
				$(this).children("ul."+set["dropdownClass"]).slideUp(set["duration"], function() {
					if($(this).parent()[0] != highlighted_nav)
						$(this).parent().removeClass(set["activeClass"]).addClass(set["inactiveClass"]);
				});
			});

		return this;
	}
});


