// JavaScript Document

$(document).ready(function() { 

	// activate modal
	$('#modal').jqm({
		ajax: '@href', trigger: 'a.modal_trigger', target: '#remote_content'
		});

	// close modal
	$("#popup_close_button").css("cursor","pointer");
	$("#popup_close_button").click(function() {
		window.close();
		});	

	// target
	$('.exit a').attr('target', '_blank');	

	// img adjust
	$('#credit img').css({'position' : 'relative', 'top' : '4px'});

	// generate popups
	//$("a[@rel=popup], area[@rel=popup]").click(function(){
	//	popupWindow = window.open(this.href,this.title,'menu=no,toolbar=no,width=500,height=600,scrollbars=1,resizable=0,directories=no,location=no,screenX=0,screenY=0,top=48,left=48');
	//	popupWindow.focus()
	//	return false;
	//})

	//$("a[@rel=external], area[@rel=external]").click(function(){
	//	popupWindow = window.open(this.href,this.title,'toolbar=yes,width=800,height=600,status=yes,location=yes,menubar=yes,directories=yes,resizable=yes,scrollbars=yes');
	//	popupWindow.focus()
	//	return false;
	//})

// ======================================================
// show|hide
// ======================================================

//function boxToggle(){
//	if(page == "black") { 
//		$('#box').css({'display' : 'block', 'visibility' : 'visible'}); 
//	}else {	
//		$('#box').css({'display' : 'block', 'visibility' : 'visible'}); 
//	}
//}
//onload_register('boxToggle();');

	$(".btn a").hover(function() {
	  $(this).next("em").animate({opacity: "show", top: "-48"}, "slow");
	}, function() {
	  $(this).next("em").animate({opacity: "hide", top: "-78"}, "fast");
	});

	$(".dark").click(function(){
	  $("body")
	  .addClass("black")
	  return false;
	});

	$(".light").click(function(){
	  $("body")
	  .removeClass("black")
	  return false;
	});

});   

function openWindow(link) { 
	window.open(link, '_blank', 'width=800,height=600,toolbar=yes,status=yes,location=yes,menubar=yes,directories=yes,resizable=yes,scrollbars=yes');
	}

