/*
var swfversion = deconcept.SWFObjectUtil.getPlayerVersion();
var noflash = deconcept.util.getRequestParameter("noflash");
var printerfriendly = deconcept.util.getRequestParameter("printerfriendly");
var flash = deconcept.util.getRequestParameter("flash");
if (flash=='yes') eraseCookie('flash');
if (flash=='no'||readCookie('flash')=='no') {createCookie('flash','no',1); noflash=1;}
if (document.getElementById && (swfversion['major'] > 8) && noflash=='' && printerfriendly=='') {
	document.writeln("<STYLE>.divFlash{display:block;}.divHtml{display:none;}</"+"STYLE>");
}
*/

var debug = true;
/* ==================== */

$(document).ready(function(){

	if (!MM_FlashCanPlay) {
		var u = $(".gallery").attr("href");
			if(typeof(u)!='undefined') {
			if (u.indexOf('?')<0) {
				u+="?noflash=1";
			} else {
				u+="&noflash=1";
			}
			$(".gallery").attr("href",u);
		}
	}

	init();
})

/* this function is called when the page is ready or after an ajax call has completed */

function init() {

	$(".gallery").addClass('iframe');
	
	/* image = 640 x 368, height = 368 + 64 + 2 = 434 */
	$(".gallery").fancybox({
		'showCloseButton': true,
		'type': 'iframe',
		'scrolling': 'no',
		'width': '90%',
		'height': 576
	});

}

// flash detection!
var MM_contentVersion = 8;/* 8 */
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i]; 
	    }
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
}
