var highlightCycle = '';
$(document).ready(function(){
	/* lightbox functionality */
	$("a[rel*=lightbox]").lightbox();
	$("a[rel='external']").click(function() {
		var strURL = $(this).attr('href');
		var oNewWindow = window.open( strURL );
		if ( !oNewWindow ) {
			window.location.href = strURL;
		}
		return false;
	});
	
	/* form watermarks * /
	$("label + input, label + textarea").each(function (i) {
		var newLabel = $(this).prev().clone();
		newLabel.find('span').remove();
		$(this).watermark(newLabel.html());
	});
	$("input + span.captcha_text").each(function (i) {
		var newLabel = $(this).clone();
		newLabel.find('span').remove();
		$(this).prev().watermark(newLabel.html());
	});
	$("label.watermark + input.captcha").prev().addClass("captcha_text");
	if ( $("p.error").length > 0 ) {
		
		$("p.error").click(function(){
			$(this).fadeOut('slow');
		}).bind("mouseleave", function(){
			$(this).fadeOut('slow');
		});
		$.scrollTo('p.error');
	}
	// */
	
	/* menu IE6 functionality * /
	$("#mainNavigation li.current").addClass('currentAnchor');
	$("#mainNavigation li").bind("mouseenter", function(){
		$("#mainNavigation li.current").removeClass('current');
		$(this).addClass('current').addClass('hover');
	});
	
	$("#mainNavigation li").bind("mouseleave", function(){
		$("#mainNavigation li.current").removeClass('current');
		$("#mainNavigation li.currentAnchor").addClass('current');
		$(this).removeClass('hover');
	});
	// */
	
	$("h1").each(function() {
		flashContent = "<object type=\"application/x-shockwave-flash\" data=\"files/frontend/titel.swf\" class=\"flashtitel\" >\n"
				+" <param name=\"movie\" value=\"files/frontend/titel.swf\">\n"
				+" <param name=\"flashvars\" value=\"titel="+$(this).html()+"\">\n"
				+" <param name=\"quality\" value=\"best\">\n"
				+" <param name=\"wmode\" value=\"transparent\">\n"
				+"</object>";
		$(this).html(flashContent);
	});
});

function doSubmit(action, task) {
	document.route.action = action;
	document.route.task.value = task;
	document.route.submit();
}

