function getObj(name){
	if (document.getElementById){
		this.obj = document.getElementById(name);
		this.style = document.getElementById(name).style;
	}
	else if (document.all){
		this.obj = document.all[name];
		this.style = document.all[name].style;
	}
}
function activateModalZoom() {
	var oZoomLink = new getObj('photobox_zoom_link');
	oZoomLink.style.display = "block";
	window.photobox_modalzoom_setupcomplete = true;
}
function fixMyMargin(widthObj,marginObj) {
	var oMarginObj = new getObj(marginObj);
	var oWidthObj = new getObj(widthObj);
	oMarginObj.style.width = oWidthObj.obj.clientWidth + "px";
	oMarginObj.style.margin = "230px auto";
	activateModalZoom();
}
function setupModalZoom(widget_image_src) {
	var oWidgetImage = new getObj('photobox_image');
	var oZoomImage = new getObj('photobox_zoom_image');
	var oZoomImageCloselink = new getObj('photobox_zoom_image_closelink');
	var oZoomCloseHint = new getObj('photobox_zoom_closehint');
	var oZoomTitle = new getObj('photobox_zoom_title');
        var oZoom = new getObj('photobox_modalzoom');
	window.oZoomPage = new getObj('photobox_modalzoom_page');
	oZoomImage.obj.src = widget_image_src;
	oZoomImage.obj.alt = oWidgetImage.obj.alt;
	oZoomImage.obj.title = oWidgetImage.obj.title + " (Click to return)";
	oZoomImageCloselink.obj.title = oWidgetImage.obj.title + " (Click to return)";
	oZoomCloseHint.obj.innerHTML = "Click anywhere to close this window.";
        oZoomTitle.obj.innerHTML = oWidgetImage.obj.title;
	oZoomImage.obj.onload = function() {fixMyMargin('photobox_zoom_image','photobox_modalzoom');}
}
/*function toggleModal(obj) {
	if (window.photobox_modalzoom_setupcomplete) {
		var oModal = new getObj(obj);
		oModal.style.visibility = (oModal.style.visibility == "visible") ? "hidden" : "visible";
	}
}*/
function toggleModalZoom() {
	if (window.photobox_modalzoom_setupcomplete) {
		window.oZoomPage.style.visibility = (window.oZoomPage.style.visibility == "visible") ? "hidden" : "visible";
	}
}



