
var imgBlank = new Image();
imgBlank.src = "assets/images/blank.gif";

function displayTitle(givenTitle) {
	window.document.titlePanel.SetVariable("txtTitle", givenTitle);
}

function displayCaption(givenCaption) {
	window.document.titlePanel.SetVariable("txtCaption", givenCaption);
}

function tileOver(obj) {
	var bgImg = document.getElementById("overlay");
	
	var bgURL = obj.style.backgroundImage;
	
	if (bgURL && bgImg) {
		bgImg.style.backgroundImage = bgURL;
	}
	
}

function tileOut() {
	var bgImg = document.getElementById("overlay");
	
	bgImg.style.backgroundImage = "none";
}

function popupStory(givenPath) {
	var pW = screen.width * (2/3);//
	var pH = 510;

	var winLeft = (screen.width - pW) / 2;
	var winTop = (screen.height - pH) / 2;
	
	/*
	var href;
	if(typeof(mylink) == 'string')
		href=mylink;
	else
		href=mylink.href;
	*/
	
	window.open("story.php?id="+givenPath, "moo", 'top=' + winTop + ',left=' + winLeft + ',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=' + pW + ',height=' + pH );
	
	return;
}

function popupFilm(givenPath) {
	var pW = 950;
	var pH = 400;

	var winLeft = (screen.width - pW) / 2;
	var winTop = (screen.height - pH) / 2;
	
	/*
	var href;
	if(typeof(mylink) == 'string')
		href=mylink;
	else
		href=mylink.href;
	*/
	
	window.open("film.php?id="+givenPath, "moo", 'top=' + winTop + ',left=' + winLeft + ',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=' + pW + ',height=' + pH );
	
	return;
}


function initTitlePanel(givenTitle) {
	if(givenTitle) {
		var txtTitle = "?txtTitle=" + escape(givenTitle);
	} else {
		var txtTitle = "?txtTitle=";
	}
	
	var titlePanel = "";

	//titlePanel += '		<div id="titleHolder">' + "\n";
	titlePanel += '			<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="460" height="50" id="titlePanel" align="middle">' + "\n";
	titlePanel += '				<param name="allowScriptAccess" value="sameDomain" />' + "\n";
	titlePanel += '				<param name="movie" value="assets/swf/titlePanel.swf' + txtTitle + '" />' + "\n";
	titlePanel += '				<param name="quality" value="high" />' + "\n";
	titlePanel += '				<param name="bgcolor" value="#ffffff" />' + "\n";
	titlePanel += '				<embed src="assets/swf/titlePanel.swf' + txtTitle + '" quality="high" bgcolor="#ffffff" width="460" height="50" name="titlePanel" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />' + "\n";
	titlePanel += '			</object>' + "\n";
	//titlePanel += '		</div> + "\n"';
	
	
	document.write(titlePanel);
}

function mooLogo(over) {
	var logo = document.getElementById("logo");
	
	if (logo) {
		if (over) {
			logo.style.backgroundImage = 'url(assets/images/moo_o.gif)';
			//alert(logo.style.backgroundImage);
		} else {
			logo.style.backgroundImage = 'url(assets/images/moo.gif)';
		}
	}
}
