function nullFunction() {};


jQuery(document).ready(function($) {

	var cacheLink = function(a) {
		var link = a.attr('href');
		var target = a.attr('target');
		a.mouseout(function() {
			a.attr('href',link);
		});
		return [link,target,a];
	}
	
	
	var invokeLink = function(linkObj) {
		var a = linkObj[2];
 		var link = linkObj[0];
		var target = linkObj[1];
		var width = 800;
		if (!target || target=="" || target=="_self") {
			location.href = link;
		} else { 
			if (target == "t24intern") {
				a.attr('target','_blank');
				if (a.attr('rel')) {
					width = a.attr('rel');
				}
				a.nyroModalManual({'width': width, 'height': 2000});
				a.attr('target','t24intern');
			} else {
				window.open(link,target);
			}
		} 
				
		a.attr('href','javascript:nullFunction()');
	}

	$(".rechtespalte,.angebote > li").each(function () {
		var link = cacheLink($(this).find("a"));
//		$(this).shadow({offset: -3});
//		$(this).shadowDisable();
		var isblack = $(this).hasClass('black');
		$(this).mouseover(function () {
			if (isblack) {
				$(this).addClass('orange');
				$(this).removeClass('black');
			} else {
				$(this).addClass('black');
			}		
			$(this).css("cursor","pointer");
//			$(this).shadowEnable();
			$(this).find("a").css("color","#274856");
		});
		
		$(this).mouseout(function () {
	//		$(this).shadowDisable();
			if (isblack) {
				$(this).removeClass('orange');
				$(this).addClass('black');
			} else {
				$(this).removeClass('black');
			}
			$(this).find("a").css("color","");
		});
		
		$(this).click(function () {
			invokeLink(link);
			return false;
		});

	});
		
	$(".reisemenue_h li,.reisemenue li").each(function () {
		$(this).css("cursor","pointer");
		var link = cacheLink($(this).find("a"));

		$(this).mouseover(function () {
			$(this).find("a").css("color","#000000");
		});
		
		$(this).mouseout(function () {
			$(this).find("a").css("color","");
		});
		
		$(this).click(function (e) {
			invokeLink(link);
			return false;
		});
		
	});
	
	$(window).load(function() {
		if ($.fn.dropShadow) {
			$(".overtext").each(function() {
				var shc = $(this).hasClass('blackfont') ? '#FFFFFF' : '#000000';
				$(this).dropShadow({
					left: 2,
					top: 2,
					blur: 3,
					opacity: .8,
					color: shc,
					swap: false
				});
			});
		}
	});
	
/*	
	//Hauptmenue
	$(".menue li").each(function () {
		$(this).mouseover(function () {
			$(this).addClass("orange");
//			$(this).find('*').css("cursor","pointer");
		});
		$(this).mouseout(function () {
			$(this).removeClass("orange");
		});
		
	});
	
	//Spaltenmenue
	$(".mmenue li").mouseover(function () {
		
	});
*/	

	$("a[target='t24intern']").each(function () {
		var link = cacheLink($(this));

		$(this).click(function () {
			invokeLink(link);
			return false;
		});

	});
});




