function dropDownSetup(){
	var pages = document.getElementById('menu').childNodes;
	for (var i in pages){
		pages[i].onmouseover = showDropDown;
		pages[i].onmouseout = hideDropDown;	
	}
}

function showDropDown(){
	children = this.childNodes;
	for (var i in children){
		if (children[i].tagName == "UL") {
			children[i].style.display = "block";
			break;
		}	
	}	
}

function hideDropDown(){
	children = this.childNodes;
	for (var i in children){
		if (children[i].tagName == "UL") {
			children[i].style.display = "none";
			break;
		}	
	}		
}

function setUpPreview(){
	var timer;
	$(".visual .preview, .comic .preview").hover(function(){
		pic = $(this);
		timer = setTimeout("preview()",500);	
	},
	function(){
		clearTimeout(timer);
	});
}
		
function preview(){
	margin = 20;
	body =  $(window);
	html = $("html");
	
	temp = pic.clone();
	temp.css({
		margin : 0,
		padding : 0,
		background : 'none',
		border : 0		
	});
	temp.children().css({
		margin : 0,
		padding : 0,
		background : 'none',
		border : 0, 
	});
	
	p = temp.find('img');
	p.css({width:'90%', margin : '0 auto', float:'none', display:'block'});
	
	pHeight = p.attr('height');
	pWidth = p.attr('width');
		
	w = .95 * body.width();
	h = w * pHeight / pWidth;
	
	if(w > .95 * body.width()){
		w = .95 * body.width();
		h = w * pHeight / pWidth;
	}
	
	if(h > .95 * body.height()){
		h = body.height() * .95;
		w = h * pWidth / pHeight;
	}
	
	
	
			
	temp.css({
		width : w + 'px',
		//height : h + "px",
		display : "block"});
	temp.find('a').css({color: 'black'});
	temp.find('h2').css('text-align','center');
	
		
	t = ($(window).height() - h - margin) / 2;
	l = ($(window).width() - w - margin) / 2;
	
	$('<div id="showPreview"></div>').css({
		top : t + 'px',
		left: l + 'px',
		display:'none',
		padding : '10px 0'
	}).mouseout(exit).append(temp).appendTo($("#contentShell")).fadeIn('slow');		

	$('<div id="backCover" style="display:none"></div>').appendTo(body).fadeIn('slow');	

	function exit(){
		$('#backCover').fadeOut('slow',function(){$(this).remove()});
		$('#showPreview').fadeOut('slow',function(){$(this).remove()});
	}
}

	


