
// BODY FUNCTIONS
//===========================
	function body_load(){
		
		// set up "all-access pass" motion
		accesspass = $("access_pass");
		if (accesspass!=null){
			accesspass.tweening = false;
			accesspass.mouseover = false;
			accesspass.tweendown = new Fx.Tween(accesspass,{duration:800,link:'chain',transition:Fx.Transitions.Bounce.easeOut});
			accesspass.tweenup = new Fx.Tween(accesspass,{duration:600,transition:Fx.Transitions.Circ.easeOut});
			accesspass.tweendown.addEvent('complete',function(){accesspass.tweening = false;});
			accesspass.tweenup.addEvent('complete',function(){accesspass.tweening = false;});
			}
			
		// set up "registration passes" motion
		regpass1 = $("pass_register_1");
		if (regpass1!=null){
			regpass1.tweening = false;
			regpass1.mouseover = false;
			regpass1.tweendown = new Fx.Tween(regpass1,{duration:1000,link:'chain',transition:Fx.Transitions.Bounce.easeOut});
			regpass1.tweenup = new Fx.Tween(regpass1,{duration:800,transition:Fx.Transitions.Circ.easeOut});
			regpass1.tweendown.addEvent('complete',function(){regpass1.tweening = false;});
			regpass1.tweenup.addEvent('complete',function(){regpass1.tweening = false;});
			
			if (drop_reg_1==true){
				reg_drop(regpass1);
				}
			else{
				regpass1.style.top = "-80px";	
				}
			}
		regpass2 = $("pass_register_2");
		if (regpass2!=null){
			regpass2.tweening = false;
			regpass2.mouseover = false;
			regpass2.tweendown = new Fx.Tween(regpass2,{duration:1000,link:'chain',transition:Fx.Transitions.Bounce.easeOut});
			regpass2.tweenup = new Fx.Tween(regpass2,{duration:800,transition:Fx.Transitions.Circ.easeOut});
			regpass2.tweendown.addEvent('complete',function(){regpass2.tweening = false;});
			regpass2.tweenup.addEvent('complete',function(){regpass2.tweening = false;});
			
			if (drop_reg_2==true){
				regpass2.style.top = "-80px";	
				}
			}
		
		// set up "login passes" motion
		logpass1 = $("pass_login_1");
		if (logpass1!=null){
			logpass1.tweening = false;
			logpass1.mouseover = false;
			logpass1.tweendown = new Fx.Tween(logpass1,{duration:1000,link:'chain',transition:Fx.Transitions.Bounce.easeOut});
			logpass1.tweenup = new Fx.Tween(logpass1,{duration:800,transition:Fx.Transitions.Circ.easeOut});
			logpass1.tweendown.addEvent('complete',function(){logpass1.tweening = false;});
			logpass1.tweenup.addEvent('complete',function(){logpass1.tweening = false;});
			
			if (drop_log==true){
				reg_drop(logpass1);
				}
			else{
				logpass1.style.top = "-80px";	
				}
			}
			
		// set up location-switcher
		locswitch = $("locationswitch");
		if (locswitch!=null){
			locswitch.tween = new Fx.Tween(locswitch,{duration:1000,link:'chain',transition:Fx.Transitions.Sine.easeOut});
			}
			
		// set up highslide
		mooslide();
		
		// campaign fade-in
		elements = $(document.body).getElements('div');
		for (i=0;i<elements.length;i++){
			element = $(elements[i]);
			if(element.hasClass('campaign_item')){
				element.tween = new Fx.Tween(element,{duration:1000,link:'chain',transition:Fx.Transitions.Sine.easeOut});
				element.tween.start('opacity',0,1);
				}
			}
		
		
		//setTimeout("run()",10);
		
		}
		
	function run(){
		
		setTimeout("run()",10);
		}

// "ALL-ACCESS PASS" FUNCTIONS
//===========================
	function access_drop(){
		accesspass = $("access_pass");
		accesspass.mouseover = true;
		if (accesspass.tweening==false){
			accesspass.tweening = true;
			accesspass.tweendown.start('top',-80);
			}
		}
	function access_rise(){
		accesspass = $("access_pass");
		accesspass.mouseover = false;
		if (accesspass.tweening==false){
			accesspass.tweening = true;
			accesspass.tweenup.start('top',-310);
			}
		}
		
// "REGISTRATION PASS" FUNCTIONS
//===========================
	function reg_drop(el){
		regpass = $(el);
		regpass.mouseover = true;
		if (regpass.tweening==false){
			regpass.tweening = true;
			regpass.tweendown.start('top',-75);
			}
		}
	function reg_rise(el){
		regpass = $(el);
		regpass.mouseover = false;
		if (regpass.tweening==false){
			regpass.tweening = true;
			regpass.tweenup.start('top',-725);
			}
		}
		
// TONEROOM RATING FUNCTIONS
//===========================
	function rate_clear(toneid,def){
		bar = document.getElementById("rating_bar_"+toneid);
		bar.style.width = def+"%";
		}
	function rate_hover(toneid,rating){
		bar = document.getElementById("rating_bar_"+toneid);
		bar.style.width = (rating*20)+"%";
		}
		
// LOCATION-SWITCHER FUNCTIONS
//===========================
	function locationswitch_show(snap){
		switchbox = $("locationswitch");
		snapx = snap.offsetLeft;
		snapy = snap.offsetTop;
		switchbox.style.display = "block";
		switchbox.style.left = snapx+"px";
		switchbox.style.top = (snapy-switchbox.offsetHeight)+"px";
		
		switchbox.tween.start('opacity',0,1);
		
		}

// Mootools / highslide integration
//===========================
var hsGraphics = {
	outlineType: 'rounded-white',
	dimmingOpacity: 0.4,
	align: 'center'
};

function mooslide(){
		elements = $(document.body).getElements('a');
		for (i=0;i<elements.length;i++){
			element = $(elements[i]);
			if(element.hasClass('hs_img')){
				element.onclick= function(){
					return hs.expand(this,hsGraphics);
					}
				}
			else if(element.hasClass('hs_swf')){
				el_size = element.target;
				el_size = el_size.split("x");
				element.el_width = el_size[0];
				element.el_height = el_size[1];
				if(element.rel){
								
				element.onclick= function(){
					return hs.htmlExpand(this,{outlineType: 'rounded-white',dimmingOpacity: 0.4,objectType:'swf',objectWidth:this.el_width,objectHeight:this.el_height,base:this.rel,align:'center'});
					}
				}
				
				
				else{
					
					element.onclick= function(){
					return hs.htmlExpand(this,{outlineType: 'rounded-white',dimmingOpacity: 0.4,objectType:'swf',objectWidth:this.el_width,objectHeight:this.el_height,align:'center'});
					}
					
					}
				
				
				
				}
			}
		}

// Toneroom Reporting
//===========================
function report_tone(tone){
	var report_reason = prompt("Please enter a short but descriptive reason why a VOX forum moderator needs to review this tone:","");
	if (report_reason!="" && report_reason.length>9){
		alert("Thank you for the report. A moderator has been notified.");
		document.getElementById("formReportToneValue").value = report_reason;
		document.getElementById("formReportToneId").value = tone;
		document.getElementById("formReportTone").submit();
		}
	else{
		alert("Report cancelled, incomplete description or description too short.");
		}
	}