/**** START: Detect Flash **/
var flashinstalled = 0;
var flashversion = 0;
MSDetect = "false";
if (navigator.plugins && navigator.plugins.length)
{
	x = navigator.plugins["Shockwave Flash"];
	if (x)
	{
		flashinstalled = 2;
		if (x.description)
		{
			y = x.description;
			flashversion = y.charAt(y.indexOf('.')-1);
		}
	}
	else
		flashinstalled = 1;
	if (navigator.plugins["Shockwave Flash 2.0"])
	{
		flashinstalled = 2;
		flashversion = 2;
	}
}
else if (navigator.mimeTypes && navigator.mimeTypes.length)
{
	x = navigator.mimeTypes['application/x-shockwave-flash'];
	if (x && x.enabledPlugin)
		flashinstalled = 2;
	else
		flashinstalled = 1;
}
else
	MSDetect = "true";
	
/**** END: Detect Flash **/


/******************************************************************************
 
	The Digital Properties (DP) Object 

 ******************************************************************************/

if (!DP) {var DP = new Object();};


/******************************************************************************

	DP.Screen Module - Version 1.0
	
	Dependencies:	None

 ******************************************************************************/

DP.Screen = {
		getWidth		: function() {
			return (self.screen.availWidth) ? self.screen.availWidth : self.screen.width;
		},
		getHeight		: function() {
			return (self.screen.availHeight) ? self.screen.availHeight : self.screen.height;
		}
	};


/******************************************************************************

	DP.Browser Module - Version 1.1

	Dependencies:	None

 ******************************************************************************/

DP.Browser = {
		isMac	: false,
		isWin	: false,
		isIE	: false,
		isIE4	: false,
		isIE5	: false,
		isSAF	: false,
		isDOM	: false
	};

	if (navigator.platform.toLowerCase().indexOf('mac') > -1)	DP.Browser.isMac = true;
	if (navigator.platform.toLowerCase().indexOf('win') > -1)	DP.Browser.isWin = true;

	if (document.all)											DP.Browser.isIE  = true;
	if (document.all && !document.getElementById)				DP.Browser.isIE4 = true;
	if (document.all && document.getElementById)				DP.Browser.isIE5 = true;
	if (self.screenTop && self.screenX)							DP.Browser.isSAF = true;
	if (!document.all && document.getElementById)				DP.Browser.isDOM = true;

	

/******************************************************************************
 
	DP.Window Module - Version 1.1 
	
	Dependencies:	DP.Document,
					DP.Screen

 ******************************************************************************/

DP.Window = {
		getHeight		: function() {
			if (document.all) {  return (document.documentElement.clientHeight) ? document.documentElement.clientHeight : document.body.clientHeight; }
			else { return window.innerHeight; }
		},		
		getWidth		: function() {
			if (document.all) {  return (document.documentElement.clientWidth) ? document.documentElement.clientWidth : document.body.clientWidth; }
			else { return window.innerWidth; }
		},
		getOuterHeight	: function() {
			return (self.outerHeight) ? self.outerHeight : null;
		},
		getOuterWidth	: function() {
			return (self.outerWidth) ? self.outerWidth : null;			
		},	
		popup			: function(url,title,width,height,config) {
			var args;
			if (width != '' || height != '' || config != '') {
				args	= 'width=' + width + ',height=' + height + ',left=' + (screen.width / 2 - width / 2) + ', ' + config;
			}
			var newwin	= window.open(url,title,args);			
			newwin.focus();
		},
		center			: function() {
			var ww	= (DP.Window.getOuterWidth()) ? DP.Window.getOuterWidth() : DP.Window.getWidth() + 64;
			var wh	= (DP.Window.getOuterHeight()) ? DP.Window.getOuterHeight() : DP.Window.getHeight() + 72;
			self.moveTo(((DP.Screen.getWidth() / 2) - (ww / 2)),((DP.Screen.getHeight() / 2) - (wh / 2)));
		},
		resizeToContent	: function() {
			var ho	= (DP.Window.getOuterWidth()) ? DP.Window.getOuterWidth() - DP.Window.getWidth() : 32;
			var vo	= (DP.Window.getOuterHeight()) ? DP.Window.getOuterHeight() - DP.Window.getHeight() : 72;
			var sh	= parseInt(DP.Screen.getHeight());
			var sw	= parseInt(DP.Screen.getWidth());
			var dh	= parseInt(DP.Document.getHeight());
			var dw	= parseInt(DP.Document.getWidth());
			if (dh > (sh - vo)) {
				if(dw > (sw - ho)) {
					self.resizeTo((sw - ho),(sh - parseInt(vo / 4)));
				} else {
					self.resizeTo((dw + ho),(sh - parseInt(vo / 4)));
				}				
			} else {
				if(dw > (sw - ho)) {
					self.resizeTo((sw - ho),(dh + vo));
				} else {
					self.resizeTo((dw + ho),(dh + vo));
				}
			}
			DP.Window.center();
		}
	};

	
/******************************************************************************

	DP.Cookie Module - Version 1.0 

	Dependencies:	None

 ******************************************************************************/

DP.Cookie = {

		set				: function(n,v,e,p,d,s) {
			if (n && v) {
				document.cookie	= n + "=" + escape(v) +
					((e) ? "; expires=" + e.toGMTString() : "") +
					((p) ? "; path=" + p : "") +
					((d) ? "; domain=" + d : "") +
					((s) ? "; secure" : "");			
			}
		},
		get				: function(n) {
			var a	= n + "=";
			var i	= 0
			while (i < document.cookie.length) {
				var j	= i + a.length;
				if (document.cookie.substring(i,j) == a) return DP.Cookie.getValue(j);
				i = document.cookie.indexOf(" ", i) + 1;
				if (i == 0) break;
			}
			return null;
		},
		kill			: function(n,p,d) {
			if (DP.Cookie.get(n)) {
				document.cookie = n + "=" +
					((p) ? "; path=" + p : "") +
					((d) ? "; domain=" + d : "") +
					"; expires=Thu, 01-Jan-70 00:00:01 GMT";
			}
		},
		getValue		: function(o) {
			var e	= document.cookie.indexOf(";",o);
			if (e == -1) e	= document.cookie.length;
			return unescape(document.cookie.substring(o,e));
		},
		initDateValues	: function() {
			DP.Cookie.now		= new Date();
			DP.Cookie.time		= DP.Cookie.now.getTime();
			DP.Cookie.dayms		= (24 * 60 * 60 * 1000);
			DP.Cookie.oneday	= new Date(DP.Cookie.time + DP.Cookie.dayms);
			DP.Cookie.oneweek	= new Date(DP.Cookie.time + (DP.Cookie.dayms * 7));
			DP.Cookie.onemonth	= new Date(DP.Cookie.time + (DP.Cookie.dayms * 30));
			DP.Cookie.oneyear	= new Date(DP.Cookie.time + (DP.Cookie.dayms * 365));
		}
	}

	DP.Cookie.initDateValues();


/******************************************************************************

	DP.Document Module - Version 1.1 

	Adds extra Document Methods
	Includes code from Jonathan Snook (www.snook.ca),
	Cameron Adams (www.themaninblue.com) and
	Dean Edwards (dean.edwards.name)

	Dependencies:	None

 ******************************************************************************/

DP.Document = {

		loadFunctions			: new Array(),
		getScrollHeight			: null,
		getScrollWidth			: null,
		addLoadListener			: null,
		addUnloadListener		: null,

		addEvent 				: function(element, type, handler) {
			if (!handler.$$guid) handler.$$guid = this.guid++;
			if (!element.events) element.events = {};
			var handlers = element.events[type];
			if (!handlers) {
				handlers = element.events[type] = {};
				if (element["on" + type]) {
					handlers[0] = element["on" + type];
				}
			}
			handlers[handler.$$guid] = handler;
			element["on" + type] = DP.Document.handleEvent;
		},
		removeEvent				: function(element, type, handler) {
			if (element.events && element.events[type]) {
				delete element.events[type][handler.$$guid];
			}
		},
		handleEvent				: function(event) {
			var returnValue = true;
			event = event || DP.Document.fixEvent(window.event);
			var handlers = this.events[event.type];
			for (var i in handlers) {
				this.$$handleEvent = handlers[i];
				if (this.$$handleEvent(event) === false) {
					returnValue = false;
				}
			}
			return returnValue;
		},
		fixEvent				: function(event) {
			// add W3C standard event methods
			event.preventDefault = this.preventDefault;
			event.stopPropagation = this.stopPropagation;
			return event;
		},		

		getElementsByClassName	: function(n,c) {
			var a	= [];
		    var re	= new RegExp('(^| )'+c+'( |$)');
		    var els	= n.getElementsByTagName("*");
		    for(var i = 0; i < els.length; i++) {
		        if(re.test(els[i].className)) {
					a.push(els[i]);
				}
			}
		    return a;
		},
		fireOnloads				: function() {
			for (var x = 0; x < DP.Document.loadFunctions.length; x++) {
				DP.Document.loadFunctions[x]();
			}
		},	
		getHeight				: function() {
			return document.body.offsetHeight;
		},
		getWidth				: function() {
			return document.body.offsetWidth;
		},
		getYScroll				: function() {
			if (document.all) { return (document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop }
			else { return self.pageYOffset; }
		},

		init					: function() {			
			// Get Scroll Height
			if (window.innerHeight && window.scrollMaxY) {	
				DP.Document.getScrollHeight = function() { return window.innerHeight + window.scrollMaxY; }
			} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
				DP.Document.getScrollHeight = function() { return document.body.scrollHeight; }
			} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
				DP.Document.getScrollHeight = function() { return document.body.offsetHeight; }
			}

			// Get Scroll Width
			if (window.innerHeight && window.scrollMaxX) {	
				DP.Document.getScrollWidth = function() { return window.innerHeight + window.scrollMaxX; }
			} else if (document.body.scrollWidth > document.body.offsetWidth){
				DP.Document.getScrollWidth = function() { return document.body.scrollWidth; }
			} else { 
				DP.Document.getScrollWidth = function() { return document.body.offsetWidth; }
			}
		}

	};

	DP.Document.addEvent.prototype = {
		guid	: 1
	};

	DP.Document.fixEvent.prototype = {

		preventDefault 	: function() {
			this.returnValue = false;
		},
		stopPropagation	: function() {
			this.cancelBubble = true;
		}
	};

	// Add Un/Load Listener
	if (typeof window.addEventListener != 'undefined') {
		DP.Document.addLoadListener		= function(f) { window.addEventListener('load',f,false); }
		DP.Document.addUnloadListener	= function(f) { window.addEventListener('unload',f,false); }
	} else if (typeof document.addEventListener != 'undefined') {
		DP.Document.addLoadListener		= function(f) { document.addEventListener('load',f,false); }
		DP.Document.addUnloadListener	= function(f) { document.addEventListener('unload',f,false); }
	} else if (typeof window.attachEvent != 'undefined') {
		DP.Document.addLoadListener		= function(f) { window.attachEvent('onload', f); }
		DP.Document.addUnloadListener	= function(f) { window.attachEvent('onunload', f); }		
	} else {
		DP.Document.addLoadListener		= new Function;
		DP.Document.addUnloadListener	= new Function;
	};

	DP.Document.loadFunctions.push(DP.Document.init);
	DP.Document.addLoadListener(DP.Document.fireOnloads);



/******************************************************************************

	DP.Iframe Module - Version 1.2 

	Dependencies:	DP.Browser,
					DP.Document,
					DP.Utils

 ******************************************************************************/

DP.Iframe = {

		siteDomains			: ["cordless.com","wmg.com"],				// Valid site domain(s), without www or any subdomains
		domainExceptions	: [],										// Any subdomains which should retain the full URL
		protocolExceptions	: ['mailto:','file:','gopher:','ftp:'],		// Any URL protocols that we want to leave alone.
		bodyFrame			: "main",    								// The name of the iframe we load the main content in.
		frameUrl 			: "/home/?framed=true",						// Default Framed URL
		frFlag 				: "framed=true",
		bmFlag				: "#page=",
		win					: null,
		elem				: null,
		
		init				: function() {
			DP.Iframe.updateTitleBar();
			DP.Iframe.initHeight();
			DP.Iframe.tagLinks();
		},
		
		initHeight			: function() {
			DP.Iframe.win	= window.frames[DP.Iframe.bodyFrame];
		    DP.Iframe.elem	= document.getElementById ? document.getElementById(DP.Iframe.bodyFrame) : document.all ? document.all[DP.Iframe.bodyFrame] : null;
		    if (DP.Iframe.elem && DP.Iframe.win ) {
		        DP.Iframe.elem.style.height = "auto"; // helps resize if new doc shorter than previous
		 		if (DP.Iframe.domainCheck()) setTimeout("DP.Iframe.getDocHeight()", 50);   			
		    }
		},
		
		setHeight			: function(h) {
			if (h) {
				// need to add to height to be sure it will all show
				DP.Iframe.elem.style.height = h + "px";
			} else {
				DP.Iframe.elem.style.height = 800 + "px";
			}	
		},

		getDocHeight			: function() {
		    var docHt = 0, sh, oh;
			var doc = DP.Iframe.win.document;
			doc.body.style.height	= "auto";	// Overrides any CSS Sticky Footer silliness
			if (doc.height) docHt 	= doc.height;
		    else if (doc.body) {
		        if (doc.body.scrollHeight) docHt = sh = doc.body.scrollHeight;
		        if (doc.body.offsetHeight) docHt = oh = doc.body.offsetHeight;
		        if (sh && oh) docHt = Math.max(sh, oh);
		    }
			//if (SAF) docHt = (oh) ? oh : sh ? sh : docHt;
		    DP.Iframe.setHeight(docHt);
		},
		
		domainCheck			: function(url) {
			url = (url == null || url == "") ? DP.Iframe.frameUrl : url;
			var s	= false;
			if (url.indexOf("/") == 0) {
				s = true;
			} else {
				for (var i = 0; i < DP.Iframe.siteDomains.length; i++) {
					if (url.indexOf(DP.Iframe.siteDomains[i]) > -1) {
						s = (DP.Iframe.domainExeption(url)) ? false : true;
						break;
					}
				}
			}
			return s;
		},
		
		domainExeption			: function(url) {
			var e = false;
			for (var j = 0; j < DP.Iframe.domainExceptions.length; j++) {
				if (url.indexOf(DP.Iframe.domainExceptions[j]) > -1) {
					e = true;
					break;
				}
			}
			return e;
		},
		
		load					: function(n,url,r,p) {
			if (r == undefined) r = true;
			if (url != "") {
				DP.Iframe.frameUrl	= url;
				p					= (p) ? 
										(p.parent == p) ? p : p.parent :
										(window.parent == window) ? window : window.parent;
			//	var pu  			= p.location.href;
			//	var b   			= (pu.indexOf(DP.Iframe.bmFlag) > -1) ? pu.substring(0,pu.indexOf(DP.Iframe.bmFlag)) : pu;
				for (var i = 0; i < DP.Iframe.siteDomains.length; i++) {
					if (url.indexOf(DP.Iframe.siteDomains[i]) > -1) {
						url = (DP.Iframe.domainExeption(url)) ? url : url.substring((url.indexOf(DP.Iframe.siteDomains[i]) + DP.Iframe.siteDomains[i].length), url.length);
						break;
					}
				}
			    if (p.frames[n]) {
			        //p.location = b + DP.Iframe.bmFlag + url;   // To enable bookmark tracking
			        p.frames[n].location = url + ((url.indexOf("?") > -1) ? "&" : "?") + DP.Iframe.frFlag;
			        if (r) return false;
			    }
			}
			if (r) return true;
		},
		
		resize					: function(e) {
			var t = (window == parent) ? window : parent;
			if (!e) var e = window.event;
			var k = (e.which > 0) ? e.which : e.keyCode;
			var s = String.fromCharCode(k);			
			if ((e.metaKey || e.ctrlKey) && (s == "+" || s == "=" || s == "-")) t.DP.Iframe.initHeight();
		},
		
		updateTitleBar			: function() {
			if (DP.Iframe.domainCheck()) {
				document.title = window.frames[DP.Iframe.bodyFrame].document.title;
			}
		},
		
		tagLinks				: function() {

			if(window.frames[DP.Iframe.bodyFrame]) {

			    var links = window.frames[DP.Iframe.bodyFrame].document.getElementsByTagName('a');
				var l;
			    for (var x = 0; x < links.length; x++) {
					l = links[x];
					var tag	= true;
					for (var i in DP.Iframe.protocolExceptions) {		// We don't want to tag things like "mailto:" links.
						if (l.href.indexOf(DP.Iframe.protocolExceptions[i]) == 0) { tag = false; break; }
					}
					if (tag) {						
						if (!l.onclick && (l.target == null || l.target == "")) {			// Plain Untagged Links
							if (DP.Iframe.domainCheck(l.href)) {		//	Are we in the same domain?
								DP.Iframe.tagWithLIF(l);				//	YES - Tag the link with load iframe function
							} else {
								l.target = "top";						//	NO	- Attach target = top;
							}
						} else if (!l.onclick && (l.target != null && l.target != "")) {	// Targeted links, no onclick
							if (l.target == DP.Iframe.bodyFrame) {		//	Is it targeting the bodyFrame?
								if (DP.Iframe.domainCheck(l.href)) {	//	Are we in the same domain?
									l.target = "";						//	YES - Strip the target...
									DP.Iframe.tagWithLIF(l);			//		... and tag the link with load iframe function
								}
							}
						} else if (l.onclick && (l.target != null && l.target != "")) {		// Links with onclick and target 
							if (l.target == DP.Iframe.bodyFrame) {		//	Is it targeting the bodyFrame?
								if (DP.Iframe.domainCheck(l.href)) {	//	Are we in the same domain?
									l.target = "";						//	YES - Strip the target...
									l.onclick = "";						//		... the onclick...
									DP.Iframe.tagWithLIF(l);			//		... and tag the link with load iframe function
								}
							}	// Pass over links with onclick and no target.
						}
				    }
				}
			}
		},
		
		tagWithLIF				: function(l) {
			l.onclick = function() {
				return DP.Iframe.load(DP.Iframe.bodyFrame,this.href);
			}
		},
		
		loadFromPopup			: function(url,close) {
			var o	= window.opener;
			DP.Iframe.load(DP.Iframe.bodyFrame,url,false,o);
			if(close) window.close();
			return false;
		},

		stripFramedFromString	: function(s) {
			var fre			= new RegExp("(&|\\?)" + DP.Iframe.frFlag + "(&|$)");
			fre.global		= true;
			fre.ignoreCase	+ true;
			return s.replace(fre,'');
		}
		
	};
	
	if (parent.frames[DP.Iframe.bodyFrame]) {
		DP.Iframe.parent = {
			init		: function() {
				if (arguments.callee.done) return;
				arguments.callee.done = true;
				parent.DP.Iframe.init();
			}			
		}

		/* for Mozilla */
		if (document.addEventListener) {
			document.addEventListener("DOMContentLoaded", DP.Iframe.parent.init, null);
		}

		/* for Internet Explorer */
		/*@cc_on @*/
		/*@if (@_win32)
			document.write("<script defer src=/_components/scripts/ie_iframe_onload.js><"+"/script>");
		/*@end @*/

		/* for other browsers */
		DP.Document.loadFunctions.push(DP.Iframe.parent.init);
		
	}		
	
	// Handle Text Resizing
	DP.Document.addEvent(document,"keypress",DP.Iframe.resize);


/******************************************************************************

	DP.Element Module - Version 1.0

	Dependencies:	None

 ******************************************************************************/

DP.Element = {
		getHeight			: function(e) {
			if(e) {
				return e.offsetHeight;
			}
		},
		getWidth			: function(e) {
			if(e) {
				return e.offsetWidth;
			}
		},
		getAbsolutePosition	: function(obj) {
		    var result = [0, 0];
		    while (obj != null) {
		        result[0] += obj.offsetTop;
		        result[1] += obj.offsetLeft;
		        obj = obj.offsetParent;
		    }
		    return result;
		}
	};



/******************************************************************************

	DP.Utils Module - Version 1.0

	Dependencies:	None

 ******************************************************************************/

DP.Utils	= {

		getKeypress			: function(e) {
			if (!e) e = window.event;
			var k = (e.which > 0) ? e.which : e.keyCode;
			return String.fromCharCode(k).toLowerCase();
		},
		
		captureTextResize	: function(e) {
			if (!e) var e = window.event;
			var k = (e.which > 0) ? e.which : e.keyCode;
			var s = String.fromCharCode(k);
			
			return ((e.metaKey || e.ctrlKey) && (s == "+" || s == "=" || s == "-")) ? true : false;			
		},
		
		getRequestParameter	: function(param) {
			var q = document.location.search || document.location.href.hash;
			if(q){
				var startIndex = q.indexOf(param +"=");
				var endIndex = (q.indexOf("&", startIndex) > -1) ? q.indexOf("&", startIndex) : q.length;
				if (q.length > 1 && startIndex > -1) {
					return q.substring(q.indexOf("=", startIndex)+1, endIndex);
				}
			}
			return "";
		}
	};
	


/******************************************************************************

	DP.Validations Module - Version 1.1

	Dependencies:	None

 ******************************************************************************/	

DP.Validations	= {

		isBlank			: function(i) {
			return (i.value == "") ? true : false;
		},

		isNotBlank		: function(i) {
			return (i.value != "") ? true : false;
		},

		madeSelection	: function(i) {
			return (i.options[i.selectedIndex].value != "") ? true : false;
		},

		isPhoneNumber	: function(i) {
			return ((i.value*1.0) == i.value && (i.value*1.0) < 9899999999 && (i.value*1.0) > 2012000000) ? true : false;
		},

		isEmail			: function(i) {
			return (i.value.match(/^[\w_\-\.]+[\%\+]?[\w_\-\.]*\@[0-9a-zA-Z\-]+\.[0-9a-zA-Z\-\.]+$/)) ? true : false;
		},

		isZipcode		: function(i) {
			return (i.value.match(/^\d{5}(|[\s-]\d{4})$/)) ? true : false;
		}

	};



/******************************************************************************

	DP.XML Module - Version 1.0 

	Dependencies:	None

 ******************************************************************************/

DP.XML	= {
		stripWhitespace	: function(n) {
			for (var i = 0; i < n.childNodes.length; i++) {
				if(n.childNodes[i].nodeType == 3) {
					var j = 0;
					var emptyNode = true;
					for(j = 0;j < n.childNodes[i].nodeValue.length; j++) {
						if(n.childNodes[i].nodeValue.charCodeAt(j) > 32) {
							emptyNode = false;
							break;
						}
					}
					if(emptyNode) {
						var t = n.removeChild(n.childNodes[i]);
					}
				}
			}

			for(var k = 0; k < n.childNodes.length; k++) {
				DP.XML.stripWhitespace(n.childNodes[k]);
			}
		},
		removeChildren	: function(n) {
			if (n) {
				while (n.hasChildNodes()) n.removeChild(n.firstChild);
			}

		}
	};



/******************************************************************************

	DP.Flash Module - Version 1.0  

	Based on Geoff Stearn's Flash Object code (v. 1.3)
	available at http://blog.deconcept.com/flashobject/

	Dependencies:	DP.Utils

******************************************************************************/

DP.Flash = {	
		object				: function(swf, id, w, h, ver, c, useExpressInstall, quality, xiRedirectUrl, redirectUrl, detectKey) {
			if (!document.createElement || !document.getElementById) return;
			this.DETECT_KEY = detectKey ? detectKey : 'detectflash';
			this.skipDetect = DP.Utils.getRequestParameter(this.DETECT_KEY);
			this.params = new Object();
			this.variables = new Object();
			this.attributes = new Array();
			this.useExpressInstall = useExpressInstall;

			if(swf) this.setAttribute('swf', swf);
			if(id) this.setAttribute('id', id);
			if(w) this.setAttribute('width', w);
			if(h) this.setAttribute('height', h);
			if(ver) this.setAttribute('version', new DP.Flash.playerVersion(ver.toString().split(".")));
			this.installedVer = DP.Flash.getVersion(this.getAttribute('version'), useExpressInstall);
			if(c) this.addParam('bgcolor', c);
			var q = quality ? quality : 'high';
			this.addParam('quality', q);
			var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
			this.setAttribute('xiRedirectUrl', xir);
			this.setAttribute('redirectUrl', '');
			if(redirectUrl) this.setAttribute('redirectUrl', redirectUrl);
		},
		getVersion			: function(reqVer, xiInstall){
			var PlayerVersion = new DP.Flash.playerVersion(0,0,0);
			if(navigator.plugins && navigator.mimeTypes.length) {
				var x = navigator.plugins["Shockwave Flash"];
				if(x && x.description) {
					PlayerVersion = new  DP.Flash.playerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
				}
			} else {
				try {
					var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
					for (var i=3; axo!=null; i++) {
						axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);
						PlayerVersion = new DP.Flash.playerVersion([i,0,0]);
					}
				} catch(e) {}
				if (reqVer && reqVer.major > PlayerVersion.major) return PlayerVersion;
				if (!reqVer || ((reqVer.minor != 0 || reqVer.rev != 0) && PlayerVersion.major == reqVer.major) || PlayerVersion.major != 6 || xiInstall) {
					try {
					PlayerVersion = new DP.Flash.playerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
					} catch(e) {}
				}
			}
			return PlayerVersion;
		},	
		playerVersion		: function(arrVersion){
			this.major = parseInt(arrVersion[0]) || 0;
			this.minor = parseInt(arrVersion[1]) || 0;
			this.rev = parseInt(arrVersion[2]) || 0;
		}
	};

	DP.Flash.object.prototype 	= {
		setAttribute		: function(name, value){
			this.attributes[name] = value;
		},
		getAttribute		: function(name) {
			return this.attributes[name];
		},
		addParam			: function(name, value){
			this.params[name] = value;
		},
		getParams			: function(){
			return this.params;
		},
		addVariable			: function(name, value){
			this.variables[name] = value;
		},
		getVariable			: function(name){
			return this.variables[name];
		},
		getVariables		: function(){
			return this.variables;
		},
		createParamTag		: function(n, v){
			var p = document.createElement('param');
			p.setAttribute('name', n);
			p.setAttribute('value', v);
			return p;
		},
		getVariablePairs	: function(){
			var variablePairs = new Array();
			var key;
			var variables = this.getVariables();
			for(key in variables){
				variablePairs.push(key +"="+ variables[key]);
			}
			return variablePairs;
		},
		getFlashHTML		: function() {
			var flashNode = "";
			if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture
				if (this.getAttribute("doExpressInstall")) this.addVariable("MMplayerType", "PlugIn");
				flashNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'"';
				flashNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
				var params = this.getParams();
				for(var key in params){ flashNode += [key] +'="'+ params[key] +'" ';
			}
			var pairs = this.getVariablePairs().join("&");
			if (pairs.length > 0) flashNode += 'flashvars="'+ pairs +'"';
			flashNode += '/>';
			} else { // PC IE
				if (this.getAttribute("doExpressInstall")) this.addVariable("MMplayerType", "ActiveX");
				flashNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'">';
				flashNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />"';
				var params = this.getParams();
				for(var key in params) {
					flashNode += '<param name="'+ key +'" value="'+ params[key] +'">';
				}
				var pairs = this.getVariablePairs().join("&");
				if(pairs.length > 0) flashNode += '<param name="flashvars" value="'+ pairs +'">';
			}
			return flashNode;
		},
		write				: function(elementId){
			if(this.useExpressInstall) {
				// check to see if we need to do an express install
				var expressInstallReqVer = new DP.Flash.playerVersion([6,0,65]);
				if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) {
					this.setAttribute('doExpressInstall', true);
					this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl')));
					document.title = document.title.slice(0, 47) + " - Flash Player Installation";
					this.addVariable("MMdoctitle", document.title);
				}
			} else {
				this.setAttribute('doExpressInstall', false);
			}
			if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){
				var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
				n.innerHTML = this.getFlashHTML();
			}else{
				if(this.getAttribute('redirectUrl') != "") {
					document.location.replace(this.getAttribute('redirectUrl'));
				}
			}
		}
	};

	DP.Flash.playerVersion.prototype.versionIsValid	= function(fv) {
		if(this.major < fv.major) return false;
		if(this.major > fv.major) return true;
		if(this.minor < fv.minor) return false;
		if(this.minor > fv.minor) return true;
		if(this.rev < fv.rev) return false;
		return true;
	};

	// For Universal Compatibility
	var FlashObject	= DP.Flash.object;
	
	
/******************************************************************************

	DP.Media Module - Version 1.0 

	Based on Geoff Stearn's Quicktime Object code (v. 1.0.2)
	available at http://blog.deconcept.com/

	Dependencies:	DP.Utils

******************************************************************************/

DP.Media	= {

		QTexts		: ["m3u","m3url","mp3","swa","3gp","3gpp","3g2","3gp2","m4a","m4p","m4b","m4v","sdv","amc","mpeg","mpg","m1s","m1a","mp2","mpm","mpa","m2a","mp4","m75","m15","mpv","sdp","vfw","dv","dif","mov","moov","qt","mqv","flc","fli","cel","aiff","aif","aifc","cdda","au","snd","ulw","mid","midi","smf","kar","qcp","sd2","amr","gsm","aac","adts","caf","bfw","jpg","jpeg","gif","png"],
		RMexts		: ["ram","rpm","ra","rm","smil"],
		WMexts		: ["asf","ass","asx","avi","wav","wax","wm","wma","wmd","wmp","wmv","wmx","wpl","wvx","vfw"],

		object		: function(mov, id, w, h, redirect, detect) {
			this.mov = mov;
			this.id = id;
			this.width = w;
			this.height = h;
			this.redirect = redirect;
			this.sq = document.location.search.split("?")[1] || "";
			this.params = new Object();
			this.doDetect = (DP.Utils.getRequestParameter('detectmedia')) ? DP.Utils.getRequestParameter('detectmedia') : (detect) ? detect.toString() : '';
			this.format = this.getFormat();
		}
	}
	DP.Media.object.prototype.addParam = function(name, value) {
		this.params[name] = value;
	}
	DP.Media.object.prototype.getParams = function() {
	    return this.params;
	}
	DP.Media.object.prototype.getParam = function(name) {
	    return this.params[name];
	}
	DP.Media.object.prototype.getParamTags = function() {
	    var paramTags = "";
	    for (var param in this.getParams()) {
	        paramTags += '<param name="' + param + '" value="' + this.getParam(param) + '" />';
	    }
	    if (paramTags == "") {
	        paramTags = null;
	    }
	    return paramTags;
	}
	DP.Media.object.prototype.getFormat = function() {
		var f	= new Object();
		var re	= /([^\.]+)$(?![a-zA-Z0-9]+\.)/i;
		var ext	= this.mov.match(re)[0];

		if (ext) {
			for (var i in DP.Media.QTexts) {
				if (DP.Media.QTexts[i] == ext) {
					f.player = "QuickTime";
					return f;
				}
			}
			for (var i in DP.Media.WMexts) {
				if (DP.Media.WMexts[i] == ext) {
					f.player = "Windows Media Player";
					return f
				}
			}			
			for (var i in DP.Media.RMexts) {
				if (DP.Media.RMexts[i] == ext) {
					f.player = "RealPlayer";
					return f;
				}
			}
		}
		f.player = "other";	
		return f;	
	}
	DP.Media.object.prototype.setMediaType = function() {
		switch (this.format.player) {
			case "QuickTime":
				this.format.mime	= "video/quicktime";
				this.format.cls		= "QuickTimeCheckObject.QuickTimeCheck.1";
				this.format.classid	= "clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B";
				this.addParam("src", this.mov);
				break;
			case "RealPlayer":
				this.format.mime	= "audio/x-pn-realaudio-plugin";
				this.format.cls		= "rmocx.RealPlayer G2 Control.1";
				this.format.classid	= "clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA";
				this.addParam("src", this.mov);
				break;
			case "Windows Media Player":
				this.format.mime	= "application/x-mplayer2";
				this.format.omime	= "application/x-oleobject";
				this.format.cls		= "MediaPlayer.MediaPlayer.1";
				this.format.classid	= "clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95";
				this.addParam("filename", this.mov);
				break;
		}
	}
	DP.Media.object.prototype.getHTML = function() {
	    var object = "";
		if (navigator.plugins && navigator.plugins.length) { // not ie
			if (this.format.player == "Windows Media Player") {
				this.addParam("codebase","http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112");
				this.addParam("src", this.mov);
			} 
	        object += '<embed type="' + this.format.mime + '" src="' + this.mov + '" width="' + this.width + '" height="' + this.height + '" id="' + this.id + '"';
	        for (var param in this.getParams()) {
	            object += ' ' + param + '="' + this.getParam(param) + '"';
	        }
	        object += '></embed>';
	    }
	    else { // pc ie
	        object += '<object classid="' + this.format.classid + '" width="' + this.width + '" height="' + this.height + '" id="' + this.id + '">';
	        if (this.getParamTags() != null) {
	            object += this.getParamTags();
	        }
	        object += '</object>';
	    }
	    return object;
	}
	DP.Media.object.prototype.write = function(elementId) {
		this.setMediaType();
		if((this.isPlayerInstalled() || this.doDetect=='false') && this.format != "other") {
			var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
			n.innerHTML = this.getHTML();
		}else{
			if(this.redirect && this.redirect != "") {
				document.location.replace(this.redirect);
			}
		}		
	}

	DP.Media.object.prototype.isPlayerInstalled = function() {
		var installed = false;
		mediaObj = false;
		if (navigator.plugins && navigator.plugins.length) {
			for (var i=0; i < navigator.plugins.length; i++ ) {
	         var plugin = navigator.plugins[i];
	         if (plugin.name.indexOf(this.format.player) > -1) {
				installed = true;
	         }
	      }
		} else {
			execScript('on error resume next: mediaObj = IsObject(CreateObject("' + this.format.cls + '"))','VBScript');
			installed = mediaObj;
		}
		return installed;
	}

	var MediaObject = DP.Media.object;




/******************************************************************************

	Add methods for older browser support if needed

 ******************************************************************************/

if (Array.prototype.push == null) {
	Array.prototype.push = function(item) {
		this[this.length] = item; return this.length;
	}
};

if (document.all && !document.getElementById) {
	document.getElementById= function(id) {
		return(document.all(id));
	}
	document.getElementsByTagName= function(id) {
		return(document.all.tags(id));
	}
};

if(document.layers) {
	document.getElementById= function(id) {
		return(document.layers[id]);
	}
};

