$j = jQuery.noConflict();


$j(document).ready(function(){

	$j("input[type=submit]").addClass("submitbutton");

	$j('.EditingFormErrorLabel').css("display","none").parent().addClass("errorBizForm");

	$j(".ListBlogPosts").click(function(){
		document.location.href = $j(this).find("a:first").attr("href"); 
	});

$j(".ListBlogPosts").hover(
  function () {
    $j(this).addClass("ListBlogPostsHover");
  },
  function () {
    $j(this).removeClass("ListBlogPostsHover");
  }
);

	$j('ul#partner').innerfade({
		speed: 1000,
		timeout: 4000,
		type: 'sequence',
		containerheight: '140px'
	});

	$j("#randomschool").load("/Ajax-Objekte/Zufallige-Schule.aspx #ajax");

	$j("#accordion").accordion({
		autoHeight: false,
		navigation: true,
		collapsible: true,
		active: false,
		icons: false
	});
        

	/* jQuery(".ListBlogPosts").hover( function() {

		morelist = jQuery(".BlogPMore", this);

		morelist.fadeIn();
		

	}, function() {
		morelist = jQuery(".BlogPMore", this);
		morelist.fadeOut();		
		
	}); */

	$j(".SchoolPicture").fancybox({
		'width'					: 620,
		'height'				: 470,
		'autoScale'     		: true,
        'transitionIn'			: 'elastic',
		'transitionOut'			: 'elastic',
		'easingIn'      		: 'easeOutBack',
		'easingOut'    			: 'easeInBack',
		'titleShow'				: false,
		'type'					: 'iframe'
	});

	$j(".iframe").fancybox({
		'width'				: 600,
		'height'			: 450,
        	'autoScale'     		: false,
        	'transitionIn'			: 'elastic',
		'transitionOut'			: 'elastic',
		'easingIn'      		: 'easeOutBack',
		'easingOut'    			: 'easeInBack',
		'type'				: 'iframe'
	});
	
	$j(".popup").fancybox({
		'width'				: 600,
		'height'			: 450,
        	'autoScale'     		: false,
        	'transitionIn'			: 'elastic',
		'transitionOut'			: 'elastic',
		'easingIn'      		: 'easeOutBack',
		'easingOut'    			: 'easeInBack',
		'type'				: 'ajax'
	});

	$j(".googlemap").fancybox({
		'width'				: 450,
		'height'			: 390,
        	'autoScale'     		: false,
        	'transitionIn'			: 'elastic',
		'transitionOut'			: 'elastic',
		'easingIn'      		: 'easeOutBack',
		'easingOut'    			: 'easeInBack',
		'type'				: 'iframe'
	});

        $j(".lt" + jQuery.query.get('searchpart')).addClass("btnsel");

        $j(".CommentDetail:even").css("background", "#fff");

 
        $j(".navi_uebersicht a:eq(0)").click( function(){
		$j(this).addClass("selected");
          	$j("#ub_box1").show();
	  	$j("#ub_box2").hide();
          	$j("#ub_box3").hide(); return false;  
        });

       $j(".navi_uebersicht a:eq(1)").click(
		function() {
			$j(this).addClass("selected");
			$j("#ub_box1").hide();
			$j("#ub_box2").show();
			$j("#ub_box3").hide(); return false;
		}
	);

     $j(".navi_uebersicht a:eq(2)").click(
		function() {
	
			$j(this).addClass("selected");
			$j("#ub_box1").hide();
			$j("#ub_box2").hide();
			$j("#ub_box3").show(); return false;
		}
	);
});

jQuery.fn.DefaultValue = function(text){

    return this.each(function(){

		//Make sure we're dealing with text-based form fields

		if(this.type != 'text' && this.type != 'password' && this.type != 'textarea')

			return;

		

		//Store field reference

		var fld_current=this;

		

		//Set value initially if none are specified

        if(this.value=='') {

			this.value=text;

		} else {

			//Other value exists - ignore

			return;

		}

		

		//Remove values on focus

		$j(this).focus(function() {

			if(this.value==text || this.value=='')

				this.value='';

		});

		

		//Place values back on blur

		$j(this).blur(function() {

			if(this.value==text || this.value=='')

				this.value=text;

		});

		

		//Capture parent form submission

		//Remove field values that are still default

		$j(this).parents("form").each(function() {

			//Bind parent form submit

			$j(this).submit(function() {

				if(fld_current.value==text) {

					fld_current.value='';

				}

			});

		});

    });

};
