	/****************************************************	* ROAD RUNNER RECORDS	* application.js	*	* Functions found in this file utilize the	* Mootools JS library. http://www.mootools.net	* Documentation found at http://docs.mootools.net	*****************************************************/		var loadOnce = true; // To counteract the loading of AJAX tabs multiple times	var safeFixedHeight = 0; // To save the height of object for tabbed content		/****************************************************	*	TABS	* To generate the different tabbed modules	****************************************************/	function makeTabs(moduleName){		var accordion = new Accordion(moduleName + ' ul.tabs li', moduleName + ' .module-body', {			opacity: true,			onActive: function(toggler, element){				toggler.addClass('current');			},			onBackground: function(toggler, element){				toggler.removeClass('current');				if(moduleName == "#main_module" && loadOnce){						loadContent(element.id);				}			}		})	}		/****************************************************	*	SUB TAGS	* To generate the different sub tabbed modules	****************************************************/	function makeSubTabs(moduleName){		var accordion = new Accordion(moduleName + ' ul.sub_tabs li', moduleName + ' .module-interior', {			opacity: true,			onActive: function(toggler, element){				toggler.addClass('current');			},			onBackground: function(toggler, element){				toggler.removeClass('current');			}		})	}		/****************************************************	*	MULTIBOX (MODAL OVERLAYS)	* Generates the different modal overlays	****************************************************/	function makeMultibox(itemClass){		var modalBox = new MultiBox(itemClass, {			descClassName:'multiBoxDesc',			showNumbers: true		});	}		/****************************************************	*	SIDE SCROLLER	* Creates the side scrolling affect of certain modules	****************************************************/	function makeSideScroller(moduleName){		var i=0;		var scrollBox =  moduleName + "_scroller";		var numImages = $ES('img',scrollBox).length;		var scroll = new Fx.Scroll(scrollBox, {			wait: false,			duration: 1000,			transition: Fx.Transitions.Quad.easeInOut		});						$(moduleName + '_nextButton').addEvent('click', function(event) {			event = new Event(event).stop();			if(i != numImages - 1){				scroll.toElement(moduleName + '_img' + (i+1));				i++;			}else{				scroll.toElement(moduleName + '_img' + (0));				i = 0;			}		});		$(moduleName + '_prevButton').addEvent('click', function(event) {			event = new Event(event).stop();			if (i != 0){			scroll.toElement(moduleName + '_img' + (i-1));			i--;			}else{				scroll.toElement(moduleName + '_img' + (numImages - 1));				i = numImages - 1;			}		});	}		/****************************************************	* SCROLL TO COMMENT FORM	* Gives ability to scroll to comment form of comments	****************************************************/	function showCommentForm(formID){		var commentForm = 'add_comment_area-' + formID;		$(commentForm).setStyle('display', 'block');		var scroll = new Fx.Scroll(window, {			duration: 500		});				scroll.toElement(commentForm);	}		/****************************************************	*	AJAX LOADER	* Loads content from other sources	****************************************************/	function loadContent(moduleName){						/* Where will the files be pulled from? */			/* LOCAL SERVER */			//var url = "http://localhost/~babymac/irm/roadrunnerrecords.com/artist_page/ajax_content/" + moduleName + ".html";			//var url = "http://192.168.1.100/~babymac/irm/roadrunnerrecords.com/artist_page/ajax_content/" + moduleName + ".html";						/* LIVE SERVER */			var url = "http://dev.indierockmedia.com/roadrunnerrecords.com/artist_page/ajax_content/" + moduleName + ".html";						new Ajax(url, {				method: 'get',				onRequest: function(){					//$('waiting_bar').setStyle('display', 'inline');				},				onComplete: function(){					//$('waiting_bar').setStyle('display', 'none');					if(loadOnce){						makeMultibox("gallery_mb");						loadOnce = false;					}				},				update: $(moduleName)			}).request();	}		/****************************************************	*	CALCULATE HEIGHT	* Calculates height of items to show scrollbars	****************************************************/	function calculateHeight(contentArray){		var prevHeight = 0;		for (var i=0, len=contentArray.length; i<len; ++i ){			prevHeight = $(contentArray[i]).getSize().size.y;			if(prevHeight > safeFixedHeight){				safeFixedHeight = $(contentArray[i]).getSize().size.y + 20;			}			$(contentArray[i]).setStyle('height', safeFixedHeight);		}	}		/****************************************************	*	TOGGLE SIGNUP FORM	* Shows/hides signup form	****************************************************/	function showSignupForm(){		var signup_form = $("signup_form");		signup_form.style.overflow = "hidden";		var fx = new Fx.Tween(signup_form, {duration: 1000});		if(signup_form.getStyle('display') == 'none'){			signup_form.style.height = "0px";			signup_form.setStyle('display', 'block');			//signup_form.effect("height",{duration: 1000}).start(signup_form.scrollHeight);\			fx.start("height", "0px", signup_form.scrollHeight);		}else{			//signup_form.effect("height",{duration: 1000}).start(0).addEvent('onComplete', function() {			fx.start("height", signup_form.scrollHeight, "0px").addEvent('onComplete', function() {				signup_form.setStyle('display', 'none');				});			//signup_form.setStyle('display', 'none');		}	}		/****************************************************	*	AJAX LOADED CONTENT HACKS	****************************************************/	/****************************************************	*	BIO SHOW/HIDE	* Show/hide the bio tabs	****************************************************/	function showHideBio(showWhat, hideWhat){			document.getElementById(showWhat + '_bio').style.display = 'block';			document.getElementById(hideWhat + '_bio').style.display = 'none';			document.getElementById(showWhat + '_link').className='current';			document.getElementById(hideWhat + '_link').className='';  }	/****************************************************	*	GENERIC SHOW/HIDE	* Show/hide other items	****************************************************/	function showHide(showWhat, hideWhat){		for ( var i=0, len=hideWhat.length; i<len; ++i ){			document.getElementById(hideWhat[i] + '_content').style.display = 'none';		 	document.getElementById(hideWhat[i] + '_link').className='';		}				document.getElementById(showWhat + '_content').style.display = 'block';		document.getElementById(showWhat + '_link').className='current';	}		/****************************************************	*	COMMENTS SHOW/HIDE	* Show/hide comments on news items	****************************************************/	function showHideComments(theID, scrollWhat){		var comments_area = "comments_area-" + theID;		var comment_form = "comment_form-" + theID;		var news_entry = "news_entry-" + theID;		var scroll = new Fx.Scroll(scrollWhat, {	  	wait: false,	  	duration: 1000,	  	transition: Fx.Transitions.Quad.easeInOut	  });	  $(comments_area).getElements('a[class=add_comment]').addEvent('click', function(event) {	  	event = new Event(event).stop();	  	scroll.toElement(comment_form);	  });		$(comments_area).getElements('a[class=close_it]').addEvent('click', function(event) {	  	event = new Event(event).stop();	  	scroll.toElement(news_entry);	  	document.getElementById("comments_area-" + theID).style.display = "none";	  });		if (document.getElementById(comments_area).style.display == "none"){			document.getElementById(comments_area).style.display = "block";		}else{			document.getElementById("comments_area-" + theID).style.display = "none";		}	}			/*-----------------------------------------------------	APPLICATION JAVASCRIPT		Website: http://www.roadrunnerrecords.com	-----------------------------------------------------*/		function loadContent(element, containerID){		var contentURL = element.href; // URL that is requested		var serverBase = window.document.referrer; // Server base path			var spinnerHolder = new Element('div', { // Holder for the spinner			'id': 'spinnerHolder',			'class': 'spinnerHolder'		});		var spinner = new Element('img', { // The spinner			'src': 'images/elements/misc/waiting.gif',			'class': 'spinner'		});				var req = new Request.HTML({ // Setup the request object				url: serverBase + contentURL,				onRequest: function(){					spinnerHolder.inject(containerID, 'top'); // Inject the spinner holder					spinner.inject(spinnerHolder); // Inject the spinner in the holder				},				onSuccess: function(html) {					$(containerID).set('text', ''); // Clear out the current content					$(containerID).adopt(html); // Insert the new content					new MooKissToggler(); // For all the expanders					spinnerHolder.destroy(); // Remove the spinner bar				},				onFailure: function() {					spinnerHolder.destroy(); // Remove the spinner bar					$(containerID).set('text', 'The request failed.'); // Display something if it failed				}			});			req.send(); // Send it out and bring it back		}		function initializeItems(){		// For the login form slide in/out		var loginSlide = new Fx.Slide('login_form');		loginSlide.hide();			}		function toggleLoginForm(){		var loginSlide = new Fx.Slide('login_form');		loginSlide.toggle();	}