/**
 * JavaScript functions for judoClub
 * @author Sebastian Neuser
 * @version 1.3.0 (6): 2011-03-28
 */

	/**
	 * pops up a new window without any toolbars.
	 * @param uri uri of the target location
	 */
	function popUp( uri )
	{
		window.open( uri , "judo.popUp" , "dependent=yes,location=no,menubar=no,scrollbars=no,status=no,toolbar=no" );
	}

	/**
	 * pops up a new window with a picture.
	 * @param uri uri of the picture
	 */
	function popUpNewsPic( uri )
	{
		var width = 1024;
		var height = 808;
		x = String( (parent.innerWidth-width) / 2 );
		y = String( (parent.innerHeight-height) / 2 );

		var params = "dependent=yes,height=" + height + ",location=no,menubar=no,screenX=" + x + ",screenY=" + y + ",status=no,toolbar=no,width=" + width;

		window.open( "./cms/pic/viewPic.php?uri="+uri , "picPopUp" , params );
	}

	/**
	 * pops up a new window with a picture.
	 * @param uri uri of the picture
	 */
	function popUpPic( uri , width , height )
	{
		width += 25;
		height += 40;
		x = String( (parent.innerWidth-width) / 2 );
		y = String( (parent.innerHeight-height) / 2 );

		var params = "dependent=yes,height=" + height + ",location=no,menubar=no,screenX=" + x + ",screenY=" + y + ",status=no,toolbar=no,width=" + width;

		window.open( "viewPic.php?uri="+uri , "picPopUp" , params );
		window.resizeTo( width , height+40 );
	}

	/**
	 * adapts the links of the second menu
	 * @param link1 name of the target section #1
	 * @param link2 name of the target section #2
	 * @param link3 name of the target section #3
	 * @param link4 name of the target section #4
	 */
	function smenu( link1 , link2 , link3 , link4 )
	{
		var args = new Array( link1 , link2 , link3 , link4 );

		for (var i=0; i<4; i++)
		{
			var elem = document.getElementById("smenu" + i);
			elem.firstChild.nodeValue = args[i];

			var uri =  "./" + args[i].toLowerCase() + ".php";
			uri = uri.replace(/\u00E4/gi , "ae");
			uri = uri.replace(/\u00F6/gi , "oe");
			uri = uri.replace(/\u00FC/gi , "ue");
			elem.href = uri;
		}
	}

