// Kukusi.js

$(init);

function init(){
	
	var g= Style.geometry();
	
	var height = (g.innerHeight/2) - 277;
	
	if(height < 0){height = 0};
	
	
	$("#wrapper").css("top", height);
	
	$(".draggable").Draggable(
			{
				zIndex: 	1000,
				
				containment: "parent"
			}
		);
	
	$("#about").Draggable(
							  {
							  onStart: shiftZ,
							  zIndex: 	1000,
							  containment: "parent"
							  }
						  
						  );
	
	$("a.links").click(openLinks);
	$("a.about").click(openAbout);
	
	if(!$.browser.msie){
		$("div.shadow").fadeTo(0, 0.5);
	}
	
	$("a.closeButton").click(
					   
					   function(){
						
						$(this).parent().parent().hide();
						return false;
						   
					   }
					   
					   
					   );
	
}

function openLinks(){

closeDivs();
$("div#links").fadeIn(300);
return false;
		
}

function shiftZ(){

//$("#about div.shadow").css("zIndex", -100);
	
}

function openAbout(){

closeDivs();
$("div#about").fadeIn(300);
return false;	
	
}

function closeDivs(){

$("div#links").add("div#about").hide();
	
}