var urlHash = window.location.hash.substring(1).toLowerCase();
var O_Shell;
var O_Gallery;

function loadFlash() {
	O_Shell = new SWFObject("shell.swf", "main", "700", "500", 8, "#FFFFFF");
	O_Shell.addVariable("urlHash", urlHash);
	O_Shell.addParam("wmode", "opaque");
	O_Shell.write("flashcontent");
}

function loadGallery() {
	O_Gallery = new SWFObject("gallery.swf", "gallery", "1000", "700", 8, "#FFFFFF");
	O_Gallery.addParam("wmode", "transparent");
	O_Gallery.write("flash_gallery");
}

function showGallery() {
	
	if (document.getElementById("flash_gallery")) {
    	document.getElementById("flash_gallery").style.height = "700px"
		if (document.getElementById("gallery")) {
			document.getElementById("gallery").showGallery();
		}
		if (document.getElementById("main")) {
			document.getElementById("main").disableBtns();
		}
	}
}

function hideGallery() {
	if (document.getElementById("flash_gallery")) {
  		document.getElementById("flash_gallery").style.height = "1px";
		if (document.getElementById("main")) {
			document.getElementById("main").startImgRotate();
			document.getElementById("main").enableBtns();
		}
	}
}

function showPhotography() {
	if (document.getElementById("main")) {
		document.getElementById("main").showPhotography();
	}
	hideGallery();
}

function enableInputFix() {
	if (document.getElementById("gallery")) {
		document.getElementById("gallery").enableInputFix();
	}
}

function disableInputFix() {
	if (document.getElementById("gallery")) {
		document.getElementById("gallery").disableInputFix();
	}
}

addDOMLoadEvent(loadFlash);
addDOMLoadEvent(loadGallery);