/* 2008-06-23 */

$(document).ready(function(){
	$('.jHide').hide();

	$('a.secureLink').hover( function() {
		$('.secureTxt').fadeIn('fast')
	},function() {
		$('.secureTxt').fadeOut('fast')
	}).click( function() {
		return false;
	})
	/* 
	 * Allgemeine Rollover Funktion (Version 2)
	 * Im rel Attribut des Links wird der Pfad zum Rollover-Image und ein Key angegeben. 
	 * Getrennt werden diese Angaben durch '|'.
	 * Der Key wird als Verbindung zum DIV-Tag genommen welches gleichzeitig ein- bzw. ausgeblendet wird
	 */
	$('.ro a').mouseover(function() {
		tmp_rel = $(this).attr('rel')
		//tmp_illu = tmp_rel 
		if (tmp_rel.indexOf('|') != -1) {
			tmp_rel = tmp_rel.split('|')
			//tmp_illu = tmp_rel[0]
			tmp_key = tmp_rel[1]
		}
		
			
			if (tmp_key) {
				$('.ro-txt').hide()	
			}	
			$('.ro-txt.'+tmp_key).fadeIn('fast')	
		
	});
	
	$('.ro a').mouseout(function() {
		tmp_rel = $(this).attr('rel')
		//tmp_illu = tmp_rel 
		if (tmp_rel.indexOf('|') != -1) {
			tmp_rel = tmp_rel.split('|')
			//tmp_illu = tmp_rel[0]
			tmp_key = tmp_rel[1]
		}
		
			
			if (tmp_key) {
				$('.ro-txt').hide()	
			}	
			//$('.ro-txt.'+tmp_key).fadeIn('fast')	
		
	});
	
});

//toggle gif
if (document.getElementsByTagName) {
	toggle = function(a) {
		var img = a.getElementsByTagName('img')[0];
		var src = img['src'];
		if (src.indexOf('_hi') > -1) 
			img["src"] = src.replace("_hi", ""); 
		else 
			img["src"] = src.replace(".gif", "_hi.gif"); 
	};
}
else {	
	toggle = function() { return; };
}

//toggle jpg
if (document.getElementsByTagName) {
	toggle2 = function(a) {
		var img = a.getElementsByTagName('img')[0];
		var src = img['src'];
		if (src.indexOf('_hi') > -1) 
			img["src"] = src.replace("_hi", ""); 
		else 
			img["src"] = src.replace(".jpg", "_hi.jpg"); 
	};
}
else {	
	toggle2 = function() { return; };
}

/*fenster &ouml;ffnen f&uuml;r 2tes popup*/
var popup30
function remotePop (htmldoc) {		
	if (popup30 && popup30.closed != true) {
		window.popup30.close()
		}
	popup30=window.open(htmldoc,"popup30","toolbar=no,location=\'Users\',directories=no,status=no,resizeable=no,copyhistory=no,menubar=no,width=466,height=455,left=150,top=200")
	if (popup30 && !popup30.creator) {
		popup30.creator=self
		}
	if (window.focus) {
		popup30.focus()
	}
}


//formular
$(document).ready(function(){	
	//ersetzen der radio-buttons in gewinnspiel-frage
	var radiolines = $('input.single-choice').parent('.line');
	$('input.single-choice').each(function() {
		var r = $(this);
		var line = r.parent('.line');
		line.addClass('radio-buttons');
		var label = line.find('label');
		// catch click event on label
		label.click(function(event) {
			line.click();
			return false;
		})
	// catch click event on parent div and trigger click on label
		line.click(function(event) {
			//alert( "id=" + r.attr( "id" ) + ", name=" + r.attr("name") );
			r.click();			
			radiolines.removeClass('radio-checked');
			line.addClass('radio-checked');
			})
		})	
});

