﻿

jQuery(document).ready(function(){

	$("#PlanetButton1").mouseover(function() {	
			$(this).attr({  
				src: "./bilder/PlanetRobin9.png", 
			});
			$("#Achtung").css("display","block");
			
		});
	
		$("#PlanetButton1").mouseout(function() {	
			$(this).attr({  
				src: "./bilder/PlanetRobin10.png", 
			});
			$("#Achtung").css("display","none");
		});	
		
		$("#PlanetRobin").mouseover(function() {	
			$(this).attr({  
				src: "./bilder/the-planet-Robin_wtc.png", 
			});
			
			
		});
		
		$("#PlanetRobin").click(function() {
				//$('#base').toggle();		
				$("#kopf, #main, #base").toggle();

				for(i=1;i<4;i++){
				$("#base").animate({"marginLeft": "+=30px"}, 500)
					.animate({"marginLeft": "-=30px"}, 500);
				}
		});
		
	
		$("#PlanetRobin").mouseout(function() {	
			$(this).attr({  
				src: "./bilder/the-planet-Robin_btc.png", 
			});
			
			
		});	
		
		/**/
		for(i=1;i<4;i++){
		$("#Sonne")
			.animate({"top": "+=30px", "right": "-=550px"}, 15000)
			.animate({"top": "-=10px", "right": "+=550px"}, 15000);
		}$("#Sonne").animate({"top": "+=-80px", "right": "-=500px"}, 30000)
		/**/
		
		/*
		for(i=1;i<7;i++){
		$("#Sonne")
			.animate({"top": "+=100px", "left": "+=550px"}, 15000)
			.animate({"top": "+=150px", "left": "+=100px"}, 7000)
			.animate({"top": "+=50px", "left": "-=100px"}, 7000)
			.animate({"top": "-=100px", "left": "-=550px"}, 12000)
			.animate({"top": "-=150px", "left": "-=100px"}, 19000)
			.animate({"top": "-=50px", "left": "+=100px"}, 7000);
		}
		*/
		
		$('#menu .settings').each(function() {
			$(this).click(function() {
			$('.itemlist').stop().slideToggle(1000);
			
			if (this.style.background == "black") {
				this.style.background = "maroon";
			} else {
				this.style.background = "blacks";
			}
		}); });
					
		
  		$(".menuitem").each(function() {
			//pos = $("#menu ul li h6").index(this);
			$(this).click(function() {
				//save = $("#menu ul li").index(this);
				//console.log(save);
				pos = $(".menuitem").index(this);
				//save = $(this).next('ul'); //nextAll
				//console.log(pos);
				$('.itemlist').eq(pos).slideToggle(1000);
	 
		}); });  

 		//$("#menu ul li").click(function(e) {
				//save = $("#menu ul li").index(this);
				//console.log(save);
				//save = $(e.target).children('ul');
				//console.log(save);
				//.stop().slideToggle();
			//e.preventDefault(); 
			//return false; 		 
		//});   
   
   
   
    $('#menu ul ul li:first').css({borderTop:"2px solid black"});
	$('#menu ul ul li:last').css({borderBottom:"2px groove black"});
   
   
   
	$('#menu ul li').hover(function() {
		$(this).stop().animate({paddingLeft:"50px",textShadow:"yellow 1px 1px"});
	}, function() {
		$(this).stop().animate({paddingLeft:"20px"});
	});
	

	$('.imgfullbutton, .imgfullbutton2, .imgfullbutton3').hover(function() {
		$(this).stop().animate({width:"24px"});
	}, function() {
		$(this).stop().animate({width:"20px"});
	});	
	/*
	$('.imgfullbutton').hover(function() {
		$(this).css({backgroundImage:"planet_dev_24inch.png"});
	}, function() {
		$(this).css({backgroundImage:"planet_dev_24inch.png"});
	});
	*/
	
	
 		   
    		

	//$('.lightbo').lightBox();
	//$('#content a').mouseover(function() {

		//$(this, "> img0").lightBox();	
		//$("#content a").hasClass('newtab').attr({ target: "_blank" });			
	//});
	
	//$('#content a').click(function() {
		$('#content a').lightBox();	
	//});
	
	
	
	/*.not('img')
	$("#content a").not('* > img').tooltip({
		track: true,		
		delay: 0,
		showURL: false,
		showBody: " - ",
		extraClass: "pretty",
		fixPNG: true,
		left: 6,
		top: 6
	});
	*/
	
	htmlwidth = $('html').css("width");
	htmlwidth = htmlwidth.replace(/px/,"");
	if (htmlwidth > 1400) {
		$('#main').css({width:"1408px"});
		$('#content').css({width:"1036px"});		
	}
	
	
	$('#PlanetButton1').ColorPicker({
		color: '#0000ff',
		onShow: function (colpkr) {
			$(colpkr).fadeIn(500);
			return false;
		},
		onHide: function (colpkr) {
			$(colpkr).fadeOut(500);
			$('#kopf').fadeOut(500);
			$('#main').css("margin","40px auto 0px auto");

			return false;
		},
		onChange: function (hsb, hex, rgb) {
			$('body').css('backgroundColor', '#' + hex);
			
		}
	});
				//, function() {)};
			//$('#kopf').sildeUp();//("slow")//, function() {
				//$('#main').animate("marginTop","40px");
			//});
	
	
	//$(function(){
		/*$('.wide').columnize({columns:2});*/
		$('.getthin').columnize({ columns : 2 });
	//});
/*
			$(function(){
			$('.getthin').columnize({
				width : 300,
				overflow : {
					id : ".thin",
					height : 285,
					doneFunc : function(){
						$('.getthin').columnize({ columns : 2 });
					}
				}
			});
		});
*/	
	/*
	$("#content a").tooltip({
		delay: 0, 
		showURL: false,
		bodyHandler: function() { 
			return $($(this).attr("href")).html();
			//return $("<img/>").attr("src", this.src); 
			
		} 
	});
	*/
	// show pic as tooltip
	
	
	//.fadeOut(500, function() {
	//	$('.ib').fadeIn();
	//});
	
	//.css("display","none");
	
	
	
	
});


