if(!String.prototype.trim){String.prototype.trim=function(){var str=this.replace(/^\s+/g,'');str=str.replace(/\s+$/g,'');return(str);};}
Function.prototype.inherit=function(parent){var pc=parent.toString();var m=pc.match(/\s*function ([^(]+)\(/);if(m!=null){this.prototype[m[1]]=parent;}
for(var k in parent.prototype){this.prototype[k]=parent.prototype[k];}
};function add_listener(elem,type,callback){if(elem.addEventListener){elem.addEventListener(type,callback,false);}
else if(elem.attachEvent){elem.attachEvent('on'+type,function(){window.event.target=window.event.srcElement;callback(window.event);});}
}
function HTTP(){this.client=null;this.timeout=arguments[0]?arguments[0]:30000;this.timer=null;this.source='';this.query='';this.callback=null;this.callbackTimeout=null;try{this.client=new XMLHttpRequest();}
catch(e){this.client=new ActiveXObject('Microsoft.XMLHTTP');}
if(this.client==null){throw('Error: Your browser does not support'
+' features required by this page.');}
}
HTTP.prototype.get=function(uri){if(this.callback){this.source=uri;return(this.request('GET',uri));}
return(false);};HTTP.prototype.post=function(uri,query){if(this.callback){this.query=query;this.source=uri;return(this.request('POST',uri));}
return(false);};HTTP.prototype.request=function(request,uri){if(this.isBusy()){throw('Error: The page is currently busy.');}
var context=this;this.client.onreadystatechange=(function(){if(this.readyState==4){if(context.timer!=null){window.clearTimeout(context.timer);context.timer=null;}
if(this.status==200){if(this.getResponseHeader('Content-Type')=='text/xml'){context.callback(this.responseXML);}
else{context.callback(this.responseText);}
}
else if(this.status==404){throw('Error: Requested information could not be found ('
+context.source+').'
);}
else{throw('Error: Request failed.');}
}
});if(request=='POST'){this.client.open(request,uri,true);this.setContentType(this.query);this.client.setRequestHeader('Content-Length',this.query.length);this.client.setRequestHeader('Connection','close');this.client.send(this.query);}
else{this.client.open('GET',uri,true);this.client.send(null);}
if(this.callbackTimeout){this.timer=window.setTimeout((function(){window.clearTimeout(context.timer);if(context.isBusy()){context.client.onreadystatechange=null;context.client.abort();context.callbackTimeout();}
}),this.timeout
);}
return(true);};HTTP.prototype.setContentType=function(query){if(query.charAt(0)=='{'){this.client.setRequestHeader('Content-Type','text/json; charset=iso-8859-1');}
else if(query.substring(0,4)=='<xml'){this.client.setRequestHeader('Content-Type','text/xml; charset=iso-8859-1');}
else{this.client.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=iso-8859-1');}
};HTTP.prototype.isBusy=function(){switch(this.client.readyState){case 1:case 2:case 3:return(true);break;}
return(false);};var JSON={};JSON.getObject=function(json){return(eval('('+json+')'));};JSON.getURI=function(obj){return(JSON.getString(obj,JSON.uriSafe));};JSON.getString=function(obj){var buffer=[];var k,i;var treat=arguments[1]?arguments[1]:JSON.addQuotes;switch(JSON.getType(obj)){case 'object':for(k in obj){buffer.push(treat(k)+':'+JSON.getString(obj[k],treat));}
return('{'+buffer.join(',')+'}');break;case 'array':for(i=0;i<obj.length;++i){buffer.push(JSON.getString(obj[i],treat));}
return('['+buffer.join(',')+']');break;case 'string':return(treat(JSON.quoteString(obj)));break;case 'number':return(obj);break;case 'boolean':return(obj?'true':'false');break;case 'null':return('null');break;}
return('');};JSON.getType=function(obj){var type=typeof(obj);if((type==='object')&&(obj instanceof Array)){return('array');}
if((type==='object')&&(!obj)){return('null');}
return(type);};JSON.quoteString=function(str){var esc=/(["\t\n\r\\])/g;var subs={'"':'\\"',"\t":'\\t',"\n":'\\n',"\r":'\\r','\\':'\\\\'};if(esc.test(str)){str=str.replace(esc,function(m){return(subs[m])});}
return(str);};JSON.addQuotes=function(str){return('"'+str+'"');};JSON.uriSafe=function(str){return(escape(str));};function Messenger(){this.source=arguments[0]?arguments[0]:null;this.params=arguments[1]?arguments[1]:null;this.message=null;this.callback=null;this.callbackError=null;this.id='mid'+((new Date()).getTime());}
Messenger.prototype.setSource=function(s){this.source=s;};Messenger.prototype.setParam=function(k,v){this.params[k]=v;};Messenger.prototype.send=function(callback){this.callback=callback;var q=JSON.getURI({'id':this.id,'parameters':this.params});var c=new HTTP();c.callback=this.setResponseHandler();c.get(this.source+'?'+q);};Messenger.prototype.setResponseHandler=function(){var context=this;return(function(response){if(response.length&&response.charAt(0)=='{'){context.message=JSON.getObject(response);if(context.message.error>1&&context.callbackError){if(context.message.head.details){context.callbackError(context.message.head.details);}
else{context.callbackError('Error retrieving data.');}
}
else{context.callback(context.message);}
}
else if(context.callbackError){context.callbackError('Invalid response from server.');}
});};Messenger.prototype.setJSON=function(json){this.message=JSON.getObject(json);return(this.message);};function SetMessenger(){this.Messenger(arguments[0],arguments[1]);}
SetMessenger.inherit(Messenger);SetMessenger.prototype.setResponseHandler=function(){var context=this;return(function(response){if(response.length&&response.charAt(0)=='{'){context.message=JSON.getObject(response);context.buildIndexes();if(context.message.error>1&&context.callbackError){if(context.message.head.details){context.callbackError(context.message.head.details);}
else{context.callbackError('Error retrieving data.');}
}
else{context.callback(context.message);}
}
else if(context.callbackError){context.callbackError('Invalid response from server.');}
});};SetMessenger.prototype.buildIndexes=function(){var keys=this.message.head.set.hash.keys;if(keys&&keys.length){var index;var set=this.message.body;var nrecords=set.length;for(var ki in keys){index={};for(var i=0;i<nrecords;++i){index[set[i][keys[ki][1]]]=i;}
this.message.head.set.hash[keys[ki][0]]=index;}
}
var cs=this.message.head.set.columns;if(cs&&cs.length&&cs[0].key){var cmap={};for(var ci in cs){cmap[cs[ci].key]=ci;}
this.message.head.set.cmap=cmap;}
}
SetMessenger.prototype.setMessage=function(obj){this.message=obj;this.buildIndexes();};function Animation(target,style,dur,ini,fin){this.target=target;this.fps=20;this.frame_delay=Math.round(1000/this.fps);this.frame_total=Math.round(dur/1000)*this.fps;this.frame_index=0;this.is_playing=false;this.is_looping=false;this.interval=null;this.callback=null;this.debug=null;this.style=style;this.ini=ini;this.fin=fin;this.prepend='';this.append='px';this.calc=this.calcLength;this.delta=this.deltaLinear;switch(style){case 'opacity':this.append='';this.calc=this.calcFraction;break;case 'zIndex':this.append='';this.calc=this.calcInteger;break;case 'color':case 'backgroundColor':case 'borderColor':this.prepend='rgb(';this.append=')';this.calc=this.calcColor;break;}
}
Animation.prototype.setDelta=function(callback){this.delta=callback;};Animation.prototype.setCallback=function(callback){this.callback=callback;};Animation.prototype.setDebug=function(callback){this.debug=callback;};Animation.prototype.play=function(){if(!this.is_playing){if(this.frame_index>=(this.frame_total-1)){this.frame_index=0;}
this.interval=setInterval(this.setFrameHandler(),this.frame_delay
);this.is_playing=true;}
};Animation.prototype.stop=function(){clearInterval(this.interval);this.interval=null;this.is_playing=false;this.is_looping=false;if(this.callback){this.callback();}
};Animation.prototype.reset=function(){var c=null;if(this.callback){c=this.callback;this.callback=null;}
this.stop();this.frame_index=0;this.renderFrame(0);if(c){this.callback=c;this.callback();}
};Animation.prototype.loop=function(){this.is_looping=true;this.play();};Animation.prototype.deltaLinear=function(x){return(x);};Animation.prototype.deltaAcceleration=function(x){return(Math.pow(x,3));};Animation.prototype.deltaDeceleration=function(x){return(Math.pow((x-1),3)+1);};Animation.prototype.deltaAccelDecel=function(x){return((-Math.sin((x+0.5)*Math.PI)/2)+0.5);};Animation.prototype.calcLength=function(ini,fin,step){return(((fin-ini)*step)+ini);};Animation.prototype.calcFraction=function(ini,fin,step){return(((fin-ini)*step)+ini);};Animation.prototype.calcInteger=function(ini,fin,step){return(Math.round(((fin-ini)*step)+ini));};Animation.prototype.calcColor=function(ini,fin,step){var ri=ini>>16;var gi=(ini&0x00FF00)>>8;var bi=ini&0x0000FF;var rf=fin>>16;var gf=(fin&0x00FF00)>>8;var bf=fin&0x0000FF;var rn=Math.round(((rf-ri)*step)+ri);var gn=Math.round(((gf-gi)*step)+gi);var bn=Math.round(((bf-bi)*step)+bi);return(rn.toString()+','+gn.toString()+','+bn.toString());};Animation.prototype.renderFrame=function(frame){var d=this.delta(frame/this.frame_total);var v=this.calc(this.ini,this.fin,d);this.target.style[this.style]=this.prepend+v+this.append;if(this.style=='opacity'){this.target.style.filter="alpha(opacity='"+Math.round(v*100)+"')";}
if(this.debug){this.debug(frame,d,this.prepend+v+this.append);}
};Animation.prototype.setFrameHandler=function(){var ctx=this;return(function(){ctx.renderFrame(ctx.frame_index);if(ctx.frame_index<ctx.frame_total){++ctx.frame_index;}
else if(ctx.is_looping){ctx.frame_index=0;}
else{ctx.stop();}
});};function ImagePlayer(canvas){this.transDuration=2000;	this.transWait=8000;this.canvas=canvas;	this.id=canvas.id?canvas.id:'xipidx';	this.els={};	this.seq=null;	this.c={};	this.bp='';	this.l_state=true;	this.p_state=false;	this.index=0;	this.n_ims=0;this.sm=new SetMessenger();	this.s_int=null;}
ImagePlayer.prototype.requestSequence=function(source){this.sm.setSource(source);if(arguments[1]){this.sm.params=arguments[1];}
this.sm.send(this.setSequenceHandler());};ImagePlayer.prototype.loadSequence=function(json){this.setSequence(this.sm.setJSON(json));};ImagePlayer.prototype.setSequence=function(obj){this.seq=obj;this.c=obj.head.set.cmap;this.bp=obj.head.player.base_path;this.n_ims=obj.body.length;for(var i=0;i<this.n_ims;++i){if(!this.seq.body[i][this.c.uri]){this.seq.body[i][this.c.uri]='#';}
}
var p=this.seq.head.player;if(p.background){this.canvas.style.background=p.background;}
this.p_state=p.auto_play;this.buildCanvas();};ImagePlayer.prototype.play=function(){};ImagePlayer.prototype.pause=function(){};ImagePlayer.prototype.stop=function(){};ImagePlayer.prototype.next=function(){};ImagePlayer.prototype.prev=function(){};ImagePlayer.prototype.buildCanvas=function(){this.els.d=document.createElement('div');this.els.d.id=this.id+'_display';this.els.d.className='display';this.els.d.style.width=this.seq.head.player.width+'px';this.els.d.style.height=this.seq.head.player.height+'px';this.els.da=document.createElement('a');this.els.di=document.createElement('img');this.els.da.appendChild(this.els.di);this.els.d.appendChild(this.els.da);this.canvas.appendChild(this.els.d);this.els.t=document.createElement('div');this.els.t.id=this.id+'_trans';this.els.t.className='trans';this.els.t.style.width=this.seq.head.player.width+'px';this.els.t.style.height=this.seq.head.player.height+'px';this.els.ta=document.createElement('a');this.els.ti=document.createElement('img');this.els.ta.appendChild(this.els.ti);this.els.t.appendChild(this.els.ta);this.els.t.style.opacity=0;this.canvas.appendChild(this.els.t);this.displayImage(0);};ImagePlayer.prototype.displayImage=function(index){if(!this.l_state){this.els.ta.setAttribute('href',this.seq.body[this.index][this.c.uri]);this.els.ta.setAttribute('title',this.seq.body[this.index][this.c.title]);this.els.ti.setAttribute('alt',this.seq.body[this.index][this.c.title]);this.els.ti.setAttribute('src',this.bp+'/'+this.seq.body[this.index][this.c.source]);}
else{add_listener(this.els.di,'load',this.setTransImage());}
this.setOpacity(this.els.d,0);this.els.da.setAttribute('href',this.seq.body[index][this.c.uri]);this.els.da.setAttribute('title',this.seq.body[index][this.c.title]);this.els.di.setAttribute('alt',this.seq.body[index][this.c.title]);this.els.di.setAttribute('src',this.bp+'/'+this.seq.body[index][this.c.source]);if(!this.l_state){this.els.t.style.visibility='visible';this.setOpacity(this.els.t,1);}
else{this.l_state=false;}
this.index=index;};ImagePlayer.prototype.setTransImage=function(){var ctx=this;return(function(){var an_in=new Animation(ctx.els.d,'opacity',ctx.transDuration,0,1);an_in.setCallback(ctx.setFinishImage());var an_out=new Animation(ctx.els.t,'opacity',ctx.transDuration,1,0);an_in.play();an_out.play();});};ImagePlayer.prototype.setFinishImage=function(){var ctx=this;return(function(){if(ctx.p_state){var n=ctx.index>=(ctx.n_ims-1)?0:(ctx.index+1);ctx.s_int=setTimeout(function(){ctx.displayImage(n);},ctx.transWait
);}
});};ImagePlayer.prototype.setSequenceHandler=function(){var context=this;return(function(message){context.setSequence(message);});};ImagePlayer.prototype.setOpacity=function(elem,opac){elem.style.opacity=opac;elem.style.filter="alpha(opacity='"+Math.round(opac*100)+"')";};String.prototype.trim=function(){var str=this.replace(/^\s+/g,'');str=str.replace(/\s+$/g,'');return(str);}
function check_form(form_id){var frm=document.getElementById(form_id);if(!frm){return(true);}
var submit_button=frm.elements['submit'];var submit_text='';if(submit_button){submit_button.disabled=true;submit_text=submit_button.value;submit_button.value='Please Wait...';}
var req=frm.elements['required_fields'];var field_list=new Array();var failed=new Array();if(req&&req.value.length){if(req.value=='ALL'){for(var i in frm.elements){field_list.push(i);}
}
else{field_list=req.value.split(',');}
var elem=null;var test='';for(var i=0;i<field_list.length;++i){elem=frm.elements[field_list[i]];if(elem&&elem.length){test='';for(var j=0;j<elem.length;++j){if(elem[j].checked){test=elem[j].value;break;}
}
if(test.length==0){failed.push(field_list[i]);}
}
else if(elem&&elem.value){test=elem.value.trim();if(test.length==0){failed.push(field_list[i]);elem.className='error';}
}
else if(elem){failed.push(field_list[i]);elem.className='error';}
}
}
if(failed.length>0){alert('You must complete all required fields'
+' before submitting the form.');if(submit_button){submit_button.value=submit_text;submit_button.disabled=false;}
return(false);}
return(true);}
function start_search(frm){var index=frm.elements['stype'].selectedIndex;switch(frm.elements['stype'].options[index].value){case 'site':window.location='/?p=search&q='
+escape(frm.elements['q'].value);break;case 'company':window.location='/?p=comsearch&q='
+escape(frm.elements['q'].value);break;case 'web':var qargs={'sa':'Search','client':'pub-8822427480378252','forid':'1','ie':'ISO-8859-1','oe':'ISO-8859-1','safe':'active','cof':'GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;'
+'BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;'
+'GFNT:0000FF;GIMP:0000FF;LH:50;LW:246;'
+'L:http://rushmoreradio.net/media/rr_logo_google.png;'
+'S:http://rushmoreradio.com/;FORID:1','hl':'en'
};var q='';for(var elem in qargs){q+='&'+elem+'='+escape(qargs[elem]);}
window.location='http://www.google.com/custom?q='
+escape(frm.elements['q'].value)+q;break;}
return(false);}
function show_login_form(){Overlay.header='Member Login';Overlay.footer=null;Overlay.popup('<form action="public.php" method="post"'
+' class="shortform" id="members_auth">'
+'<p>Member Name<br />'
+'<input type="text" class="text" name="name" /></p>'
+'<p>Password<br />'
+'<input type="password" class="text" name="password" /></p>'
+'<p><input type="submit" value="Login" />'
+' &nbsp; <input type="button" value="Cancel"'
+' onclick="Overlay.closePopup();" />'
+'<input type="hidden" name="module" value="members" />'
+'<input type="hidden" name="element" value="auth" /></p>'
+'</form>',280,135
);frm=document.getElementById('members_auth');if(frm){frm.elements['name'].focus();}
return(false);}
var Util=new Object();Util.DOM={getDOMElement:function(variable){if(typeof(variable)=='string'){return(document.getElementById(variable));}
return(variable);},createQuick:function(tag,contents){var tmp=document.createElement(tag);if(arguments[2]){tmp.className=arguments[2];}
if(typeof(contents)=='object'){tmp.appendChild(contents);}
else{tmp.innerHTML=contents;}
return(tmp);}
};Util.URI={getQuery:function(uri){var matches=/\?([^#]+)#?/.exec(uri);if(matches&&matches[1]){return(matches[1]);}
return('');},getQueryParams:function(uri){var chunk=Util.URI.getQuery(uri);var query=new Object();var parts=new Array();var separator=arguments[1]?arguments[1]:'&';if(chunk.indexOf(separator)!=-1){var variables=chunk.split(separator);var nvars=variables.length;for(var i=0;i<nvars;++i){parts=variables[i].split('=');query[parts[0]]=parts[1];}
}
else{parts=chunk.split('=');query[parts[0]]=parts[1];}
return(query);},getFragment:function(uri){var matches=/#(.+)/.exec(uri);if(matches&&matches[1]){return(matches[1]);}
return('');},getFragmentQuery:function(uri){var frag=Util.URI.getFragment(uri);var query=new Object();var parts=new Array();var separator=arguments[1]?arguments[1]:';';if(frag.indexOf(separator)!=-1){var variables=frag.split(separator);var nvars=variables.length;for(var i=0;i<nvars;++i){parts=variables[i].split('=');query[parts[0]]=parts[1];}
}
else{parts=frag.split('=');query[parts[0]]=parts[1];}
return(query);}
};Util.Page={getWidth:function(){if(document.body.scrollWidth){return(document.body.scrollWidth);}
return(document.documentElement.scrollWidth||document.body.scrollWidth
);},getHeight:function(){var portal_height=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var body_height=document.body.offsetHeight;return(portal_height>body_height?portal_height:(body_height+10));},getXScroll:function(){return(window.pageXOffset||document.body.scrollLeft||document.documentElement.scrollLeft
);},getYScroll:function(){return(window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop
);},getPortWidth:function(){if(window.innerWidth){return(window.innerWidth-18);}
return(document.documentElement.clientWidth||document.body.clientWidth
);},getPortHeight:function(){var portal_height=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var body_height=document.body.offsetHeight;return(portal_height>body_height?portal_height:(body_height+10));}
};Util.Element={getLeft:function(elem){var dim=elem.offsetLeft;while(elem.offsetParent){dim+=elem.offsetParent.offsetLeft;elem=elem.offsetParent;}
return(dim);},getTop:function(elem){var dim=elem.offsetTop;while(elem.offsetParent){dim+=elem.offsetParent.offsetTop;elem=elem.offsetParent;}
return(dim);}
};Util.Browser={};Util.Browser.isIE=(navigator.userAgent.indexOf('MSIE')!=-1)?true:false;Util.Flash={insertElement:function(elem,src,w,h){var obj=null;if(Util.Browser.isIE&&false){obj=document.createElement('object');obj.setAttribute('type','application/x-shockwave-flash');obj.setAttribute('classid','clsid:D27CDB6E-AE6D-11cf-96B8-444553540000');obj.setAttribute('style','width:'+w+'px;height:'+h+'px;');var p=document.createElement('param');p.setAttribute('name','movie');p.setAttribute('value',src);obj.appendChild(p);p=document.createElement('param');p.setAttribute('name','allowScriptAccess');p.setAttribute('value','sameDomain');obj.appendChild(p);p=document.createElement('param');p.setAttribute('name','quality');p.setAttribute('value','high');obj.appendChild(p);p=document.createElement('param');p.setAttribute('name','wmode');p.setAttribute('value','transparent');obj.appendChild(p);p=document.createElement('param');p.setAttribute('name','bgcolor');p.setAttribute('value','#FFFFFF');obj.appendChild(p);}
else{obj=document.createElement('embed');obj.setAttribute('src',src);obj.setAttribute('style','width:'+w+'px;height:'+h+'px;');obj.setAttribute('wmode','transparent');obj.setAttribute('width',w);obj.setAttribute('height',h);obj.setAttribute('allowScriptAccess','sameDomain');obj.setAttribute('type','application/x-shockwave-flash');obj.setAttribute('pluginspage','http://www.macromedia.com/go/getflashplayer');}
if(arguments[4]){obj.id=arguments[4];if(arguments[5]){obj.className=arguments[5];}
}
insert_into=Util.DOM.getDOMElement(elem);insert_into.appendChild(obj);}
};var Overlay={header:null,footer:'<a href="#close"'
+' onclick="return(Overlay.closePopup());">Close</a>',yOffset:100,popup:function(content,w,h){var box=Overlay.createBox(w);if(arguments[3]){box.appendChild(Util.DOM.createQuick('div',arguments[3],'header')
);}
else if(Overlay.header!=null){box.appendChild(Util.DOM.createQuick('div',Overlay.header,'header')
);}
var media=document.createElement('div');media.className='primary';media.style.width=w+'px';media.style.height=h+'px';if(typeof(content)=='object'){media.appendChild(content);}
else{media.innerHTML=content;}
box.appendChild(media);if(arguments[4]){box.appendChild(Util.DOM.createQuick('div',arguments[4],'footer')
);}
else if(Overlay.footer!=null){box.appendChild(Util.DOM.createQuick('div',Overlay.footer,'footer')
);}
Overlay.addMask();document.body.appendChild(box);},closePopup:function(){document.body.removeChild(document.getElementById('popup_box'));document.body.removeChild(document.getElementById('popup_mask'));return(false);},addMask:function(){var mask=document.createElement('div');mask.id='popup_mask';mask.style.position='absolute';mask.style.left=0;mask.style.top=0;mask.style.width=Util.Page.getWidth()+'px';mask.style.height=Util.Page.getHeight()+'px';mask.style.zIndex=99;mask.onclick=Overlay.closePopup;mask.innerHTML='&nbsp;';document.body.appendChild(mask);},createBox:function(box_width){var box=document.createElement('div');box.id='popup_box';box.style.position='absolute';box.style.top=(Util.Page.getYScroll()+Overlay.yOffset)+'px';box.style.left=Math.floor((Util.Page.getWidth()-box_width)/2)+'px';box.style.width=box_width+'px';box.style.zIndex=100;return(box);}
};