$(function(){
	
	$(".sub-nav").hide();
	$(".main-nav li").each(function(){	
		$(this).hover(function(){
				$(".sub-nav",$(this)).show();
			},function(){
				$(".sub-nav",$(this)).hide();
			});
		});
		
			

		$(".suche-result-part ul li:nth-child(odd)").css({"background":"#f2f2f2"});
	
	 
		$('.username,.pwd').each(function(index){
		$(this).attr('rel',$(this).val());
		$(this).focus(function(){
			if($(this).val()===$(this).attr('rel'))
			$(this).val("");
		})
		$(this).blur(function(){
			if ($(this).val()==="")
			$(this).val($(this).attr("rel"));				  
		})				  
	})


	
	
	})
	
 
 // reload profile Filelist
 function reloadProfileFileList( elm , callurl )
 {
 	$( "#" + elm ).html( 'loading preview ...' );
 	$.ajax({
		  url: callurl,
		  cache: false,
		  success: function( result ){
		    $( "#" + elm ).html( result );
		  }
		});
 }

//JSON Links
$(document).ready(function(){
	  $('a.jsonlink').bind('click',function(event){
		event.preventDefault();
//	    $.getJSON(this.href, {},function(response){ 
	    $.get(this.href, {},function(response){ 
	    	alert(response);
	    })	
	 })
	 $('#typeselector').change(function(event){
		 this.form.submit();
	 });
});

 function openTip(src)
{
	$.modal('<iframe src="' + src + '&box=1" height="485" width="830" scrolling="no" style="border:0;">', {
	closeHTML:"",
	containerCss:{
		backgroundColor:"#ddd",
		borderColor:"#fff",
		height:490,
		padding:0,
		width:830
	},
	overlayCss: {
		backgroundColor:"#000"
	},
	overlayClose:true,
	closeHTML: "zu"
});
}
