

function pointMetricRecord (data) {

	return true;
	
	//console.log(data);
	
	data.assetURL = document.URL;
	data.clientResolution = screen.width + 'x' + screen.height;
	
	
	var url = "http://www.powersimple.tv/point/metrics/metrics.php?data=" + escape(JSON.encode(data));
	
	alert(url);
	
	Asset.javascript(url);
	//alert(escape(JSON.encode(data)));

	//console.log(data);
	//console.log(url);
	
}
function launchModalBox(url, w, h, color){
	modalBox.launch(url,w,h);
	
}

function gup( name )
			{
			  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
			  var regexS = "[\\?&]"+name+"=([^&#]*)";
			  var regex = new RegExp( regexS );
			  var results = regex.exec( window.location.href );
			  if( results == null )
			    return "";
			  else
			    return results[1];
			}

function mooBox(url, caption, dimensions){
	MOOdalBox.open(url, caption, dimensions);
}
function launchSite(URL){
		
		var Width = 1024;//(screen.width-(screen.width/50)); 
		var Height = 768;//(screen.height-(screen.height/10));
	    var params = 'toolbar=no,scrollbars=Yes,left=0,top=0,resizable=yes,width=' + Width + ',height=' + Height;
		pop = window.open(URL, 'newWindow', params);
		pop.focus();
	
}
function launch (URL){
		
		var Width = 1024;//(screen.width-(screen.width/50)); 
		var Height = 768;//(screen.height-(screen.height/10));
	    var params = 'toolbar=no,scrollbars=Yes,left=0,top=0,resizable=yes,width=' + Width + ',height=' + Height;
		pop = window.open(URL, 'newWindow', params);
		pop.focus();
	
}

function confirmAction(path, message) {
    if (confirm(message)) {
		window.location = path;
    } else {
       return false;
    }
}

function imageResize(x, y, maxx, maxy) {
	
	var propx = x / maxx;
	var propy = y / maxy;
	
	var newx = x;
	var newy = y;
	
	if (propx > 1 && propx > propy) {
		newx = maxx;
		newy = y / propx;
	} else if (propy > 1) {
		newy = maxy;
		newx = x / propy;
	}
	
	
	return {'width': newx, 'height': newy};
	
}


// JavaScript Document

function launchImage(theURL,Width,Height){
	  var Scrollbars = "no";
	  if(screen.height<Height){
	  var Height = (screen.height-200);
	  var Scrollbars = "yes";
	  }
	  
	  if(screen.width<Width){
	  var Width = (screen.width-200);
	  var Scrollbars = "yes";
	  }
	  else{
	  var Width = Width;
	  }
	  var Left = (screen.width-Width)/2;
	  var Top = (screen.height-Height)/2;
	  var params = ('toolbar=no,scrollbars=' + Scrollbars + ',resizable=no,left=' + Left +',top=' + Top +',width=' + Width + ',height=' + Height);
	  
	Pop = window.open(theURL, "LaunchImage", params);
	
	Pop.focus();
}
function launch(URL) {
        
		var Width = (screen.width-(screen.width/50)); 
		var Height = (screen.height-(screen.height/10));
	    var params = ('toolbar=no,scrollbars=Yes,left=0,top=0,resizable=yes,width=' + Width + ',height=' + Height);
		pop = window.open(URL, 'newWindow', params);
		pop.focus();
	}


function change_video(channel){
	//var re =  /(.ram|.rm|.ra)$/i;
	//var re2 =  /(.wmv|.wvx|.wma|.asf|.asx)$/i;
	//if(re.test(channel)){
		MediaPlayer.SetSource(channel);
		if(MediaPlayer.CanPlay()){ 
			MediaPlayer.DoPlay(); 
		}
	//}
	//if(re2.test(channel)){
	//	MediaPlayer.URL = channel;
	//	MediaPlayer.controls.play();
	//}
}
  var ie=document.all;
  var ns=document.layers;
  var button = new Array(); //all buttons
  /*
  button[1] = new Image(); button[1].src = "http://www.un.org/webcast/test/video_09.gif";
  button[2] = new Image(); button[2].src = "http://www.un.org/webcast/test/video_over_09.gif";
  var label = new Array(); //all labels
  for(var i=13; i<=17; i++) {
    label[i] = new Array();
	label[i][0] = new Image();
	label[i][1] = new Image();
	label[i][0].src = "http://www.un.org/webcast/test/video_"+i+".gif"; //mouse out
	label[i][1].src = "http://www.un.org/webcast/test/video_over_"+i+".gif"; //mouse out
  }
  */
  function swapbutton(xname) {
    var timg = eval("document."+xname);
	var j = parseInt((xname.toString()).slice(1)) + 12;
	var tlab = eval("document.l"+j);
	//alert(tlab);
    if((timg.src).toString()==(button[1].src).toString()) {
	  timg.src = button[2].src;
	  tlab.src = label[j][1].src;
	}
	else {
	  timg.src = button[1].src;
	  tlab.src = label[j][0].src;
	}
  }
function StopClick() {
  if(document.MediaPlayer.CanStop()) document.MediaPlayer.DoStop();
}
function PlayClick() {
  if(document.MediaPlayer.CanPlay()) document.MediaPlayer.DoPlay();
}
function PauseClick() {
  if(document.MediaPlayer.CanPause()) document.MediaPlayer.DoPause();
  else if(document.MediaPlayer.CanPlay()) document.MediaPlayer.DoPlay();
}
function VolumeDown(){ 
  if(document.MediaPlayer.GetVolume() >= 10){ 
	document.MediaPlayer.SetVolume(document.MediaPlayer.GetVolume() - 10) 
  }
}
function VolumeUp(){ 
  if(document.MediaPlayer.GetVolume() <= 90){ 
	document.MediaPlayer.SetVolume(document.MediaPlayer.GetVolume() + 10) 
  }
}
function MuteAudioClick() {
  if(!document.MediaPlayer.GetMute()) document.MediaPlayer.SetMute(true);
  else document.MediaPlayer.SetMute(false);
}
	function time2ms(str) {
	  str = new String(str);
	  var foo = str.split(":");
	  var tsec = parseInt(foo[foo.length-1]);
	  tsec += parseInt(foo[foo.length-2])*60;
	  tsec += parseInt(foo[foo.length-3])*60*60;
	  tsec = tsec*1000;
	  return tsec
	}
	function seek(tstr) {
	  	var _vid = self.document.MediaPlayer;
	    if(_vid && _vid.GetCanSeek()) _vid.SetPosition(time2ms(tstr));
	}

function getControlIcon(action,style){
	var imgTag = '<img src="../_media/graphics/icons/'+style+action+'.gif" border=\"0\" />';
	//alert(imgTag);
	return imgTag;
	
}

function getControls(style){

	var embedThis = '<a href="Javascript:PlayClick();">'+getControlIcon('Play',style)+'</a>';
	embedThis += '<a href="Javascript:StopClick();">'+getControlIcon('Stop',style)+'</a>';	
	embedThis += '<a href="Javascript:PauseClick();">'+getControlIcon('Pause',style)+'</a>';
	embedThis += '<a href="Javascript:MuteAudioClick();">'+getControlIcon('Mute',style)+'</a>';
	return embedThis;
}	
	
function renderReal(file,width,height,style){
	if (pluginlist.indexOf("RealPlayer")!=-1){
	
	} else {
		var p=window.confirm("RealPlayer is required to view this video Click okay to Launch Real Player Download Page")
		if (p){
		window.open('http://www.real.com/realcom/R?href=http%3A%2F%2Fforms.real.com%2Freal%2Fplayer%2Fdownload.html');
		} else {
		alert("Real Player is required to view this Video, Please visit real.com when you are ready to download the plug-in")
		}
		
	}
	var embedThis = '<embed controls="ImageWindow" type="audio/x-pn-realaudio-plugin"src=\''+file+'\' width="'+width+'" height='+height+' autostart="TRUE" name="MediaPlayer" console="theclip"></embed>';
	embedThis += getControls(style);
//	alert(embedThis);
	document.getElementById("player").innerHTML = embedThis;
}
function renderMov(file,width,height){
	var embedThis = '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="465" height="340" codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0" align="middle" >';
	embedThis += '<param name="src" value="'+file+'" />';
	embedThis += '<param name="autoplay" value="true" />';
	embedThis += '<embed controls="all" name="MediaPlayer" src="'+file+'" width="'+width+'" height='+height+' pluginspage=http://www.apple.com/quicktime/download/ align="middle" autoplay="true" bgcolor="black" ></embed></object>';
	
	document.getElementById("player").innerHTML = embedThis;
}
function renderMP4(file,width,height){
	renderMov(file,width,height);
}
function renderWMV(file,width,height){
	var embedThis = '<object id="MediaPlayer" width=465 height=340 classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading Windows Media Player components?" type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112">';
	embedThis += '<param name="filename" value="'+file+'">';
	embedThis += '<param name="Showcontrols" value="True">';
	embedThis += '<param name="autoStart" value="True">';
	//embedThis += '<PARAM name="controls" value="all">';
	embedThis += '<embed type="application/x-mplayer2" src="'+file+'" name="MediaPlayer" width="'+width+'" height='+height+'></embed>';
	
	document.getElementById("player").innerHTML = embedThis;
}

function renderFlash(file,width,height){

	
	
	
// <![CDATA[
var fo = new SWFObject("|||relRoot|||_media/flash/video-player.swf", "FlowPlayer", width, height, "7", "#ffffff", true);
// need this next line for local testing, it's optional if your swf is on the same domain as your html page
fo.addParam("allowScriptAccess", "always");
fo.addVariable("config", "{ fullScreenScriptURL: 'http://powersimple.com/flowplayer/fullscreen.js?id=12', showPlayListButtons: true, playList: [ {overlayId: 'play' }, { url: '"+file+"' } ], initialScale: 'fit' }");
fo.write("player");// ]]\]

}
function renderSWF(file,width,height){
	
		var obj = '<object data="'+file+'" height="'+height+'" type="application/x-shockwave-flash" width="'+width+'"><param name="id" value="360Demo" /><param name="align" value="middle" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><param name="src" value="'+file+'" /><param name="name" value="KristeanStandalone" /><param name="allowfullscreen" value="false" /></object>';
	//alert(obj);
    document.getElementById('playerHolder').innerHTML = obj;
}
function showVideo(file,fileType,width,height,style){
	
	document.getElementById("playerHolder").className = style;
	
	if(fileType == 'flv'){
		
			var ready = false;
			var version = parseInt(GetSwfVer());
			var neededVersion = "Flash Player is required";
			//alert("v"+version);
			if (pluginlist.indexOf("Flash")!=-1){
				
				if(version >= 8){
					ready = true;	
				} else {
				var neededVersion = "An updated version of your Flash Player is required";
				}	
			}
			
			if(!ready){
				/*var p=window.confirm(neededVersion + " to view this video Click okay to Adobe Flash Player Download Page")
				if (p){
				//window.open('http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player.exe');
				} else {
				//alert(neededVersion + "to view this Video, Please visit adobe.com when you are ready to download the plug-in");
				}
				*/
			} else {
				
			}
			
		
	} else if(fileType == 'rm'){
		renderReal(file,width,height,style);
	} else if(fileType == 'mov'){
		renderMov(file,width,height);
	} else if(fileType == 'mp4'){
		renderMP4(file,width,height);
	} else if(fileType == 'wmv'){
		renderWMV(file,width,height);
	} else if(fileType == 'swf'){
		renderSWF(file,width,height);
	} 
	else {}
	if(document.all){
		//alert(document.getElementById("playerHolder").className);
	}

}/*
function formats(file,fileType,width,height,formatList,path){
	l = formatList.split(",");
	formats = '<ul class="formats">';
	for(f in l){
		formats += '<li class="formatIcon"><a href="Javascript:showVideo('+file+','+fileType+','+width+','+height+');">'+f<img src="'+path+'_media/graphics/icons/'+f[l]+'.gif"></a></i>';
	}
	formats += '</ul>';
	document.getElementById('formatListIcons').innerHTML = formats;
	alert(formats);
	
}

//document.getElementById("player").innerHTML = '';

*/
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
function ControlVersion()
{
	var version;
	var axo;
	var e;
	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
	try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}
	if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful. 
			
			// default to the first public version
			version = "WIN 6,0,21,0";
			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "always";
			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}
	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}
	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}
	if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}
	
	return version;
}
// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	var flashVer = -1;
	
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			var descArray = flashDescription.split(" ");
			var tempArrayMajor = descArray[2].split(".");			
			var versionMajor = tempArrayMajor[0];
			var versionMinor = tempArrayMajor[1];
			var versionRevision = descArray[3];
			if (versionRevision == "") {
				versionRevision = descArray[4];
			}
			if (versionRevision[0] == "d") {
				versionRevision = versionRevision.substring(1);
			} else if (versionRevision[0] == "r") {
				versionRevision = versionRevision.substring(1);
				if (versionRevision.indexOf("d") > 0) {
					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
				}
			}
			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}	
	return flashVer;
}
// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
	versionStr = GetSwfVer();
	if (versionStr == -1 ) {
		return false;
	} else if (versionStr != 0) {
		if(isIE && isWin && !isOpera) {
			// Given "WIN 2,0,0,11"
			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
			tempString        = tempArray[1];			// "2,0,0,11"
			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
		} else {
			versionArray      = versionStr.split(".");
		}
		var versionMajor      = versionArray[0];
		var versionMinor      = versionArray[1];
		var versionRevision   = versionArray[2];
        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
		if (versionMajor > parseFloat(reqMajorVer)) {
			return true;
		} else if (versionMajor == parseFloat(reqMajorVer)) {
			if (versionMinor > parseFloat(reqMinorVer))
				return true;
			else if (versionMinor == parseFloat(reqMinorVer)) {
				if (versionRevision >= parseFloat(reqRevision))
					return true;
			}
		}
		return false;
	}
}
function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}
function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '';
  if (isIE && isWin && !isOpera)
  {
    str += '<object ';
    for (var i in objAttrs)
    {
      str += i + '="' + objAttrs[i] + '" ';
    }
    str += '>';
    for (var i in params)
    {
      str += '<param name="' + i + '" value="' + params[i] + '" /> ';
    }
    str += '</object>';
  }
  else
  {
    str += '<embed ';
    for (var i in embedAttrs)
    {
      str += i + '="' + embedAttrs[i] + '" ';
    }
    str += '> </embed>';
  }
  document.write(str);
}
function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}
function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}
function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    
    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblclick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
      case "id":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}
/*

var modalBox = new Class ({

	container: "outer",
	
	launch: function (url) {
	
		
		if ($defined($('modalBox')))
			$('modalBox').destroy();
	
		var height = 630;
		var width = 810;
	
		var windowSize = window.getSize();
	
		if (! $defined($('modalBlanket'))) {
			var blanket = new Element("div", {'id': 'modalBlanket'});
			blanket.setStyle("height", window.getHeight());
			blanket.setStyle("width", window.getWidth());
			blanket.setStyle("position", "absolute");
			blanket.setStyle("top", 1);
			blanket.setStyle("left", 1);
			blanket.setStyle("background", "black");
			blanket.setStyle("opacity", .5);
		
			blanket.inject($(this.container));
			
			blanket.addEvent('click', function () {this.close()}.bind(this));
		}
	
		if (! $defined($('modalBox'))) {
			var box = new Element("div", {'id': 'modalBox'});
			
			box.setStyle("position", "absolute");
			box.setStyle("top", (windowSize.y - height) / 2);
			box.setStyle("left", (windowSize.x - width) / 2);
			box.setStyle("height", height);
			box.setStyle("width", width);
			box.setStyle("border", "1px solid black");
			box.setStyle("padding", "4px");
			box.setStyle("margin", "4px");
			box.setStyle("z-index", "1000");
			box.setStyle("background", "white");
			box.setStyle("overflow", "auto");
			
			box.setProperty("id", "modalBox");
			
			box.inject($(this.container));
//			box.inject($(this.container));
		}
		
		$('modalBox').load(url);
				
		return $('modalBox');
	
	},
	
	close:  function () {
	
		$('modalBlanket').destroy();
		$('modalBox').destroy();
	
	}
});

modalBox = new modalBox();

function form2url(wformid,encode_it){
  
  if (kform = document.getElementById(wformid)){
    var fkeys = new Array();
    var fvals = new Array();
    var str = "";
    var no,i;
    var inputFields = kform.getElementsByTagName("INPUT");
    for(no=0;no<inputFields.length;no++){
      if (inputFields[no].type.toLowerCase() == "checkbox"){
        if(inputFields[no].checked){
          fkeys[fkeys.length] = inputFields[no].name;
          fvals[fvals.length] = "on";
        }
      } else if (inputFields[no].type.toLowerCase() != "button" && inputFields[no].type.toLowerCase() != "submit"){
        fkeys[fkeys.length] = inputFields[no].name;
        fvals[fvals.length] = inputFields[no].value;
      }
    }
    var selectBoxes = kform.getElementsByTagName("SELECT");
    for(no=0;no<selectBoxes.length;no++){
      fkeys[fkeys.length] = selectBoxes[no].name;
      fvals[fvals.length] = selectBoxes[no].value;
    }
    var selectBoxes = kform.getElementsByTagName("TEXTAREA");
    for(no=0;no<selectBoxes.length;no++){
      fkeys[fkeys.length] = selectBoxes[no].name;
      fvals[fvals.length] = selectBoxes[no].value;
    }
 
    for(i=0;i<fkeys.length;i++){
      str += "&"+fkeys[i]+"="+(fvals[i]?escape((encode_it?encode64(fvals[i]):fvals[i])):"");
    }
 
    return str;
  }
}
 
 
// This code was written by Tyler Akins and has been placed in the
// public domain.  It would be nice if you left this header intact.
// Base64 code from Tyler Akins -- http://rumkin.com
var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
function encode64(input) {
   var output = "";
   var chr1, chr2, chr3;
   var enc1, enc2, enc3, enc4;
   var i = 0;
 
   do {
      chr1 = input.charCodeAt(i++);
      chr2 = input.charCodeAt(i++);
      chr3 = input.charCodeAt(i++);
 
      enc1 = chr1 >> 2;
      enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
      enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
      enc4 = chr3 & 63;
 
      if (isNaN(chr2)) {
         enc3 = enc4 = 64;
      } else if (isNaN(chr3)) {
         enc4 = 64;
      }
 
      output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) +
         keyStr.charAt(enc3) + keyStr.charAt(enc4);
   } while (i < input.length);
 
   return output;
}
function decode64(input) {
   var output = "";
   var chr1, chr2, chr3;
   var enc1, enc2, enc3, enc4;
   var i = 0;
 
   // remove all characters that are not A-Z, a-z, 0-9, +, /, or =
   input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
 
   do {
      enc1 = keyStr.indexOf(input.charAt(i++));
      enc2 = keyStr.indexOf(input.charAt(i++));
      enc3 = keyStr.indexOf(input.charAt(i++));
      enc4 = keyStr.indexOf(input.charAt(i++));
 
      chr1 = (enc1 << 2) | (enc2 >> 4);
      chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
      chr3 = ((enc3 & 3) << 6) | enc4;
 
      output = output + String.fromCharCode(chr1);
 
      if (enc3 != 64) {
         output = output + String.fromCharCode(chr2);
      }
      if (enc4 != 64) {
         output = output + String.fromCharCode(chr3);
      }
   } while (i < input.length);
 
   return output;
}
*/
/////////////////////////////////////////////////////////
//
// FISHEYE MENU CLASS
/*
var fish = new Class({
	minZoom : 50,
	maxZoom : 100,
	zoomQty : 5,
	testVar : 'hi',
	initialize: function(handle) {
		this.handle = $(handle);
		this.items = this.handle.getElements('img');
		this.handle.setStyle('margin-left', '-' + (this.handle.offsetWidth/2) + 'px');
		this.effects = [] //meh
		this.items.each(function(el) {
			el.addEvent('mouseover', function() { this.magnify(el); }.bind(this));
			el.addEvent('mouseout', function() { this.shrink(el); }.bind(this));
			this.effects[el.src] = $(el.parentNode).effects({wait: false, duration: 200});
		}, this);
	},
	magnify: function(el) {
		this.effects[el.src].custom({
			'height': this.maxZoom + 'px',
			'width': this.maxZoom + 'px',
			'margin-top': '-' + (this.maxZoom - el.getStyle('height').toInt()) + 'px',
		})
	},
	shrink: function(el) {
		this.effects[el.src].custom({
			'height': this.minZoom + 'px',
			'width': this.minZoom + 'px',
			'margin-top': '0px',
		})
	}
});
			
*/
function cleanPng(){
	
	
}