/* BrowserDetect: http://www.quirksmode.org/js/detect.html */
var BrowserDetect={
	init:function() { this.browser = this.searchString(this.dataBrowser) || "Unknown Browser"; this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "Unknown Version"; this.OS = this.searchString(this.dataOS) || "Unknown OS"; },
	searchString:function(data) { for (var i=0;i<data.length;i++)	{ var dataString = data[i].string; var dataProp = data[i].prop; this.versionSearchString = data[i].versionSearch || data[i].identity; if (dataString) { if (dataString.indexOf(data[i].subString) != -1) {return data[i].identity;} } else if (dataProp) { return data[i].identity; } } },
	searchVersion:function(dataString) { var index = dataString.indexOf(this.versionSearchString); if (index == -1) {return;} return parseFloat(dataString.substring(index+this.versionSearchString.length+1)); },
	dataBrowser:[
		{ string: navigator.userAgent, subString: "OmniWeb", versionSearch: "OmniWeb/", identity: "OmniWeb" },
		{ string: navigator.vendor, subString: "Apple", identity: "Safari" },
		{ prop: window.opera, identity: "Opera" },
		{ string: navigator.vendor, subString: "iCab", identity: "iCab" },
		{ string: navigator.vendor, subString: "KDE", identity: "Konqueror" },
		{ string: navigator.userAgent, subString: "Firefox", identity: "Firefox" },
		{ string: navigator.vendor, subString: "Camino", identity: "Camino" },
		{ string: navigator.userAgent, subString: "Netscape", identity: "Netscape" }, // newer Netscapes (6+)
		{ string: navigator.userAgent, subString: "MSIE", identity: "Explorer", versionSearch: "MSIE" },
		{ string: navigator.userAgent, subString: "Gecko", identity: "Mozilla", versionSearch: "rv" },
		{ string: navigator.userAgent, subString: "Mozilla", identity: "Netscape", versionSearch: "Mozilla" } // older Netscapes (4-)
	],
	dataOS:[{ string: navigator.platform, subString: "Win", identity: "Windows" }, { string: navigator.platform, subString: "Mac", identity: "Mac" }, { string: navigator.platform, subString: "Linux", identity: "Linux" } ]
}; BrowserDetect.init();

/* make sure the lytebox script is available */
var script  = document.createElement('script');
script.src  = PRIMARY_SERVER_DOMAIN + '/js/lytebox.js';
script.type = 'text/javascript';
document.getElementsByTagName('head').item(0).appendChild(script);

/* XML parsing code */
var xmlDoc;
var fgInnerHtml = '';
function loadXML() {
	// code for IE
	if (window.ActiveXObject) {
	  	xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
	  	xmlDoc.async=false;
	  	xmlDoc.load(PicLensLite.feedXML_);
		getmessage();
	}
	// code for Mozilla, Firefox, Opera, etc.
	else if (document.implementation && document.implementation.createDocument) {
	  	xmlDoc=document.implementation.createDocument("","",null);
	  	xmlDoc.load(PicLensLite.feedXML_);
		xmlDoc.onload=getmessage;
	}
	else {
	  alert('Your browser cannot handle this script');
	}
}

function getmessage() {
	var x = xmlDoc.getElementsByTagName('*');
	fgInnerHtml = PicLensLite.flash_fg_.innerHTML +
		'<link rel="stylesheet" href="' + PRIMARY_SERVER_DOMAIN +'/css/lytebox.css" type="text/css" media="screen" />' +
		'<div id="lightbox_images" align="center" style="padding-top:10px; color:#FFFFFF; font-size:12px; color:#999999;">';
	var firstImage = true;
	for (i = 0; i < x.length; i++) {
		if (x[i].nodeName == "media:content") {
			var strURL = x[i].getAttribute("url");
			//alert(x[i].childNodes[0].nodeValue);
			if (strURL.indexOf(".flv") == -1) {
				if (firstImage) {
					fgInnerHtml = fgInnerHtml + 
					'( Alternatively, click <a href="'+x[i].getAttribute("url")+'" rel="lyteshow[lite]">' +
					'here</a> for a basic slideshow )';
					firstImage = false;
				} else {
					fgInnerHtml = fgInnerHtml + 
					'<a href="'+x[i].getAttribute("url")+'" rel="lyteshow[lite]"></a>';
				}
			}
		}
	}
	PicLensLite.flash_fg_.innerHTML = fgInnerHtml;
	myLytebox.updateLyteboxItems(); // buggy <-- where do we define myLytebox?
}

// piclens.js -- attaches PicLens JavaScript API as window.piclens

(function() {
    if (window.piclens) {
        return;
    }
    var context = null;
    if (typeof PicLensContext != 'undefined') {
        // Firefox (IE and Safari not yet implemented)
        context = new PicLensContext();
    }
    piclens = context;
})();


function tryToLaunchPicLensClient(url) {
// 启动window的piclens插件，带3D功能
		window.piclens.launch(url,'','');
		return true;

//		return false;		
/* 原方法：当版本小于1.6.0.824时，启动window的piclens插件，带3D功能
	if (window.piclens && window.piclens.version=="1.6.0.824") {
		window.piclens.launch(url,'','')
		return true;
	} else {
		return false;
	}
*/
}

// PicLens Lite 1.0
//
// We should also prefetch the smaller logo images to improve the responsiveness of the initial download
// Ideally, we can also clean this JS file up, but that is lower priority. (Correctness before Performance) :^)
var PicLensLite = {

	// The PicLensLite public API contains one function: either call PicLensLite.start(), or pass in an object literal with named arguments, e.g., PicLensLite.start({feedUrl:'http://myWebsite.com/myFeed.xml'});
	start : function(namedArgs) {
		
		
		// clear the fields as if they have been set before...
		this.homepageLabel_ = "";
		this.feedXML_ = "";

		// clear this so that we will have to reinstantiate the flash object
		this.flash_bg_ = false;
		
		// the feed to load	
		var targetFeedUrl = "";
		var feedData;
	
		// the named arguments we support
		if (typeof namedArgs != "undefined") {
			if (typeof namedArgs.homePageLabel != "undefined") {
				this.homepageLabel_ = namedArgs.homePageLabel;
			}
			if (typeof namedArgs.feedUrl != "undefined") {
				targetFeedUrl = namedArgs.feedUrl;
			} 
			if (namedArgs.feedData) { // pass in the feed XML directly through Javascript
				feedData = namedArgs.feedData;
			}
		}
		
		if (feedData) {
			this.feedXML_ = feedData;
			this.showFlashUI();
		} else if (targetFeedUrl == "") {
			if (!this.feeds_) { // build list of XML feeds
				this.indexFeeds();
			}
			if (this.feeds_.length != 0) { // view the first feed, if available
				var feed = this.feeds_[0];
				this.startWithUrl(feed.url);
			}
		} else {
			this.startWithUrl(targetFeedUrl); // open the specified URL
		}
	},

	// PRIVATE API BELOW...
	MARGIN_W         : 80, // for the lightbox
	MARGIN_H         : 60,
	MARGIN_W_THIN    : 60,
	MARGIN_H_THIN    : 20,
	MARGIN_W_THIN_2  : 120,
	MARGIN_H_THIN_2  : 40,
	PLL_URL          : "http://lite.piclens.com/",
	FL_URL           : "http://lite.piclens.com/current/PicLensLite.swf",
	FL_URL_DEBUG_WEB : "http://staging.lite.piclens.com/current/PicLensLite.swf",
	FL_URL_DEBUG_FS  : "../bin/PicLensLite.swf",
	FL_GIF             : "http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif",
	GET_FL             : "http://www.adobe.com/go/getflashplayer",
	PL2				   : "PLLFlash2",
	
	piclensIsRunning_  : false,	
	feeds_             : null,
	xmlLoader_         : null,
	fadeTimer_         : null,
	homepageLabel_     : "",	
	feedXML_           : "",
	
	isSafari           : navigator.userAgent.indexOf('Safari') != -1,
	isFirefox		   : navigator.userAgent.indexOf('Firefox') != -1,
	isIE		       : navigator.userAgent.indexOf('MSIE') != -1,
	isIE6 : function() {
		try {
			if (typeof document.body.style.maxHeight === "undefined") { // IE 6
				return true;
			} else {
				return false;
			}
		} catch (e) {
			return false;
		}
	},
	startWithUrl : function(feedUrl) {
		
		if (tryToLaunchPicLensClient(feedUrl)) {
			return;
		}
		
		
		
		this.feedXML_ = feedUrl;
		if (this.xmlLoader_) { // cancel any pending load
			this.xmlLoader_.abort();
			this.xmlLoader_ = null;
		}

		// start loading XML
		var self = this; this.xmlLoader_ = this.createXHR(feedUrl, function() { self.onLoadStatusChanged(); });

		// showFlashUI used to be here...
	},
	addKeyHandlers : function() {
		var self = this;
		document.onkeydown = function(e){
	        if (e == null) { // ie
	          keycode = event.keyCode;
	        } else { // mozilla
	          keycode = e.which;
	        }

	        if (keycode == 27){ // ESC to close
				self.closeFlashUI();
	        } else {
	        	// forward to Flash
	        	self.keyPressed(keycode);
	        }
	        return false;
		}

		// this is the handler for forwarding mouse scroll info to the flash component
		this.forwardMouseScroll_ = function(e) {self.scrollWheelMoved(e); return false;}; 

		// remove mouse scroll
		if (window.addEventListener) {
			window.addEventListener("DOMMouseScroll", this.forwardMouseScroll_, false);
		}
		// do stuff for IE/Opera/etc..
		if (document.attachEvent) {
			document.attachEvent("onmousewheel", this.forwardMouseScroll_);
		}
		// other browsers?
		// TODO: perhaps we should only do ONE of these, but not ALLL....
		window.onmousewheel = document.onmousewheel = this.forwardMouseScroll_;
	},
	sendTextToFlash : function(str) {
		if (this.piclensIsRunning_) {
			this.getFlash2().fl_sendTextToFlash(str);
		}
	},
	keyPressed : function(code) {
		// safari gets here... seems like it doesn't do ExternalInterface?
		// it does on Windows/Safari3, at least...
		if (!this.piclensIsRunning_) { return; }
		
		if (this.isSafari) { // does this work??
			this.getFlash().fl_keyPressed(code);
		} else {
			this.getFlash2().fl_keyPressed(code); // others need this one
		}
	},
	sendMouseMovementToFlash : function(delta) {
		if (!this.piclensIsRunning_) { return; }
		if (this.isSafari) { // WOW this works!
			this.getFlash().fl_mouseMoved(delta);
		} else {
			this.getFlash2().fl_mouseMoved(delta);
		}
	},
	scrollWheelMoved : function(event) {
		// event.wheelDelta
		// Safari/Windows (MouseWheel Up is +120; Down is -120)
		var delta = 0;
		if (!event) {
			event = window.event;
		}
		if (event.wheelDelta) { // IE/Opera
			delta = event.wheelDelta/120;
			if (window.opera) {
				delta = -delta;
			}
		} else if (event.detail) { // Firefox/Moz
			// on mac, don't divide by 3...
			if (Math.abs(event.detail) < 3) {
				delta = -event.detail;
			} else {
				delta = -event.detail/3;
			}
		}
		if (delta) {
			// don't send abs values < 1; otherwise, you can only scroll next
			this.sendMouseMovementToFlash(delta);		
		}
		if (event.preventDefault) {
			event.preventDefault();
		}
		event.returnValue = false;
	},
	getCurrentURL : function() {
		return location.href;
	},
	getHomePageName : function() {
		return this.homepageLabel_;
	},
	indexFeeds : function() {
		var linkTags = document.getElementsByTagName("link");
		this.feeds_ = [];
		for (var i = 0; i != linkTags.length; ++i) {
			var link = linkTags[i], type = link.getAttribute("type");
			if (type == "application/rss+xml" || type == "text/xml") {
				this.feeds_.push({
					title: link.getAttribute("title"),
					url: link.getAttribute("href")
				});
			}
		}
	},
	createXHR : function(url, callback) {
		var req;
		if (window.XMLHttpRequest) { // native XHR
	        req = new XMLHttpRequest();
	    }
		else if (window.ActiveXObject) { // IE/ActiveX
			try {
			    req = new ActiveXObject("Microsoft.XMLHTTP"); // IE 6 goes into this branch too
		    } catch(exc) {
		        req = new ActiveXObject("MSXML2.XMLHTTP.3.0");
		    }
	    }
	    
		if (req) {
	 		req.onreadystatechange = callback;

			if (BrowserDetect.browser == "Explorer" || 
				BrowserDetect.browser == "Opera" || 
				BrowserDetect.browser == "Safari") { // I know this is bad... but it works.
				var sep = (-1 < url.indexOf("?")) ? "&" : "?";
				var randurl = url + sep + "_pll=" + encodeURIComponent((new Date()).getTime()); // IE workaround to avoid caching...
		    	req.open("GET", randurl, true); // bAsync = true, can't test with IE7 on local filesystem (Access Denied)
				req.setRequestHeader("Cache-Control", "no-cache"); 
			} else {
		    	req.open("GET", url, true); // bAsync = true, can't test with IE7 on local filesystem (Access Denied)
			}

			req.send("");
		}
		return req;
	},
	onLoadStatusChanged : function() {		
		// extract feed data
		var xhr = this.xmlLoader_;
		if (!xhr) return;

		// check for success or failure
		if (xhr.readyState == 4) {
			// alert("State: " + xhr.readyState);
			var dom = xhr.responseXML;
			var text = xhr.responseText;
			
			if (xhr.status == 200 || xhr.status == 0) { // xhr.status == 0 implies the local file system
				// set the XML of the feed so we can access it from Flash
				this.feedXML_ = text;
				
				// moved showFlash UI to here...
				this.showFlashUI();
				
			} else {
				// alert('PicLens Lite could not find the RSS feed.');
			}
			this.xmlLoader_ = null;
		} else {
			//alert("State: " + xhr.readyState);
			// opera only ever gets to state 3???
			// also doesn't seem to support external interface... we should embed it via flash vars then!
			//this.feedXML_ = xhr.responseText;
		}
		
	},
	showFlashUI : function() {
		this.piclensIsRunning_ = true;
		this.addKeyHandlers();

		if (!this.flash_bg_) {

			// configure background layer
			var bg = document.createElement('div'), self = this;

			// the window size
			var winSize = this.getWindowSize();

			bg.style.width = winSize.w;
			if (this.isIE6()) {
				bg.style.position = 'absolute';
				bg.style.height = document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px';
			} else if (BrowserDetect.browser == "Explorer") { // IE7
				bg.style.position = 'fixed'; // buggy on some tests... :( Seems like zIndex only matters when we are NOT in fixed for IE
				bg.style.height = winSize.h;
			} else {
				bg.style.position = 'fixed';
				bg.style.height = winSize.h;
			}
			
			bg.style.left = 0;
			bg.style.right = 0;
			bg.style.top = 0;
			bg.style.bottom = '0';
			bg.style.backgroundColor = '#000';

			bg.style.opacity = '0.5';
			bg.style.filter = 'alpha(opacity=50)'; // IE7

			bg.style.zIndex = 1000;
			bg.onclick = function() { self.closeFlashUI(); };
		
			// configure box appearance
			var fg = document.createElement('div');
			fg.style.backgroundColor = '#000';
			if (this.isIE6()) {
				fg.style.position = 'absolute';
				fg.style.width = (winSize.w - this.MARGIN_W_THIN_2) + 'px';
				fg.style.height = (winSize.h - this.MARGIN_H_THIN_2) + 'px';
			} else {
				fg.style.position = 'fixed';
			}

			if (!this.isSafari) {
				// use a smaller margin if the window size is <= 1280
				//if (winSize.w <= 1280) {
					fg.style.left = fg.style.right = this.MARGIN_W_THIN + 'px';
					fg.style.top = fg.style.bottom = this.MARGIN_H_THIN + 'px';
				//} else {
				//	fg.style.left = fg.style.right = this.MARGIN_W + 'px';
				//	fg.style.top = fg.style.bottom = this.MARGIN_H + 'px';
				//}
			}
			fg.style.border = '2px solid #555';
			fg.style.zIndex = 1001;
			fg.id = "flashdiv";
			
			// @deprecated: instead of using FlashVars, allow Flash to call JavaScript
			var myVars = "";

			// store references to inserted divs
			this.flash_bg_ = bg;
			this.flash_fg_ = fg;
						
			// insert into document
			var osx = BrowserDetect.OS == "Mac";
			var ffx = BrowserDetect.browser == "Firefox";
			if ((osx&&ffx)) {
				bg.style.opacity = '1.0';
			}
			document.body.appendChild(bg);
			document.body.appendChild(fg);

			// inject player
			var w, h;
			if (this.isSafari) {
				w = '1';
				h = '1';
			} if (this.isIE6()) {
				w = winSize.w - this.MARGIN_W_THIN_2;
				h = winSize.h - this.MARGIN_H_THIN_2;
			} else {
				w = '100%';
				h = '100%';
			}
			
			var objParams = "";
			if (!this.isIE6()) {
				objParams = ' width="'+w+'" height="'+h+'" play="true" bgcolor="#000000" id="'+this.PL2+'" name="'+this.PL2+'" ';
			} else {
				objParams = ' width="0" height="0" play="true" visible="false" bgcolor="#000000" id="'+this.PL2+'" name="'+this.PL2+'" ';
			}
			
			var v = swfobject.getFlashPlayerVersion();
			
			if (swfobject.hasFlashPlayerVersion("9.0.28") || (BrowserDetect.browser == "Explorer" && BrowserDetect.version == "7" && v.major == 0)) { // IE7 / Flash Detection Bug
				fg.innerHTML = 
				'<object id="PLLFlash" name="PLLFlash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+w+'" height="'+h+'">' + 
					'<param name="movie" value="' + this.getFlashURL() + '" />' + 
					'<param name="quality" value="high"/> ' +
					'<param name="bgcolor" value="#000000"/> ' +
					'<param name="allowScriptAccess" value="always"/> ' +
					'<param name="FlashVars" value="' + myVars + '"/> ' +
					'<param name="allowFullScreen" value="true"/> ' +
					'<param name="wmode" value="window"/> ' +
					'<param name="scale" value="noscale"/> ' +
					'<object type="application/x-shockwave-flash" data="' + this.getFlashURL() + '" quality="high" ' +
						objParams + 
						'loop="false" ' +
						'quality="high" ' +
						'FlashVars="' + myVars + '" ' +
						'allowFullScreen="true" scale="noscale" wmode="window" ' +
						'allowScriptAccess="always">' +
						'<div align="center" style="padding-top:60px; padding-left:60px; padding-right:60px; padding-bottom:10px; color:#999999; font-family:Tahoma,sans-serif;">' + 
							'<h1>This Slideshow Requires Adobe Flash:</h1>' + // put piclens ad here too...
							'<p><a href="'+this.GET_FL+'"><img src="'+this.FL_GIF+'" alt="Get Flash" /></a></p>' +
						'</div>' + 
					'</object>' + 
				'</object>';
			} else { // get Flash!
				fg.innerHTML = '<div align="center" style="padding-top:60px; padding-bottom:10px; color:#999999;">' +
				'Your browser currently has Adobe Flash version ' + v.major + '.' + v.minor + '.' + v.release + '<br /><br />' +
				'Either <span style="color:#66CCFF">PicLens</span> or Adobe Flash Player v. 9.0.28 or greater is required to view this slideshow.<br /><br />' +
				'<table border="0" align="center" cellpadding="5" cellspacing="0">' +
				  '<tr>' +
					'<td align="center" valign="middle"><a href="http://www.piclens.com/welcome/fullscreen-welcome.php"><img src="http://lite.piclens.com/images/GetPicLens.jpg" alt="Get PicLens" border="0" /></a><br /><br /><span style="font-size:12px; padding-top:4px">*Available for Firefox and Safari</span></td>' +
					'<td width="125" align="left" valign="middle"><span style="font-size:12px">Get PicLens, a free browser add-on for full-screen slideshows throughout the web. </span></td>' +
					'<td align="center" valign="middle"><span style="font-size:40px; font-weight:bold">or</span></td>' +
					'<td align="center" valign="middle"><span style="font-size:12px">Get Adobe Flash Player<br />' +
					  '</span>' +
					  '<table width="100%" border="0" cellspacing="0" cellpadding="2">' +
						'<tr>' +
						  '<td><a href="http://www.adobe.com/go/getflashplayer"><img src="http://lite.piclens.com/images/flash_icon.jpg" alt="Flash Logo" border="0" /></a></td>' +
						  '<td><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" width="112" height="33" border="0" /></a></td>' +
						'</tr>' +
					  '</table>' +
					'</td>' +
				  '</tr>' +
				'</table>' +
				'</div>';
				if (this.isIE || this.isFirefox) {
					loadXML();
				} else {
					fg.innerHTML = fg.innerHTML +
					'<br /><br /><br /><div align="center" style="color:#666666; font-size:9px">&copy; 2007 Cooliris, Inc. All trademarks are property of their respective holders.</div>';
				}
			}

			
			// resize widget to fit window
			if (this.isSafari) {
				this.resizeUI();
			}

			// make visible
			this.flash_bg_.style.display = 'block';
			this.flash_fg_.style.display = 'block';
		} else {
			document.body.appendChild(this.flash_bg_);
			document.body.appendChild(this.flash_fg_);
			this.flash_bg_.style.display = 'block';
			this.flash_fg_.style.display = 'block';
		}
		if (!this.resizeWatched && this.isSafari) {
			var self = this;
			window.addEventListener('resize', function() { self.resizeUI(); }, false);
			this.resizeWatched = true;
		}
	},
	closeFlashUI : function() {
		this.piclensIsRunning_ = false;
		var self = this;
		
		// remove the handlers...
		document.onkeydown = "";
		window.onmousewheel = document.onmousewheel = "";
		if (window.removeEventListener) {
			window.removeEventListener("DOMMouseScroll", this.forwardMouseScroll_, false);
		}
		this.flash_bg_.style.display = 'none';
		this.flash_fg_.style.display = 'none';
		document.body.removeChild(this.flash_bg_);
		document.body.removeChild(this.flash_fg_);
	},
	getWindowSize : function() { // inner size
		var w = 0, h = 0;
		if (typeof(window.innerWidth) == 'number') {
			// not IE
			w = window.innerWidth;
			h = window.innerHeight;
		} else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
			// IE 6+ in 'standards compliant mode'
			w = document.documentElement.clientWidth;
			h = document.documentElement.clientHeight;
		} else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
			// IE 4 compatible
			w = document.body.clientWidth;
			h = document.body.clientHeight;
		}
		return {w:w, h:h}
	},
	resizeUI : function() { // resize event handler
		// compute layout; use a thinner margin if the window size is <= 1280
		var winSize = this.getWindowSize();
		var w = 780;
		var h = 580;
		if (winSize.w <= 1280) {
			w = Math.ceil(winSize.w - 2*this.MARGIN_W_THIN);
			h = Math.ceil(winSize.h - 2*this.MARGIN_H_THIN);
		} else { // big window
			w = Math.ceil(Math.max(winSize.w * 0.8, winSize.w - this.MARGIN_W));
			h = Math.ceil(Math.max(winSize.h * 0.8, winSize.h - this.MARGIN_H));
		}
		var x = Math.ceil((winSize.w - w) / 2.0);
		var y = Math.ceil((winSize.h - h) / 2.0);

		
		// apply layout
		var fg = this.flash_fg_;
		var flashObj = this.getFlash();
		fg.style.left = x + 'px';
		fg.style.top = y + 'px';
		fg.style.width = w + 'px';
		fg.style.height = h + 'px';
		flashObj.style.width = w + 'px';
		flashObj.style.height = h + 'px';
		flashObj.width = w;
		flashObj.height = h;
	},
	getFeedFromJS : function() { // Flash polls this to get the feed...
		return this.feedXML_;
	},
	getFlashURL : function() {
		var fs = typeof DEBUG_PICLENS_FS != "undefined";
		if (typeof DEBUG_PICLENS_WEB == "undefined" && !fs) { // production
			return this.FL_URL;
		} else if (!fs) { // debug
			return this.FL_URL_DEBUG_WEB;
		} else {
			return this.FL_URL_DEBUG_FS;
		}
	},
	focusOnFlash : function () { // place focus on the Flash item; only works in some browsers
		this.getFlash2().focus();
	},
	getFlash : function() {
		return document.getElementById("PLLFlash");
	},
	// works for Javascript/Flash Bridge
	// also works for OSX Firefox's Focus
	getFlash2 : function() { 
		return document.getElementById(this.PL2);
	},
	hasPLClient : function() {
		if (window.piclens) {
			return true;
		} else {
			return false;
		}
	}
}

/*	SWFObject v2.0 rc1 <http://code.google.com/p/swfobject/>
	Copyright (c) 2007 Geoff Stearns, Michael Williams, and Bobby van der Sluis
	Released under the MIT License: http://www.opensource.org/licenses/mit-license.php */
var swfobject=function(){var _1=[];var _2=[];var _3=null;var _4=null;var _5=false;var _6=false;var ua=function(){var _8=typeof document.getElementById!="undefined"&&typeof document.getElementsByTagName!="undefined"&&typeof document.createElement!="undefined"&&typeof document.appendChild!="undefined"&&typeof document.replaceChild!="undefined"&&typeof document.removeChild!="undefined"&&typeof document.cloneNode!="undefined";var _9=[0,0,0];var d=null;if(typeof navigator.plugins!="undefined"&&typeof navigator.plugins["Shockwave Flash"]=="object"){d=navigator.plugins["Shockwave Flash"].description;if(d){d=d.replace(/^.*\s+(\S+\s+\S+$)/,"$1");_9[0]=parseInt(d.replace(/^(.*)\..*$/,"$1"),10);_9[1]=parseInt(d.replace(/^.*\.(.*)\s.*$/,"$1"),10);_9[2]=/r/.test(d)?parseInt(d.replace(/^.*r(.*)$/,"$1"),10):0;}}else{if(typeof window.ActiveXObject!="undefined"){var a=null;var _c=false;try{a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_9=[6,0,21];a.AllowScriptAccess="always";}catch(e){if(_9[0]==6){_c=true;}}if(!_c){try{a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}}if(!_c&&typeof a=="object"){try{d=a.GetVariable("$version");if(d){d=d.split(" ")[1].split(",");_9=[parseInt(d[0],10),parseInt(d[1],10),parseInt(d[2],10)];}}catch(e){}}}}var u=navigator.userAgent.toLowerCase();var p=navigator.platform.toLowerCase();var _f=/webkit/.test(u);var _10=_f?parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):0;var ie=false;var win=p?/win/.test(p):/win/.test(u);var mac=p?/mac/.test(p):/mac/.test(u);/*@cc_on ie=true;@if(@_win32)win=true;@elif(@_mac)mac=true;@end@*/return {w3cdom:_8,playerVersion:_9,webkit:_f,webkitVersion:_10,ie:ie,win:win,mac:mac};}();var _14=function(){if(!ua.w3cdom){return;}addDomLoadEvent(main);if(ua.ie&&ua.win){try{document.write("<script id=__ie_ondomload defer=true src=//:></script>");var s=document.getElementById("__ie_ondomload");if(s){s.onreadystatechange=function(){if(this.readyState=="complete"){this.parentNode.removeChild(this);callDomLoadFunctions();}};}}catch(e){}}if(ua.webkit&&typeof document.readyState!="undefined"){_3=setInterval(function(){if(/loaded|complete/.test(document.readyState)){callDomLoadFunctions();}},10);}if(typeof document.addEventListener!="undefined"){document.addEventListener("DOMContentLoaded",callDomLoadFunctions,null);}addLoadEvent(callDomLoadFunctions);}();function callDomLoadFunctions(){if(_5){return;}if(ua.ie&&ua.win){var s=document.createElement("span");try{var t=document.getElementsByTagName("body")[0].appendChild(s);t.parentNode.removeChild(t);}catch(e){return;}}_5=true;if(_3){clearInterval(_3);_3=null;}var dl=_1.length;for(var i=0;i<dl;i++){_1[i]();}}function addDomLoadEvent(fn){if(_5){fn();}else{_1[_1.length]=fn;}}function addLoadEvent(fn){if(typeof window.addEventListener!="undefined"){window.addEventListener("load",fn,false);}else{if(typeof document.addEventListener!="undefined"){document.addEventListener("load",fn,false);}else{if(typeof window.attachEvent!="undefined"){window.attachEvent("onload",fn);}else{if(typeof window.onload=="function"){var _1c=window.onload;window.onload=function(){_1c();fn();};}else{window.onload=fn;}}}}}function main(){var rl=_2.length;for(var i=0;i<rl;i++){var id=_2[i].id;if(ua.playerVersion[0]>0){var obj=document.getElementById(id);if(obj){if(hasPlayerVersion(_2[i].swfVersion)){if(ua.webkit&&ua.webkitVersion<312){fixParams(obj);}}else{if(_2[i].expressInstall&&!_6&&hasPlayerVersion([6,0,65])&&(ua.win||ua.mac)){showExpressInstall(_2[i]);}else{displayAltContent(obj);}}}}createCSS("#"+id,"visibility:visible");}}function fixParams(obj){var _22=obj.getElementsByTagName("object")[0];if(_22){var e=document.createElement("embed");var a=_22.attributes;if(a){var al=a.length;for(var i=0;i<al;i++){if(a[i].nodeName.toLowerCase()=="data"){e.setAttribute("src",a[i].nodeValue);}else{e.setAttribute(a[i].nodeName,a[i].nodeValue);}}}var c=_22.childNodes;if(c){var cl=c.length;for(var j=0;j<cl;j++){if(c[j].nodeType==1&&c[j].nodeName.toLowerCase()=="param"){e.setAttribute(c[j].getAttribute("name"),c[j].getAttribute("value"));}}}obj.parentNode.replaceChild(e,obj);}}function fixObjectLeaks(){if(ua.ie&&ua.win&&hasPlayerVersion([8,0,0])){window.attachEvent("onunload",function(){var o=document.getElementsByTagName("object");if(o){var ol=o.length;for(var i=0;i<ol;i++){o[i].style.display="none";for(var x in o[i]){if(typeof o[i][x]=="function"){o[i][x]=function(){};}}}}});}}function showExpressInstall(_2e){_6=true;var obj=document.getElementById(_2e.id);if(obj){if(_2e.altContentId){var ac=document.getElementById(_2e.altContentId);if(ac){_4=ac;}}else{_4=abstractAltContent(obj);}var w=_2e.width?_2e.width:(obj.getAttribute("width")?obj.getAttribute("width"):0);if(parseInt(w,10)<310){w="310";}var h=_2e.height?_2e.height:(obj.getAttribute("height")?obj.getAttribute("height"):0);if(parseInt(h,10)<137){h="137";}var pt=ua.ie&&ua.win?"ActiveX":"PlugIn";document.title=document.title.slice(0,47)+" - Flash Player Installation";var dt=document.title;var fv="MMredirectURL="+window.location+"&MMplayerType="+pt+"&MMdoctitle="+dt;var el=obj;if(ua.ie&&ua.win&&obj.readyState!=4){el=document.createElement("div");obj.parentNode.insertBefore(el,obj);obj.style.display="none";window.attachEvent("onload",function(){obj.parentNode.removeChild(obj);});}createSWF({data:_2e.expressInstall,id:"SWFObjectExprInst",width:w,height:h},{flashvars:fv},el);}}function displayAltContent(obj){if(ua.ie&&ua.win&&obj.readyState!=4){var el=document.createElement("div");obj.parentNode.insertBefore(el,obj);el.parentNode.replaceChild(abstractAltContent(obj),el);obj.style.display="none";window.attachEvent("onload",function(){obj.parentNode.removeChild(obj);});}else{obj.parentNode.replaceChild(abstractAltContent(obj),obj);}}function abstractAltContent(obj){var ac=document.createElement("div");if(ua.win&&ua.ie){ac.innerHTML=obj.innerHTML;}else{var _3b=obj.getElementsByTagName("object")[0];if(_3b){var c=_3b.childNodes;if(c){var cl=c.length;for(var i=0;i<cl;i++){if(!(c[i].nodeType==1&&c[i].nodeName.toLowerCase()=="param")&&!(c[i].nodeType==8)){ac.appendChild(c[i].cloneNode(true));}}}}}return ac;}function createSWF(_3f,_40,el){if(ua.ie&&ua.win){var att="";for(var i in _3f){if(typeof _3f[i]=="string"){if(i=="data"){_40.movie=_3f[i];}else{if(i.toLowerCase()=="styleclass"){att+=" class=\""+_3f[i]+"\"";}else{if(i!="classid"){att+=" "+i+"=\""+_3f[i]+"\"";}}}}}var par="";for(var j in _40){if(typeof _40[j]=="string"){par+="<param name=\""+j+"\" value=\""+_40[j]+"\" />";}}el.outerHTML="<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\""+att+">"+par+"</object>";fixObjectLeaks();}else{if(ua.webkit&&ua.webkitVersion<312){var e=document.createElement("embed");e.setAttribute("type","application/x-shockwave-flash");for(var k in _3f){if(typeof _3f[k]=="string"){if(k=="data"){e.setAttribute("src",_3f[k]);}else{if(k.toLowerCase()=="styleclass"){e.setAttribute("class",_3f[k]);}else{if(k!="classid"){e.setAttribute(k,_3f[k]);}}}}}for(var l in _40){if(typeof _40[l]=="string"){if(l!="movie"){e.setAttribute(l,_40[l]);}}}el.parentNode.replaceChild(e,el);}else{var o=document.createElement("object");o.setAttribute("type","application/x-shockwave-flash");for(var m in _3f){if(typeof _3f[m]=="string"){if(m.toLowerCase()=="styleclass"){o.setAttribute("class",_3f[m]);}else{if(m!="classid"){o.setAttribute(m,_3f[m]);}}}}for(var n in _40){if(typeof _40[n]=="string"&&n!="movie"){createObjParam(o,n,_40[n]);}}el.parentNode.replaceChild(o,el);}}}function createObjParam(el,_4d,_4e){var p=document.createElement("param");p.setAttribute("name",_4d);p.setAttribute("value",_4e);el.appendChild(p);}function hasPlayerVersion(rv){return (ua.playerVersion[0]>rv[0]||(ua.playerVersion[0]==rv[0]&&ua.playerVersion[1]>rv[1])||(ua.playerVersion[0]==rv[0]&&ua.playerVersion[1]==rv[1]&&ua.playerVersion[2]>=rv[2]))?true:false;}function createCSS(sel,_52){if(ua.ie&&ua.mac){return;}var h=document.getElementsByTagName("head")[0];var s=document.createElement("style");s.setAttribute("type","text/css");s.setAttribute("media","screen");if(!(ua.ie&&ua.win)&&typeof document.createTextNode!="undefined"){s.appendChild(document.createTextNode(sel+" {"+_52+"}"));}h.appendChild(s);if(ua.ie&&ua.win&&typeof document.styleSheets!="undefined"&&document.styleSheets.length>0){var ls=document.styleSheets[document.styleSheets.length-1];if(typeof ls.addRule=="object"){ls.addRule(sel,_52);}}}return {registerObject:function(_56,_57,_58){if(!ua.w3cdom||!_56||!_57){return;}var _59={};_59.id=_56;var v=_57.split(".");_59.swfVersion=[parseInt(v[0],10),parseInt(v[1],10),parseInt(v[2],10)];_59.expressInstall=_58?_58:false;_2[_2.length]=_59;createCSS("#"+_56,"visibility:hidden");},getObjectById:function(_5b){var r=null;if(ua.w3cdom&&_5){var o=document.getElementById(_5b);if(o){var n=o.getElementsByTagName("object")[0];if(!n||(n&&typeof o.SetVariable!="undefined")){r=o;}else{if(typeof n.SetVariable!="undefined"){r=n;}}}}return r;},embedSWF:function(_5f,_60,_61,_62,_63,_64,_65,_66,_67){if(!ua.w3cdom||!_5f||!_60||!_61||!_62||!_63){return;}if(hasPlayerVersion(_63.split("."))){createCSS("#"+_60,"visibility:hidden");var att=(typeof _67=="object")?_67:{};att.data=_5f;att.width=_61;att.height=_62;var par=(typeof _66=="object")?_66:{};if(typeof _65=="object"){for(var i in _65){if(typeof _65[i]=="string"){if(typeof par.flashvars!="undefined"){par.flashvars+="&"+i+"="+_65[i];}else{par.flashvars=i+"="+_65[i];}}}}addDomLoadEvent(function(){createSWF(att,par,document.getElementById(_60));createCSS("#"+_60,"visibility:visible");});}else{if(_64&&!_6&&hasPlayerVersion([6,0,65])&&(ua.win||ua.mac)){createCSS("#"+_60,"visibility:hidden");addDomLoadEvent(function(){var _6b={};_6b.id=_6b.altContentId=_60;_6b.width=_61;_6b.height=_62;_6b.expressInstall=_64;showExpressInstall(_6b);createCSS("#"+_60,"visibility:visible");});}}},getFlashPlayerVersion:function(){return {major:ua.playerVersion[0],minor:ua.playerVersion[1],release:ua.playerVersion[2]};},hasFlashPlayerVersion:function(_6c){return hasPlayerVersion(_6c.split("."));},createSWF:function(_6d,_6e,el){if(ua.w3cdom&&_5){createSWF(_6d,_6e,el);}},createCSS:function(sel,_71){if(ua.w3cdom){createCSS(sel,_71);}},addDomLoadEvent:addDomLoadEvent,addLoadEvent:addLoadEvent,getQueryParamValue:function(_72){var q=document.location.search||document.location.hash;if(_72==null){return q;}if(q){var _74=q.substring(1).split("&");for(var i=0;i<_74.length;i++){if(_74[i].substring(0,_74[i].indexOf("="))==_72){return _74[i].substring((_74[i].indexOf("=")+1));}}}return "";},expressInstallCallback:function(){if(_6&&_4){var obj=document.getElementById("SWFObjectExprInst");if(obj){obj.parentNode.replaceChild(_4,obj);_4=null;_6=false;}}}};}();	

