var currentmax = 2000;

$(document).ready(function(){
	$.superbox();
//    $.history.init(callback);
});

$(window).resize(function(){
 	var w = ((document.body.clientWidth - 40) > currentmax) ? currentmax : document.body.clientWidth - 40;
	document.getElementById("superbox").style.width = w+"px";
	document.getElementById("superbox-innerbox").style.width = "100%";
});

$("a#pano").live("click", function(){
	currentmax = this.className.split('w-')[1].split(' ')[0];
});

$("a#supersize").live("click", function(){
	currentmax = this.className.split('w-')[1].split(' ')[0];
});

$("a#editclink").live("click", function(){
	document.getElementById("captioneditor").style.display = "block";
	return false;
});

$("a#capcancel").live("click", function(){
	document.getElementById("captioneditor").style.display = "none";
});

$("a.hijax").live("click", function(){
	this.parentNode.style.display = "none";
});
