function AudioPlayer(varName, divName, audioUrl)
{
	this.instanceVarName = varName;
	this.audioPlayer = null;
	this.audioPlaybackDiv = divName;
	this.audioUrl = audioUrl;
	this.init();
}
AudioPlayer.prototype = {
	init: function() {
		this.audioPlayer = new FlashAudioPlayer(this.instanceVarName);
		// this.audioPlayer.useFlash = false;  //testing
		if (! this.audioPlayer.useFlash) {
			this.audioPlayer = new HTMLAudioPlayer(this.instanceVarName);
		}
		this.audioPlayer.setup(this.audioPlaybackDiv);

		//This delay seems crucial for Firefox w/ Flash
		setTimeout(this.instanceVarName + ".load('" + this.audioUrl + "', 0, true)", 500);
	},
	load: function(audioUrl, audioLength, autoPlay) {
		this.audioPlayer.load(audioUrl, audioLength, autoPlay);
	},
	play: function() {
		this.audioPlayer.play();
	},
	stop: function() {
		this.audioPlayer.stop();
	}
}
function FlashAudioPlayer(varName)
{
	var imgDir = '/cache/cp/1201819920000/coupon/static/images/audioPlayer/';
	var swfDir = '/cache/cp/1201819920000/coupon/static/swf/';

	this.instanceVarName = varName;
	this.flashMinVersion = 8;
	this.flashProxyFile = swfDir + 'JavaScriptFlashGateway-1.0.swf';
	this.swf = swfDir + 'fp_audio.0.1-1.0.swf';
	this.parentId = null;
	this.containerId = 'fdiv';
    this.w = 192;
    this.h = 37;
    this.bg = '#000000';
	
	this.APO = new Object();
	this.APOD = new Object();
	this.APO.autoplay = 0;
	this.APO.bg = imgDir + 'fp_bg.png';
  	// play button
   	this.APO.playbtn = new Object();
   	this.APO.playbtn.url = imgDir + 'fp_playbtn.png';
	this.APO.playbtn.x = 6;
	this.APO.playbtn.y = 5;
	// stop button
	this.APO.stopbtn = new Object();
	this.APO.stopbtn.url = imgDir + 'fp_stopbtn.png';
	this.APO.stopbtn.x = 38;
	this.APO.stopbtn.y = 5;
	// volume control button
	this.APO.vol = new Object();
	this.APO.vol.icon = imgDir + 'fp_vol_icon.png';
	this.APO.vol.url = imgDir + 'fp_slidercontrol.png';
	this.APO.vol.x = 72;
	this.APO.vol.y = 19;
	this.APO.vol.length = 83;
	this.APO.vol.thick = 4;
	this.APO.vol.color = '0x000000';
	// position control button
	this.APO.pos = new Object();
	this.APO.pos.icon = imgDir + 'fp_pos_icon.png';
	this.APO.pos.url = imgDir + 'fp_slidercontrol.png';
	this.APO.pos.x = 72;
	this.APO.pos.y = 7;
	this.APO.pos.length = 83;
	this.APO.pos.thick = 4;
	this.APO.pos.color = '0x000000';
	this.APO.pos.color2 = '0xff9900';

	this.APOD = clone(this.APO,1);
	this.APOD.file = '';
	this.APOD.playbtn.url = imgDir + 'fp_playbtn_disabled.png';
	this.APOD.stopbtn.url = imgDir + 'fp_stopbtn_disabled.png';
	this.APOD.vol.icon = imgDir + 'fp_vol_icon_disabled.png';
	//APOD.vol.url = imgDir + 'fp_slidercontrol_disabled.png';
	this.APOD.vol.url = '';
	this.APOD.pos.icon = imgDir + 'fp_pos_icon_disabled.png';
	//APOD.pos.url = imgDir + 'fp_slidercontrol_disabled.png';
	this.APOD.pos.url = '';

	this.fpid = Date.parse(new Date());
	this.fproxy = new FlashProxy(this.fpid, this.flashProxyFile);
	this.flashVersion = deconcept.SWFObjectUtil.getPlayerVersion();
	this.useFlash = (this.flashVersion['major'] >= this.flashMinVersion) ? true : false
}
FlashAudioPlayer.prototype = {
	hasFlash: function() {
		return (this.flashVersion['major'] >= this.flashMinVersion) ? true : false;
	},
	stop: function() {
		;
	},
	play: function() {
		;
	},
	reload: function() {
		if (this.APO.file && (this.APO.file.length > 0)) {
			this.fproxy.call('loadAudioPlayer',PO.toString(this.APO,'APO'));
		} else {
			this.fproxy.call('loadAudioPlayer',PO.toString(this.APOD,'APO'));
		}
		this.ff2Redraw();
	},
	load: function(audioUrl, audioLength, autoPlay) {
		this.APO.autoplay = autoPlay ? 1 : 0;
		if (audioUrl && (audioUrl.length > 0)) {
			var file = audioUrl.replace('&','|#38;');
			file = file.replace('=','|#61;');
	 	 	this.APO.file = file;
	 	 	if (!audioLength) {
	  			audioLength = 0;
	  		}
	 	 	this.APO.file_seconds = audioLength;
			this.fproxy.call('loadAudioPlayer',PO.toString(this.APO,'APO'));
		} else {
			this.APO.file = '';
			this.APO.file_seconds = 0;
			this.fproxy.call('loadAudioPlayer',PO.toString(this.APOD,'APO'));
		}
		this.ff2Redraw();
	},
	unload: function() {
		if (this.parentId) {
			this.reset();
			this.setup(this.parentId);
		}
	},
	ff2Redraw: function() {
		;
		//if (is_ff2 || is_ff1x) {
		//	var y = window.pageYOffset;
		//	window.scroll(0,window.scrollMaxY);
		//	window.scroll(0,y);
		//}
	},
	setup: function(elId) {
		this.parentId = elId;
		$(elId).innerHTML = '<div id="' + this.containerId + '"></div>';
	
		var fobj = $(this.containerId);   
		fobj.style.width  = this.w + 'px';
		fobj.style.height = this.h + 'px';
		fobj.style.visibility = 'visible';

		var tag = new FlashTag(this.swf, this.w, this.h, this.bg);
		tag.setFlashvars('lcId=' + this.fpid);
		tag.addParam('wmode','transparent');
		tag.addParam('scale','noscale');
		tag.addParam('salign','lt');
		tag.write(this.containerId);
	},
	reset: function() {
		if (this.parentId) {
			$(this.parentId).innerHTML = '<img src="images/preview_player_loading.gif" width="192" height="37"/>';
		}
	},
	testAudio: function() {
		; //noopt
	}
}
function HTMLAudioPlayer(varName)
{
	var imgDir = '/cache/cp/1201819920000/coupon/static/images/audioPlayer/';
	
	this.mediaPlayerId = 'MediaPlayer1';
	this.use_mediaControl = false;
	this.isAudioTested = false;
	this.containerId = 'AudioPlaybackMediaPlayer';
	this.autoPlay = false;
	this.playerControlId = 'AudioPlaybackControl';
	this.playerControlGraphic = imgDir + 'h_player.gif';
	this.playerControlGraphicDisabled = imgDir + 'h_player_disabled.gif';
	this.playerControlGraphicLoading = imgDir + 'h_player_loading.gif';
	this.audioFile = null;
	this.instanceVarName = varName;
	
	var agt=navigator.userAgent.toLowerCase();
	this.is_ff	= (agt.indexOf("firefox/")!=-1);
}
HTMLAudioPlayer.prototype = {
	stop: function() {
		if (this.is_ff) {
			$(this.containerId).innerHTML = this.getFFMedia('');
		} else {
			if (this.use_mediaControl) {
				$(this.mediaPlayerId).controls.stop();
			} else {
				$(this.containerId).innerHTML = this.getNonControlledMedia('');
			}
		}
	},
	play: function() {
		if (this.audioFile && this.audioFile.length > 0) {
			if (this.is_ff) {
				$(this.containerId).innerHTML = this.getFFMedia(this.audioFile);
			} else {
				if (this.use_mediaControl) {
					$(this.mediaPlayerId).URL = this.audioFile;
				} else {
					$(this.containerId).innerHTML = this.getNonControlledMedia(this.audioFile);
				}
			}
		}
	},
	load: function(audioUrl, audioLength, autoPlay) {
		if (! this.isAudioTested) this.testAudio();
	
		if (this.audioFile) {
			this.stop();
		}
		
		if (! $(this.playerControlId)) {
			return;
		}
		
		if (audioUrl && audioUrl.length > 0) {
			this.audioFile = audioUrl;
			$(this.playerControlId).src = this.playerControlGraphic;
			$(this.playerControlId).useMap = '#audioControlMap';
		
			if (this.autoPlay || autoPlay) {
				this.play();
			}
		} else {
			this.audioFile = null;
			$(this.playerControlId).src = this.playerControlGraphicDisabled;
			$(this.playerControlId).useMap = '';
		}
	},
	setup: function(elName) {
		//var media = '<div id="' + this.containerId + '">' + "\n"
    	//	+ this.getControlledMedia() + "\n"
  		//	+ '</div>';
  			
		var control = '<map name="audioControlMap">' + "\n"
			+ '<area shape="circle" coords="21,18,15" href="javascript:' + this.instanceVarName + '.play();" name="audioControlPlay"/>' + "\n"
			+ '<area shape="circle" coords="51,18,15" href="javascript:' + this.instanceVarName + '.stop();" name="audioControlStop"/>' + "\n"
			+ '</map>'
			+ '<img id="' + this.playerControlId + '" src="' + this.playerControlGraphicDisabled + '" width="192" height="37" usemap="#audioControlMap" border="0"/>';

		if (! $(this.containerId)) {
			media = document.createElement('div');
			media.setAttribute('id', this.containerId);
			media.setAttribute('style', 'width:0px;height:0px;max-width:0px;max-height:0px;overflow:hidden;');
			var parent = document.getElementsByTagName("body").item(0);
			parent.insertBefore(media, parent.firstChild);
		}
		if (this.is_ff)
			$(this.containerId).innerHTML = this.getFFMedia();
		else
			$(this.containerId).innerHTML = this.getControlledMedia();
		$(elName).innerHTML = control;
	},
	testAudio: function() {
		if ($(this.mediaPlayerId)) {
			if ('controls' in $(this.mediaPlayerId)) {
				this.use_mediaControl = true;
			}
		}
		this.isAudioTested = true;
	},
	getControlledMedia: function() {
 	 	var content = '<object id="' + this.mediaPlayerId + '" width="0" height="0"'
			+ ' classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" '
			+ ' type="application/x-oleobject">' + "\n"
			+ '<param name="URL" value=""/>' + "\n"
			+ '<param name="SendPlayStateChangeEvents" value="True"/>' + "\n"
			+ '<param name="AutoStart" value="True"/>' + "\n"
			+ '<param name="uiMode" value="none"/>' + "\n"
			+ '<param name="PlayCount" value="1"/>' + "\n"
	 	   + '<embed type="application/x-mplayer2" pluginspage="https://www.microsoft.com/Windows/MediaPlayer/"'
     	 	+ ' name="MediaPlayer1" width="0" height="0" ShowControls="false" AutoStart="True" '
     	 	+ ' url="" sendplaystatechangevents="True" uiMode="none" playcount="1">'
      	  + '</embed>' + "\n"
			+ '</object>';
		return content;
	},
	getNonControlledMedia: function(audioLink) {	
		var content = '<object id="' + this.mediaPlayerId + '" width="0" height="0' + "\n" +
		    'classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6"' + "\n" +
			'type="application/x-oleobject" style="background-color:#E7E9EA">' + "\n" +
			'<param name="URL" value="' + audioLink + '" />' + "\n" +
			'<param name="showControls" value="1" />' + "\n" +
			'<param name="showPositionControls" value="0" />' + "\n" +
			'<param name="AutoStart" value="true" />' + "\n" +
			'<embed id="ShoutPlayer2" type="application/x-mplayer2\"' + "\n" +
			'pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"' + "\n" +
			'src="' + audioLink + '"' + "\n" +
			'name="' + this.mediaPlayerId + '"' + "\n" +
			'width="0"' + "\n" +
			'height="0"' + "\n" +
			'ShowControls="false"' + "\n" +
			'AutoStart="true" style="background-color:#E7E9EA">' + "\n" +
			'</embed>' + "\n" +
			'</object>';
		return content;
	},
	getFFMedia: function(audioLink) {
		var content = '<embed id="ShoutPlayer2" name="' + this.mediaPlayerId +
			'" src="' + audioLink + '" autostart="true" loop="false" width="0" height="0" ShowControls="false"></embed>';
		return content;
	},
	reset: function() {
		if (this.containerId && $(this.containerId)) {
			$(this.containerId).parentNode.innerHTML = '<img src="' + this.playerControlGraphicLoading + '" width="192" height="37"/>';
		}
	}
}
/*
 * File: methods.js
 * Created: Sept 27, 2006
 * Author: Wes Jones
 * Purpose: To provide functions that are used on a consistent 
 *    basis or that do not belong to any particular class
 */

String.prototype.ucfirst = function(){
     return this.toLowerCase().replace(/\w+/g,function(s){
          return s.charAt(0).toUpperCase() + s.substr(1);
     })
}

String.prototype.ucwords = function(){
     return this.toLowerCase().replace(/\w+/g,function(s){
          var a = s.split(' ');
          for(var i = 0; i < a.length; ++i) {
             s = s.replace(a[i],a[i].ucfirst());
          }
          return s;
     })
}

String.prototype.charpac = function(n){
      var str = '';
      for(var i = 0; i < n; ++i) { str += this; }
      return str;
}

String.prototype.trim = function() {
    str = this != window? this : str;
    return str.replace(/^\s+/, '').replace(/\s+$/, '');
}

Number.prototype.decimals = function(n){
   var z = parseInt(n) ? parseInt('1'+('0'.charpac(n))) : 1;
   return z > 1 ? Math.round(this*z)/z : this;
}

function clone (obj,deep) {
  var objectClone = new obj.constructor();
  for (var property in obj)
    if (!deep)
      objectClone[property] = obj[property];
    else if (typeof obj[property] == 'object')
      objectClone[property] = clone(obj[property],deep);
    else
      objectClone[property] = obj[property];
  return objectClone;
}


function count(__object__){
   var len = 0; for(var i in __object__) { len += 1; }; return len;
}

// GLOBALS this is used to hold global variables between functions
// this allows functions to have variables when returned from AJAX
var GLOBALS = new Object(); 
var PO = new ParseObj();

function divWindow (dw,img,hdr,str,w,h,x,y,onclose,dir) {
/*
 * Purpose: to simulate a popup window with a div layer
 * dw is the a div object
 */
   // if dw is a string make it become the object assuming it is the id for the object
   var dw = document.getElementById(dw);
   var w = parseInt(w) > 100 ? parseInt(w) : 400;
   var h = parseInt(h) > 50 ? parseInt(h) : 400;
   dw.style.position = 'absolute';
   dw.style.width = w+'px';
   dw.style.height = h+'px';
   dw.style.left = (typeof(x) ? x : screen.width/2 - w/2)+'px';
   dw.style.top = (typeof(y) ? y : screen.height/2 - h/2)+'px';
   dw.style.zIndex = 100;
   dw.style.backgroundColor = '#ffffff';
   dw.onclose = function () {
      this.innerHTML = '';
      this.style.position = 'absolute';
      this.style.left = '0px';
      this.style.top = '0px';
      this.style.width = '1px';
      this.style.height = '1px';
   }
   dw.path = typeof(dir) ? dir : '';
   dw.innerHTML = '<IFRAME id="'+dw.id+'_frame" style="position:absolute;background-color:'+dw.style.backgroundColor+';width:'+(is_nav ? w+8 : w)+'px;height:'+(is_nav ? h+8 : 8)+'px;" frameborder=0 scrolling=no marginwidth=0 src="" marginheight=0></iframe>'+
                  '<div style="position:absolute;border:4px ridge;background-color:'+dw.style.backgroundColor+';width:'+w+'px;height:'+h+'px;">'+
                     '<div id="'+dw.id+'_content" style="position:absolute;margin-top:20px;width:'+(is_ie ? w-8 : w)+'px;height:'+((is_ie ? h-8 : h)-20)+'px;overflow:auto;">'+str+'</div>'+
                  '</div>'+
                  '<div id="'+dw.id+'_hdr" style="position:absolute;top:4px;left:4px;background-image:url('+img+');width:'+(document.all ? w-7 : w+1)+'px;height:20px;color:#ffffff;">'+hdr+'</div>'+
                  '<div id="'+dw.id+'_close" align="center" style="position:absolute;top:6px;left:'+(w-(is_ie ? 20 : 13))+'px;width:16px;height:16px;display:table-cell;vertical-align:middle;text-align:center;"><a href="javascript:divClose(\''+dw.id+'\');"><img src="'+dw.path+'images/close.gif" border="0" width="16" height="14"></a></div>';
str = '';
for(var i in dw.style) {
   str+= i+' = '+dw.style[i]+'<br>';
}
   makeDraggable(document.getElementById(dw.id+'_hdr'),dw);
}

function divClose(dw) {
   var dw = document.getElementById(dw);
   dw.onclose();
}

function setCookie(cookieName,cookieValue,nDays) {
   var today = new Date();
   var expire = new Date();
   if (nDays==null || nDays==0) nDays=1;
   expire.setTime(today.getTime() + 3600000*24*nDays);
   document.cookie = cookieName+"="+escape(cookieValue)+ ";expires="+expire.toGMTString();
}

function deleteCookie(cookieName) {
   var c = new Date();
   document.cookie = cookieName+'=1;expires='+c.toGMTString()+';'+';';
}


function escapeHtml(str) {
   if(typeof(str) == 'string') {
      str = str.replace(/\</gi,'&lt;');
      str = str.replace(/\>/gi,'&gt;');
      str = str.replace(/\"/gi,'&quot;');
      str = str.replace(/\&/gi,'&amp;');
      str = str.replace(/\-/gi,'&ndash;');
      str = str.replace(/\_/gi,'&mdash;');
      str = str.replace(/\'/gi,'&lsquo;');
   }
   return str;
}

function unescapeHtml(str) {
   if(typeof(str) == 'string') {
      str = str.replace(/\&lt\;/gi,'<');
      str = str.replace(/\&gt\;/gi,'>');
      str = str.replace(/\&quot\;/gi,'"');
      str = str.replace(/\&amp\;/gi,'&');
      str = str.replace(/\&ndash\;/gi,'-');
      str = str.replace(/\&mdash\;/gi,'_');
      str = str.replace(/\&lsquo\;/gi,'\'');
      str = str.replace(/\&rsquo\;/gi,'\'');
   }
   return str;
}


function daysInMonth(year,month) {
   // month needs to be 0-11
   var d= new Date();
   year = year ? year : d.getFullYear();
   var days = new Array(31,((year%4==0&& year%100!=0)||year%400==0?29:28),31,30,31,30,31,31,30,31,30,31);
   if (!isNaN(month)) { return days[month]; }
   else { return days; }
}

function getMonthName(month,chars) {
   var months = new Array('January','February','March','April','May','Jun','July','August','September','October','November','December');
   return months[month].substr(0,(parseInt(chars) > 0 ? chars : months[month].length));
}

function startTime(divid) {
   var today=new Date()
   var h=today.getHours()
   var m=today.getMinutes()
   var s=today.getSeconds()
   // add a zero in front of numbers<10
   h=dd(h);
   m=dd(m)
   s=dd(s)
   document.getElementById(divid).innerHTML=h+":"+m+":"+s
   t=setTimeout('startTime()',500)
}

function dd(i){ // make double digits
   if (i<10) {i="0" + i}
   return i;
}

function charpac(s,n) {
   var str = '';
   for(var i = 0; i < n; ++i) { str += s; }
   return str;
}

function getMilliseconds() {
   var d = new Date();
   var n = 0;
   n += d.getHours()*60*60*1000;
   n += d.getMinutes()*60*1000;
   n += d.getSeconds()*1000;
   n += d.getMilliseconds();
   return n;
}

function preInput(type,id,txt,rows,cols,style) {
   if(type == 'text') {
      return '<input type="text" name="'+id+'" id="'+id+'" value="'+txt+'" style="'+(style ? style : 'color:#999999;width:230px;font-family:arial;font-size:11px;')+'" onfocus="preInputText(\''+txt+'\',this,\'focus\');" onblur="preInputText(\''+txt+'\',this,\'blur\');">';
   } else if(type == 'textarea') {
      return '<textarea  name="'+id+'" id="'+id+'" rows="'+rows+'" cols="'+cols+'" style="'+(style ? style : 'color:#999999;width:230px;font-family:arial;font-size:11px;')+'" onfocus="preInputText(\''+txt+'\',this,\'focus\');" onblur="preInputText(\''+txt+'\',this,\'blur\');">'+txt+'</textarea>';
   }
}

function preInputText(str,obj,cmd) {
   if(cmd == 'focus') {
      if(obj.value == str) {
         obj.style.color = '#000000';
         obj.value = '';
      }
   } else if (cmd == 'blur') {
      if(obj.value == '') {
         obj.style.color = '#999999';
         obj.value = str;
      }
   }
}

function PopUp () {
   this.name = 'popup';
   this.toolbar = 'no';
   this.scrollbars = 'yes';
   this.status = 'no';
   this.resizable = 'no';
   this.menubar = 'no';
   this.width = 320;
   this.height = 240;
   this.win = null;
   this.url = null;
   this.go = function (url) {
      this.url = url;
      this.win=window.open(url,this.name,'toolbar='+this.toolbar+',scrollbars='+this.scrollbar+',status='+this.status+',resizable='+this.resizable+',menubar='+this.menubar+',width='+this.width+',height='+this.height);
   }
   this.write = function (str) {
      this.win.document.write(str);
   }
}


function exists(obj,attribute) {
   var e = false;
   for(var i in obj) {
      if(i == attribute) {
         e = true;
         break;
      }
   }
   return e;
}


function CreateBookmarkLink(title) {
   url = document.location;

   if (window.sidebar) { // Mozilla Firefox Bookmark
      window.sidebar.addPanel(title, url,"");
   } else if( window.external ) { // IE Favorite
      window.external.AddFavorite( url, title);
   } else if(window.opera && window.print) { // Opera Hotlist
      return true;
   }
}

function getKeyCode (e) {
   if(window.event) { // IE
      return e.keyCode;
   } else if (e.which) { // Netscape/Firefox/Opera
      return e.which;
   }
}

function secondstostr (s,chop) {
   // convert a time in seconds to Y-m-d H:i:s
   if(s == 0) { return 0; }
   else {
      var negative = '';
      if(s<0) { s = Math.abs(s); negative='-'; }
      var tl = s;
      s = dd(s%60);
         tl = (tl-s)/60;
      var i = dd(tl%60);
         tl = (tl-i)/60;
      var h = dd(tl%24);
         tl = (tl-h)/24;
      var mydate = new Date();
         dim = daysInMonth(mydate.getFullYear(),mydate.getMonth());
      var d = dd(tl%dim);
         tl = (tl-d)/dim;
      var m = dd(tl%12); 
         tl = (tl-m)/12;
      var y = dd(tl);
      if(!chop) {
         return negative+y+'-'+m+'-'+d+' '+h+':'+i+':'+s;
      } else {
         str='';
         if(y>0||str){ str+=y+'-'; }
         if(m>0||str){ str+=m+'-'; }
         if(d>0||str){ str+=d+' '; }
         if(h>0||str){ str+=h+':'; }
         if(i>0||str){ str+=i+':'; }
         str+=s;
         return negative+str;
      }
   }
}

function ByteSize(bytes) {  
/* format sizes of bytes */
   size = bytes / 1024;  
   if(size < 1024){
       // kilobytes
       size = (parseInt((size)*100)/100)+'kb';  
   } else {  
       if(size / 1024 < 1024) {
           // megabytes
           size = size/1024;
           size = (parseInt((size)*100)/100)+'mb';  
       } else if(size/1024/1024 < 1024) {
           // gigabytes
           size = size/1024/1024;
           size = (parseInt((size)*100)/100)+'gb';  
       } else {  
           // terrabytes
           size = size/1024/1024/1024;  
           size = (parseInt((size)*100)/100)+'tb';  
       }  
   }  
   return size;  
}

function ParseObj() {
/*
 * ParseObj.js
 * Created Sept 26, 2006
 * Author: Wes Jones
 * Purpose: take any url or query string and parse it into a hiearchal object return as array of objects
 * Example: gets variables out of a query string
 *   var str = 'test=hello&user[id]=1&user[level]=2';
 *   var p = new ParseObj();
 *   var obj = p.parseIt(str);
 *   alert(p.traceIt(obj)); // traces like print_r in php
 * Example 2: gets variables out of the url
 *   var p = new ParseObj();
 *   var urlvars = p.getURL();
 *   alert(p.traceIt(urlvars));
 */
   this.obj = new Object();
   this.getURL = function () { // get url and parseIt
      var str = document.location+'';
      var sp = str.split('?');
      return this.parseIt(sp[1]);
   }
   this.parseIt = function (vars,chr) {
      // parese query string into variable object and return it
      this.obj = new Object();
      chr = chr ? chr : '&';
      if(typeof(vars) != 'string') { vars = vars+''; }
      var v = vars.split(chr);
      for(var i = 0; i < v.length; i ++) {
         v[i] = v[i].split('=');
         var tmp = v[i][0].split('[');
         if (tmp.length > 1) {
            if (this.obj[tmp[0]] == undefined) {
               this.obj[tmp[0]] = new Object();
            }
            var keys = v[i][0].split('[');
            keys = keys.splice(1,keys.length-1);
            for(var j in keys) {
               keys[j] = keys[j].replace(']','');
            }
            this.obj[tmp[0]] = this.addKV(this.obj[tmp[0]],keys,v[i][1]);
         } else {
            if (v[i][0]) {
               this.obj[v[i][0]] = v[i][1];
            }
         }
      }
      return this.obj;
   }
   this.addKV = function (obj,keys,val) {
      // add sub child objects recursivly
      if(keys.length > 1) {
         if(!obj[keys[0]]) {
            obj[keys[0]] = new Object();
         }
         obj[keys[0]] = this.addKV(obj[keys[0]],keys.splice(1,keys.length-1),val);
      } else {
         obj[keys[0]] = val.match(/^\d+$/) ? parseFloat(val) : val.replace(/\|\#35\;/gi,'&');
      }
      return obj;
   }
   this.charPac = function (c,d) {
      // add spacing for legibility
      var str = '';
      for(var i = 0; i < d; ++i) { str += c; }
      return str;
   }
   this.traceIt = function (obj,depth) {
      // recursivly trace the array and ouput in hiearchal string
      var str = '';
      depth = depth ? parseInt(depth) : 0;
      for(var i in obj) {
         str += this.charPac('---',depth+1)+'['+i+'] '+(typeof(obj[i]) == 'object' ? '= Object (\n'+this.traceIt(obj[i],depth+2) : ' = '+obj[i]+',')+'\n';
         str += typeof(obj[i]) == 'object' ? this.charPac('---',depth+1)+'),\n' : '';
      }
      return str;
   }
   this.toString = function (obj,name) {
      var str = '';
      for (i in obj) {
         if (typeof(obj[i]) != 'function') {
            if(typeof(obj[i]) == 'object' || typeof(obj[i]) == 'array') {
               str += this.toString(obj[i],name+'['+i+']');
            } else {
               str += name+'['+i+']='+obj[i]+'&';
            }
         }
      }
      return str;
   }
}

function copy_clip(meintext) {
   if (window.clipboardData) {
      // the IE-manier
      window.clipboardData.setData("Text", meintext);
   } else if (window.netscape) { 
      // you have to sign the code to enable this, or see notes below 
      netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
      // maak een interface naar het clipboard
      var clip = Components.classes['@mozilla.org/widget/clipboard;1']
                 .createInstance(Components.interfaces.nsIClipboard);
      if (!clip) return;
         // maak een transferable
         var trans = Components.classes['@mozilla.org/widget/transferable;1']
                  .createInstance(Components.interfaces.nsITransferable);
      if (!trans) return;
         // specificeer wat voor soort data we op willen halen; text in dit geval
         trans.addDataFlavor('text/unicode');
         var str = new Object();
         var len = new Object();
   
         var str = Components.classes["@mozilla.org/supports-string;1"]
                .createInstance(Components.interfaces.nsISupportsString);
   
         var copytext=meintext;
   
         str.data=copytext;
   
         trans.setTransferData("text/unicode",str,copytext.length*2);
   
         var clipid=Components.interfaces.nsIClipboard;
   
         if (!clip) return false;

         clip.setData(trans,null,clipid.kGlobalClipboard);
      }
      return false;
}

/*
Macromedia(r) Flash(r) JavaScript Integration Kit License


Copyright (c) 2005 Macromedia, inc. All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.

3. The end-user documentation included with the redistribution, if any, must
include the following acknowledgment:

"This product includes software developed by Macromedia, Inc.
(http://www.macromedia.com)."

Alternately, this acknowledgment may appear in the software itself, if and
wherever such third-party acknowledgments normally appear.

4. The name Macromedia must not be used to endorse or promote products derived
from this software without prior written permission. For written permission,
please contact devrelations@macromedia.com.

5. Products derived from this software may not be called "Macromedia" or
"Macromedia Flash", nor may "Macromedia" or "Macromedia Flash" appear in their
name.

THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MACROMEDIA OR
ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.

--

This code is part of the Flash / JavaScript Integration Kit:
http://www.macromedia.com/go/flashjavascript/

Created by:

Christian Cantrell
http://weblogs.macromedia.com/cantrell/
mailto:cantrell@macromedia.com

Mike Chambers
http://weblogs.macromedia.com/mesh/
mailto:mesh@macromedia.com

Macromedia
*/

/**
 * Create a new Exception object.
 * name: The name of the exception.
 * message: The exception message.
 */
function Exception(name, message)
{
    if (name)
        this.name = name;
    if (message)
        this.message = message;
}

/**
 * Set the name of the exception. 
 */
Exception.prototype.setName = function(name)
{
    this.name = name;
}

/**
 * Get the exception's name. 
 */
Exception.prototype.getName = function()
{
    return this.name;
}

/**
 * Set a message on the exception. 
 */
Exception.prototype.setMessage = function(msg)
{
    this.message = msg;
}

/**
 * Get the exception message. 
 */
Exception.prototype.getMessage = function()
{
    return this.message;
}

/**
 * Generates a browser-specific Flash tag. Create a new instance, set whatever
 * properties you need, then call either toString() to get the tag as a string, or
 * call write() to write the tag out.
 */

/**
 * Creates a new instance of the FlashTag.
 * src: The path to the SWF file.
 * width: The width of your Flash content.
 * height: the height of your Flash content.
 */
function FlashTag(src, width, height, bgcolor)
{
    this.src       = src;
    this.width     = width;
    this.height    = height;
    this.version   = '7,0,14,0';
    this.id        = null;
    this.bgcolor   = bgcolor;
    this.flashVars = null;
    this.params    = new Array();
    this.addParam = function(k,v) {
       this.params.push(new fVar(k,v));
    }
    this.addVariable = function (k,v) {
       if (this.flashVars == null) {
          alert('You need to add the uid before adding variables');
       } else {
          this.flashVars += '&'+k+'='+v;
       }
    }
}

function fVar (k,v) {
   this.name = k;
   this.value = v;
}

/**
 * Sets the Flash version used in the Flash tag.
 */
FlashTag.prototype.setVersion = function(v)
{
    this.version = v;
}

/**
 * Sets the ID used in the Flash tag.
 */
FlashTag.prototype.setId = function(id)
{
    this.id = id;
}

/**
 * Sets the background color used in the Flash tag.
 */
FlashTag.prototype.setBgcolor = function(bgc)
{
    this.bgcolor = bgc;
}

/**
 * Sets any variables to be passed into the Flash content. 
 */
FlashTag.prototype.setFlashvars = function(fv)
{
    this.flashVars = fv;
}

/**
 * Get the Flash tag as a string. 
 */
FlashTag.prototype.toString = function()
{
    var ie = (navigator.appName.indexOf ("Microsoft") != -1) ? 1 : 0;
    var flashTag = new String();
    if (ie)
    {
        flashTag += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
        if (this.id != null)
        {
            flashTag += 'id="'+this.id+'" ';
        }
        flashTag += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+this.version+'" ';
        flashTag += 'width="'+this.width+'" ';
        flashTag += 'height="'+this.height+'">';
        flashTag += '<param name="movie" value="'+this.src+'"/>';
        flashTag += '<param name="quality" value="high"/>';
        flashTag += this.bgcolor != null ? '<param name="bgcolor" value="'+this.bgcolor+'"/>' : '<param name="bgcolor" value="#ffffff"/><param name="wmode" value="transparent"/>';
        for (i in this.params) {
           flashTag += '<param name="'+this.params[i].name+'" value="'+this.params[i].value+'"/>';
        }
        if (this.flashVars != null)
        {
            flashTag += '<param name="flashvars" value="'+this.flashVars+'"/>';
        }
        flashTag += '</object>';
    }
    else
    {
        flashTag += '<embed src="'+this.src+'" ';
        flashTag += 'quality="high" '; 
        flashTag += this.bgcolor != null ? 'bgcolor="'+this.bgcolor+'" ' : 'bgcolor="#ffffff" wmode="transparent"';
        flashTag += 'width="'+this.width+'" ';
        flashTag += 'height="'+this.height+'" ';
        flashTag += 'type="application/x-shockwave-flash" ';
        for (i in this.params) {
           flashTag += this.params[i].name+'="'+this.params[i].value+'" ';
        }
        if (this.flashVars != null)
        {
            flashTag += 'flashvars="'+this.flashVars+'" ';
        }
        if (this.id != null)
        {
            flashTag += 'name="'+this.id+'" ';
        }
        flashTag += 'pluginspage="http://www.macromedia.com/go/getflashplayer">';
        flashTag += '</embed>';
    }
    return flashTag;
}

/**
 * Write the Flash tag out. Pass in a reference to the document to write to. 
 */
FlashTag.prototype.write = function(doc)
{
    //doc.write(this.toString());
    var d = document.getElementById(doc);
    if (d) {
       document.getElementById(doc).innerHTML = this.toString();
    }
}

/**
 * The FlashSerializer serializes JavaScript variables of types object, array, string,
 * number, date, boolean, null or undefined into XML. 
 */

/**
 * Create a new instance of the FlashSerializer.
 * useCdata: Whether strings should be treated as character data. If false, strings are simply XML encoded.
 */
function FlashSerializer(useCdata)
{
    this.useCdata = useCdata;
}

/**
 * Serialize an array into a format that can be deserialized in Flash. Supported data types are object,
 * array, string, number, date, boolean, null, and undefined. Returns a string of serialized data.
 */
FlashSerializer.prototype.serialize = function(args)
{
    var qs = new String();

    for (var i = 0; i < args.length; ++i)
    {
        switch(typeof(args[i]))
        {
            case 'undefined':
                qs += 't'+(i)+'=undf';
                break;
            case 'string':
                qs += 't'+(i)+'=str&d'+(i)+'='+escape(args[i]);
                break;
            case 'number':
                qs += 't'+(i)+'=num&d'+(i)+'='+escape(args[i]);
                break;
            case 'boolean':
                qs += 't'+(i)+'=bool&d'+(i)+'='+escape(args[i]);
                break;
            case 'object':
                if (args[i] == null)
                {
                    qs += 't'+(i)+'=null';
                }
                else if (args[i] instanceof Date)
                {
                    qs += 't'+(i)+'=date&d'+(i)+'='+escape(args[i].getTime());
                }
                else // array or object
                {
                    try
                    {
                        qs += 't'+(i)+'=xser&d'+(i)+'='+escape(this._serializeXML(args[i]));
                    }
                    catch (exception)
                    {
                        throw new Exception("FlashSerializationException",
                                            "The following error occurred during complex object serialization: " + exception.getMessage());
                    }
                }
                break;
            default:
                throw new Exception("FlashSerializationException",
                                    "You can only serialize strings, numbers, booleans, dates, objects, arrays, nulls, and undefined.");
        }

        if (i != (args.length - 1))
        {
            qs += '&';
        }
    }

    return qs;
}

/**
 * Private
 */
FlashSerializer.prototype._serializeXML = function(obj)
{
    var doc = new Object();
    doc.xml = '<fp>'; 
    this._serializeNode(obj, doc, null);
    doc.xml += '</fp>'; 
    return doc.xml;
}

/**
 * Private
 */
FlashSerializer.prototype._serializeNode = function(obj, doc, name)
{
    switch(typeof(obj))
    {
        case 'undefined':
            doc.xml += '<undf'+this._addName(name)+'/>';
            break;
        case 'string':
            doc.xml += '<str'+this._addName(name)+'>'+this._escapeXml(obj)+'</str>';
            break;
        case 'number':
            doc.xml += '<num'+this._addName(name)+'>'+obj+'</num>';
            break;
        case 'boolean':
            doc.xml += '<bool'+this._addName(name)+' val="'+obj+'"/>';
            break;
        case 'object':
            if (obj == null)
            {
                doc.xml += '<null'+this._addName(name)+'/>';
            }
            else if (obj instanceof Date)
            {
                doc.xml += '<date'+this._addName(name)+'>'+obj.getTime()+'</date>';
            }
            else if (obj instanceof Array)
            {
                doc.xml += '<array'+this._addName(name)+'>';
                for (var i = 0; i < obj.length; ++i)
                {
                    this._serializeNode(obj[i], doc, null);
                }
                doc.xml += '</array>';
            }
            else
            {
                doc.xml += '<obj'+this._addName(name)+'>';
                for (var n in obj)
                {
                    if (typeof(obj[n]) == 'function')
                        continue;
                    this._serializeNode(obj[n], doc, n);
                }
                doc.xml += '</obj>';
            }
            break;
        default:
            throw new Exception("FlashSerializationException",
                                "You can only serialize strings, numbers, booleans, objects, dates, arrays, nulls and undefined");
            break;
    }
}

/**
 * Private
 */
FlashSerializer.prototype._addName= function(name)
{
    if (name != null)
    {
        return ' name="'+name+'"';
    }
    return '';
}

/**
 * Private
 */
FlashSerializer.prototype._escapeXml = function(str)
{
    if (this.useCdata)
        return '<![CDATA['+str+']]>';
    else
        return str.replace(/&/g,'&amp;').replace(/</g,'&lt;');
}

/**
 * The FlashProxy object is what proxies function calls between JavaScript and Flash.
 * It handles all argument serialization issues.
 */

/**
 * Instantiates a new FlashProxy object. Pass in a uniqueID and the name (including the path)
 * of the Flash proxy SWF. The ID is the same ID that needs to be passed into your Flash content as lcId.
 */
function FlashProxy(uid, proxySwfName)
{
    this.uid = uid;
    this.proxySwfName = proxySwfName;
    this.flashSerializer = new FlashSerializer(false);
}

/**
 * Call a function in your Flash content.  Arguments should be:
 * 1. ActionScript function name to call,
 * 2. any number of additional arguments of type object,
 *    array, string, number, boolean, date, null, or undefined. 
 */
FlashProxy.prototype.call = function()
{

    if (arguments.length == 0)
    {
        throw new Exception("Flash Proxy Exception",
                            "The first argument should be the function name followed by any number of additional arguments.");
    }

    var qs = 'lcId=' + escape(this.uid) + '&functionName=' + escape(arguments[0]);

    if (arguments.length > 1)
    {
        var justArgs = new Array();
        for (var i = 1; i < arguments.length; ++i)
        {
            justArgs.push(arguments[i]);
        }
        qs += ('&' + this.flashSerializer.serialize(justArgs));
    }

    var divName = '_flash_proxy_' + this.uid;
    if(!document.getElementById(divName))
    {
        var newTarget = document.createElement("div");
        newTarget.id = divName;
        document.body.appendChild(newTarget);
    }
    var target = document.getElementById(divName);
    var ft = new FlashTag(this.proxySwfName, 1, 1);
    ft.setVersion('6,0,65,0');
    ft.setFlashvars(qs);
    target.innerHTML = ft.toString();
}

/**
 * This is the function that proxies function calls from Flash to JavaScript.
 * It is called implicitly.
 */
FlashProxy.callJS = function()
{
    var functionToCall = eval(arguments[0]);
    var argArray = new Array();
    for (var i = 1; i < arguments.length; ++i)
    {
        argArray.push(arguments[i]);
    }
    functionToCall.apply(functionToCall, argArray);
}

/**
 * SWFObject v1.4.4: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for
 *   legal reasons.
 */
if(typeof deconcept == "undefined") var deconcept = new Object();
if(typeof deconcept.util == "undefined") deconcept.util = new Object();
if(typeof deconcept.SWFObjectUtil == "undefined") deconcept.SWFObjectUtil = new Object();
deconcept.SWFObject = function(swf, id, w, h, ver, c, useExpressInstall, quality, xiRedirectUrl, redirectUrl, detectKey){
	if (!document.getElementById) { return; }
	this.DETECT_KEY = detectKey ? detectKey : 'detectflash';
	this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
	this.params = new Object();
	this.variables = new Object();
	this.attributes = new Array();
	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 deconcept.PlayerVersion(ver.toString().split("."))); }
	this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion();
	if(c) { this.addParam('bgcolor', c); }
	var q = quality ? quality : 'high';
	this.addParam('quality', q);
	this.setAttribute('useExpressInstall', useExpressInstall);
	this.setAttribute('doExpressInstall', false);
	var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
	this.setAttribute('xiRedirectUrl', xir);
	this.setAttribute('redirectUrl', '');
	if(redirectUrl) { this.setAttribute('redirectUrl', redirectUrl); }
}
deconcept.SWFObject.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;
	},
	getVariablePairs: function(){
		var variablePairs = new Array();
		var key;
		var variables = this.getVariables();
		for(key in variables){
			variablePairs.push(key +"="+ variables[key]);
		}
		return variablePairs;
	},
	getSWFHTML: function() {
		var swfNode = "";
		if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture
			if (this.getAttribute("doExpressInstall")) { this.addVariable("MMplayerType", "PlugIn"); }
			swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'"';
			swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
			var params = this.getParams();
			 for(var key in params){ swfNode += [key] +'="'+ params[key] +'" '; }
			var pairs = this.getVariablePairs().join("&");
			 if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; }
			swfNode += '/>';
		} else { // PC IE
			if (this.getAttribute("doExpressInstall")) { this.addVariable("MMplayerType", "ActiveX"); }
			swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'">';
			swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';
			var params = this.getParams();
			for(var key in params) {
			 swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
			}
			var pairs = this.getVariablePairs().join("&");
			if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}
			swfNode += "</object>";
		}
		return swfNode;
	},
	write: function(elementId){
		if(this.getAttribute('useExpressInstall')) {
			// check to see if we need to do an express install
			var expressInstallReqVer = new deconcept.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);
			}
		}
		if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){
			var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
			n.innerHTML = this.getSWFHTML();
			return true;
		}else{
			if(this.getAttribute('redirectUrl') != "") {
				document.location.replace(this.getAttribute('redirectUrl'));
			}
		}
		return false;
	}
}

/* ---- detection functions ---- */
deconcept.SWFObjectUtil.getPlayerVersion = function(){
	var PlayerVersion = new deconcept.PlayerVersion([0,0,0]);
	if(navigator.plugins && navigator.mimeTypes.length){
		var x = navigator.plugins["Shockwave Flash"];
		if(x && x.description) {
			PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
		}
	}else{
		// do minor version lookup in IE, but avoid fp6 crashing issues
		// see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
		try{
			var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		}catch(e){
			try {
				var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
				PlayerVersion = new deconcept.PlayerVersion([6,0,21]);
				axo.AllowScriptAccess = "always"; // throws if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code)
			} catch(e) {
				if (PlayerVersion.major == 6) {
					return PlayerVersion;
				}
			}
			try {
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			} catch(e) {}
		}
		if (axo != null) {
			PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
		}
	}
	return PlayerVersion;
}
deconcept.PlayerVersion = function(arrVersion){
	this.major = arrVersion[0] != null ? parseInt(arrVersion[0]) : 0;
	this.minor = arrVersion[1] != null ? parseInt(arrVersion[1]) : 0;
	this.rev = arrVersion[2] != null ? parseInt(arrVersion[2]) : 0;
}
deconcept.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;
}
/* ---- get value of query string param ---- */
deconcept.util = {
	getRequestParameter: function(param) {
		var q = document.location.search || document.location.hash;
		if(q) {
			var pairs = q.substring(1).split("&");
			for (var i=0; i < pairs.length; i++) {
				if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
					return pairs[i].substring((pairs[i].indexOf("=")+1));
				}
			}
		}
		return "";
	}
}
/* fix for video streaming bug */
deconcept.SWFObjectUtil.cleanupSWFs = function() {
	if (window.opera || !document.all) return;
	var objects = document.getElementsByTagName("OBJECT");
	for (var i=0; i < objects.length; i++) {
		objects[i].style.display = 'none';
		for (var x in objects[i]) {
			if (typeof objects[i][x] == 'function') {
				objects[i][x] = function(){};
			}
		}
	}
}
// fixes bug in fp9 see http://blog.deconcept.com/2006/07/28/swfobject-143-released/
deconcept.SWFObjectUtil.prepUnload = function() {
	__flash_unloadHandler = function(){};
	__flash_savedUnloadHandler = function(){};
	if (typeof window.onunload == 'function') {
		var oldUnload = window.onunload;
		window.onunload = function() {
			deconcept.SWFObjectUtil.cleanupSWFs();
			oldUnload();
		}
	} else {
		window.onunload = deconcept.SWFObjectUtil.cleanupSWFs;
	}
}
if (typeof window.onbeforeunload == 'function') {
	var oldBeforeUnload = window.onbeforeunload;
	window.onbeforeunload = function() {
		deconcept.SWFObjectUtil.prepUnload();
		oldBeforeUnload();
	}
} else {
	window.onbeforeunload = deconcept.SWFObjectUtil.prepUnload;
}
/* add Array.push if needed (ie5) */
if (Array.prototype.push == null) { Array.prototype.push = function(item) { this[this.length] = item; return this.length; }}

/* add some aliases for ease of use/backwards compatibility */
var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject; // for legacy support
var SWFObject = deconcept.SWFObject;