var current_case = 0;
var secoActive = 0;

function setCounter(k,m,p)
{
	if (m == 0)
	{
		click_url = "../html/modules/click_counter/ajax.php";	
	}
	else
	{
		click_url = "../modules/click_counter/ajax.php";	
	}
	var myAjax = new Ajax.Request(click_url, 
		{ 
			method: "post",
			postBody: "method=click_counter&key=" + k + "&page=" + p,
			onComplete: function(r)
			{
//				alert(r.responseText);
			}
		}
	);
}

function loadNavigation(m,k)
{
	if (m == 0)
	{
		nav_url = "website.php?id=/navigation.htm&mode=0&key=" + k;	
	}
	else
	{
		nav_url = "../../cms/website.php?id=/navigation.htm&mode=1&key=" + k;	
	}
	var myAjax = new Ajax.Updater("navigation",nav_url,{evalScripts:true});
}


function resetForm(k)
{
	Form.reset($(k));
}

function changeEinverstaendnis()
{
	if ($("einverstaendnis").checked)
	{
		$("fieldeinverstaendnis").className = "validBackground";
	}
	else
	{
		$("fieldeinverstaendnis").className = "invalidBackground";
	}
}

function selectLink(selObject) 
{
	var selWert = selObject.options[selObject.selectedIndex].value;
	location.href = selWert;
}

function openCase(a,k,m)
{
	if (m == 0)
	{
		$("publicis_window_content").innerHTML = '<div class="closeBtn" style="text-align:right;"><a href="Javascript:closeCase();" class="formbutton"><img src="../html/img/window_close.gif" style="margin-right:12px;">schliessen</a></div><div id="flash_lightbox"></div>';
		var xmlurl = "website.php?id=/xml/case.xml&key=" + k + "&mode=" + m;
		var flash = "../html/img/pool/lightbox.swf";
	}
	else
	{
		$("publicis_window_content").innerHTML = '<div class="closeBtn" style="text-align:right;"><a href="Javascript:closeCase();" class="formbutton"><img src="../img/window_close.gif" style="margin-right:12px;">schliessen</a></div><div id="flash_lightbox"></div>';
		var xmlurl = "../../cms/website.php?id=/xml/case.xml&key=" + k + "&mode=" + m;
		var flash = "../img/pool/lightbox.swf";
	}
	var active = a;
	var lb = new SWFObject(flash + "?xmlurl="+xmlurl+"&active="+active, "sotester", "616", "404", "7", "#ffffff");
	lb.write("flash_lightbox");
	Effect.Appear("publicis_window_content", 
		{	
			duration: 0.3
		}
	); 	
}

function closeCase()
{
	Effect.Fade("publicis_window_content", 
		{
			duration:0.3,
			afterFinish: function()
			{
				$("publicis_window_content").innerHTML = "";
			}
		}
	);
}

function setSecoActive(k)
{
	secoActive = k;
}

function subNav(k)
{
	if ((secoActive != 0) && (secoActive != k))
	{
		Effect.Fade("secondary" + secoActive, {duration:0.0});
	}
	Effect.Appear("secondary" + k, {duration:0.0});
	secoActive = k;
}
