// VÖLKwerbung JavaScript Document in combination with jQuery

//function open window not used jet
function openNewWindow(URLtoOpen, windowName, windowFeatures)
{ newWindow=window.open (URLtoOpen, windowName, windowFeatures);}


function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		munich_o = newImage("../bilder/scrollDn-o.gif");
		nav1_o = newImage("../bilder/scrollUp.gif");
		menu1_o = newImage("../bilder/ulSquare.gif");
		
		preloadFlag = true;
	}
}
	
$(document).ready(function() {
  
    /* sample function for animation; now in use*/
 $('#mainWrapper').css('display','none');					   
  var mainAnimation = function() {

	   $('#mainWrapper').animate({width: 'show'}, 'slow'); 
		
  };	
  mainAnimation();

});

/* funk text hover effects: start radiospot */
$(document).ready(function() {	
	
	/* JS active so deactivate links to show descriptions in leistungen */
	//$('#dropdown2 h2 a').attr('href', '#');	
	//$('#dropdown2 h2 a').css('cursor', 'default');
//	$('#dropdown2 p a').attr('href', '#');
	//$('#funk1').css('display','none');
	//	$('#funk2').css('display','none');
	
 var textOverOut = function() { 
		$('#dropdown2 p a').css('color', '#fffff0');
		$('.subNavBottom ').css('display','none');
		//$('#funk1').css('display','none');
		//$('#funk2').css('display','none');
	};
	
 $('#leftWrapper').mouseover(textOverOut);		
	
 var textOverTitle = function() { 
		$('#dropdown2 p a').css('color', '#fffff0');
		$('.subNavBottom ').css('display','none');
		//$('#funk1').css('display','none');
		//$('#funk2').css('display','none');
		//$('.stop').find('p').text('');
	};
	
 $('#dropdown2 h2 a').click(textOverTitle);	
 $('#dropdown2 h2 a').mouseover(textOverTitle);	
// $('.stop').mouseover(textOverTitle);
// $('.stop').click(textOverTitle);	
 
 $('#loading').ajaxStart(function() {
	$(this).show();
 }).ajaxStop(function() {
	 $(this).hide();
 }); 
 
 var textOver = function() { 
		$('#dropdown2 p a').css('color', '#fffff0');
		//$('#dropdown2 p a:eq(1)').css('color', '#000000');
		$(this).css('color', '#000000');
		//$('.subNavBottom ').css('display','none');
		//$('.subNavBottom:eq(1)').css('display','inline');
		//$('.stop').find('p').text('');
		
	};
	
 $('#dropdown2 p a:eq(0)').mouseover(textOver);	
 $('#dropdown2 p a:eq(1)').mouseover(textOver);
		
		
		
	//doesn't work: gets Funkspot 1: "Italienisch" | 		
/* $('#dropdown2 a').click(function() {
		alert($(this).text()); 
	$.get('funkspot.php', {'nr': $(this).text()}, function(data) {											   
		$('.subNavBottom').html(data);
	 });
	return false;
 }); */
 

var textOver0 = function() { 
		$.get('funkspot.php?nr=1', function(data) {
			//alert(data);												   
			$('.subNavBottomFunk').html(data);
		 });
		return false;
		
	};
	
var textOver1 = function() { 
		$.get('funkspot.php?nr=2', function(data) {
			//alert(data);												   
			$('.subNavBottomFunk').html(data);
		 });
		return false;
		
	};

 $('#dropdown2 p a:eq(0)').click(textOver0);
 $('#dropdown2 p a:eq(1)').click(textOver1); 
 

 
 }); 