// JavaScript Documentfunction MM_openBrWindow(theURL,winName,features) { //v2.0  window.open(theURL,winName,features);}// email popup windowfunction sendEmail(email) {	window.open('https://www.fancentric.com/profile/index.php?type=subscribe&lists=142,143&manage_email='+email+'','Signup','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=550');}// preload menufunction menu_images() {MM_preloadImages('/images/menu_discography_over.gif','/images/menu_home_over.gif','/images/menu_news_over.gif','/images/menu_tour_over.gif','/images/menu_photos_over.gif','/images/member_community_over.gif','/images/menu_mailinglist_over.gif','/images/menu_joinsite_over.gif');}function MM_swapImgRestore() { //v3.0  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;}function MM_preloadImages() { //v3.0  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}}function MM_swapImage() { //v3.0  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}}var agt=navigator.userAgent.toLowerCase(); function sz(t) {a = t.value.split('\n');b=1;for (x=0;x < a.length; x++) { if (a[x].length >= t.cols) b+= Math.floor(a[x].length/t.cols); }b+= a.length;if (b > t.rows && agt.indexOf('opera') == -1 && t.rows < 50) t.rows = b;if(t.rows > 50) t.rows = 50;}function closeMessage() {	document.getElementById('message_box').innerHTML = "";}function emoticon(smiley, form_name, field_name) {					 	document[form_name][field_name].value+=smiley;	 					 }function MM_findObj(n, d) { //v4.01  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);  if(!x && d.getElementById) x=d.getElementById(n); return x;}function MM_validateForm() { //v4.0  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);    if (val) { nm=val.name; if ((val=val.value)!="") {      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';      } else if (test!='R') { num = parseFloat(val);        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');          min=test.substring(8,p); max=test.substring(p+1);          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }  } if (errors) alert('The following error(s) occurred:\n'+errors);  document.MM_returnValue = (errors == '');}function doMail(user,domain) {	locationstring = "mailto:" + user + "@" + domain;	window.location = locationstring;}/*   Behaviour v1.1 by Ben Nolan, June 2005. Based largely on the work   of Simon Willison (see comments by Simon below).   Description:   	   	Uses css selectors to apply javascript behaviours to enable   	unobtrusive javascript in html documents.   	   Usage:      	var myrules = {		'b.someclass' : function(element){			element.onclick = function(){				alert(this.innerHTML);			}		},		'#someid u' : function(element){			element.onmouseover = function(){				this.innerHTML = "BLAH!";			}		}	};		Behaviour.register(myrules);		// Call Behaviour.apply() to re-apply the rules (if you	// update the dom, etc).   License:      	This file is entirely BSD licensed.   	   More information:   	   	http://ripcord.co.nz/behaviour/   */   var Behaviour = {	list : new Array,		register : function(sheet){		Behaviour.list.push(sheet);	},		start : function(){		Behaviour.addLoadEvent(function(){			Behaviour.apply();		});	},		apply : function(){		for (h=0;sheet=Behaviour.list[h];h++){			for (selector in sheet){				list = document.getElementsBySelector(selector);								if (!list){					continue;				}				for (i=0;element=list[i];i++){					sheet[selector](element);				}			}		}	},		addLoadEvent : function(func){		var oldonload = window.onload;				if (typeof window.onload != 'function') {			window.onload = func;		} else {			window.onload = function() {				oldonload();				func();			}		}	}}Behaviour.start();/*   The following code is Copyright (C) Simon Willison 2004.   document.getElementsBySelector(selector)   - returns an array of element objects from the current document     matching the CSS selector. Selectors can contain element names,      class names and ids and can be nested. For example:            elements = document.getElementsBySelect('div#main p a.external')          Will return an array of all 'a' elements with 'external' in their      class attribute that are contained inside 'p' elements that are      contained inside the 'div' element which has id="main"   New in version 0.4: Support for CSS2 and CSS3 attribute selectors:   See http://www.w3.org/TR/css3-selectors/#attribute-selectors   Version 0.4 - Simon Willison, March 25th 2003   -- Works in Phoenix 0.5, Mozilla 1.3, Opera 7, Internet Explorer 6, Internet Explorer 5 on Windows   -- Opera 7 fails */function getAllChildren(e) {  // Returns all children of element. Workaround required for IE5/Windows. Ugh.  return e.all ? e.all : e.getElementsByTagName('*');}document.getElementsBySelector = function(selector) {  // Attempt to fail gracefully in lesser browsers  if (!document.getElementsByTagName) {    return new Array();  }  // Split selector in to tokens  var tokens = selector.split(' ');  var currentContext = new Array(document);  for (var i = 0; i < tokens.length; i++) {    token = tokens[i].replace(/^\s+/,'').replace(/\s+$/,'');;    if (token.indexOf('#') > -1) {      // Token is an ID selector      var bits = token.split('#');      var tagName = bits[0];      var id = bits[1];      var element = document.getElementById(id);      if (tagName && element.nodeName.toLowerCase() != tagName) {        // tag with that ID not found, return false        return new Array();      }      // Set currentContext to contain just this element      currentContext = new Array(element);      continue; // Skip to next token    }    if (token.indexOf('.') > -1) {      // Token contains a class selector      var bits = token.split('.');      var tagName = bits[0];      var className = bits[1];      if (!tagName) {        tagName = '*';      }      // Get elements matching tag, filter them for class selector      var found = new Array;      var foundCount = 0;      for (var h = 0; h < currentContext.length; h++) {        var elements;        if (tagName == '*') {            elements = getAllChildren(currentContext[h]);        } else {            elements = currentContext[h].getElementsByTagName(tagName);        }        for (var j = 0; j < elements.length; j++) {          found[foundCount++] = elements[j];        }      }      currentContext = new Array;      var currentContextIndex = 0;      for (var k = 0; k < found.length; k++) {        if (found[k].className && found[k].className.match(new RegExp('\\b'+className+'\\b'))) {          currentContext[currentContextIndex++] = found[k];        }      }      continue; // Skip to next token    }    // Code to deal with attribute selectors    if (token.match(/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/)) {      var tagName = RegExp.$1;      var attrName = RegExp.$2;      var attrOperator = RegExp.$3;      var attrValue = RegExp.$4;      if (!tagName) {        tagName = '*';      }      // Grab all of the tagName elements within current context      var found = new Array;      var foundCount = 0;      for (var h = 0; h < currentContext.length; h++) {        var elements;        if (tagName == '*') {            elements = getAllChildren(currentContext[h]);        } else {            elements = currentContext[h].getElementsByTagName(tagName);        }        for (var j = 0; j < elements.length; j++) {          found[foundCount++] = elements[j];        }      }      currentContext = new Array;      var currentContextIndex = 0;      var checkFunction; // This function will be used to filter the elements      switch (attrOperator) {        case '=': // Equality          checkFunction = function(e) { return (e.getAttribute(attrName) == attrValue); };          break;        case '~': // Match one of space seperated words           checkFunction = function(e) { return (e.getAttribute(attrName).match(new RegExp('\\b'+attrValue+'\\b'))); };          break;        case '|': // Match start with value followed by optional hyphen          checkFunction = function(e) { return (e.getAttribute(attrName).match(new RegExp('^'+attrValue+'-?'))); };          break;        case '^': // Match starts with value          checkFunction = function(e) { return (e.getAttribute(attrName).indexOf(attrValue) == 0); };          break;        case '$': // Match ends with value - fails with "Warning" in Opera 7          checkFunction = function(e) { return (e.getAttribute(attrName).lastIndexOf(attrValue) == e.getAttribute(attrName).length - attrValue.length); };          break;        case '*': // Match ends with value          checkFunction = function(e) { return (e.getAttribute(attrName).indexOf(attrValue) > -1); };          break;        default :          // Just test for existence of attribute          checkFunction = function(e) { return e.getAttribute(attrName); };      }      currentContext = new Array;      var currentContextIndex = 0;      for (var k = 0; k < found.length; k++) {        if (checkFunction(found[k])) {          currentContext[currentContextIndex++] = found[k];        }      }      // alert('Attribute Selector: '+tagName+' '+attrName+' '+attrOperator+' '+attrValue);      continue; // Skip to next token    }        if (!currentContext[0]){    	return;    }        // If we get here, token is JUST an element (not a class or ID selector)    tagName = token;    var found = new Array;    var foundCount = 0;    for (var h = 0; h < currentContext.length; h++) {      var elements = currentContext[h].getElementsByTagName(tagName);      for (var j = 0; j < elements.length; j++) {        found[foundCount++] = elements[j];      }    }    currentContext = found;  }  return currentContext;}/* That revolting regular expression explained /^(\w+)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/  \---/  \---/\-------------/    \-------/    |      |         |               |    |      |         |           The value    |      |    ~,|,^,$,* or =    |   Attribute    Tag*//*Handles actions and requests for rating bars.	--------------------------------------------------------- ryan masuga, masugadesign.comryan@masugadesign.com --------------------------------------------------------- */var xmlhttp	/*@cc_on @*/	/*@if (@_jscript_version >= 5)	  try {	  xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")	 } catch (e) {	  try {	    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")	  } catch (E) {	   xmlhttp=false	  }	 }	@else	 xmlhttp=false	@end @*/	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {	 try {	  xmlhttp = new XMLHttpRequest();	 } catch (e) {	  xmlhttp=false	 }	}	function myXMLHttpRequest() {	  var xmlhttplocal;	  try {	    xmlhttplocal= new ActiveXObject("Msxml2.XMLHTTP")	 } catch (e) {	  try {	    xmlhttplocal= new ActiveXObject("Microsoft.XMLHTTP")	  } catch (E) {	    xmlhttplocal=false;	  }	 }	if (!xmlhttplocal && typeof XMLHttpRequest!='undefined') {	 try {	  var xmlhttplocal = new XMLHttpRequest();	 } catch (e) {	  var xmlhttplocal=false;	  alert('couldn\'t create xmlhttp object');	 }	}	return(xmlhttplocal);}function sndReq(vote,id_num,ip_num,units) {		var theUL = document.getElementById('unit_ul'+id_num); // the UL		// switch UL with a loading div	theUL.innerHTML = '<div class="loading"></div>';	    xmlhttp.open('get', '/ajax/rpc.php?j='+vote+'&q='+id_num+'&t='+ip_num+'&c='+units);    xmlhttp.onreadystatechange = handleResponse;    xmlhttp.send(null);	}function handleResponse() {  if(xmlhttp.readyState == 4){		if (xmlhttp.status == 200){       	        var response = xmlhttp.responseText;        var update = new Array();        if(response.indexOf('|') != -1) {            update = response.split('|');            changeText(trim(update[0]), update[1]);        }		}    }}function changeText( div2show, text ) {    // Detect Browser    var IE = (document.all) ? 1 : 0;    var DOM = 0;     if (parseInt(navigator.appVersion) >=5) {DOM=1};    // Grab the content from the requested "div" and show it in the "container"    if (DOM) {        var viewer = document.getElementById(div2show);		        viewer.innerHTML = text;		    }  else if(IE) {        document.all[div2show].innerHTML = text;    }}/* =============================================================== */var ratingAction = {		'a.rater' : function(element){			element.onclick = function(){			var parameterString = this.href.replace(/.*\?(.*)/, "$1"); // onclick="sndReq('j=1&q=2&t=127.0.0.1&c=5');						var parameterTokens = parameterString.split("&"); // onclick="sndReq('j=1,q=2,t=127.0.0.1,c=5');			var parameterList = new Array();			for (j = 0; j < parameterTokens.length; j++) {				var parameterName = parameterTokens[j].replace(/(.*)=.*/, "$1"); // j				var parameterValue = parameterTokens[j].replace(/.*=(.*)/, "$1"); // 1				parameterList[parameterName] = parameterValue;			}			var theratingID = parameterList['q'];			var theVote = parameterList['j'];			var theuserIP = parameterList['t'];			var theunits = parameterList['c'];						//for testing	alert('sndReq('+theVote+','+theratingID+','+theuserIP+','+theunits+')'); return false;			sndReq(theVote,theratingID,theuserIP,theunits); return false;					}		}			};Behaviour.register(ratingAction);function trim(str) {    return str.replace(/^\s+|\s+$/g, '') ;}/* status system */function sndAjaxReq(thetype,thediv,thevar1,thevar2,thevar3,thevar4,thevar5,thevar6) {	var theDiv = document.getElementById(thediv); // the Div		// switch UL with a loading div	theDiv.innerHTML = '<div class="loading"></div>';	    xmlhttp.open('get', '/ajax/ajax_call.php?t='+thetype+'&dv='+thediv+'&v1='+thevar1+'&v2='+thevar2+'&v3='+thevar3+'&v4='+thevar4+'&v5='+thevar5+'&v6='+thevar6);    xmlhttp.onreadystatechange = handleResponse;    xmlhttp.send(null);	}// setstatus_cancel = false;	function showSingleEditor(divShow, divEdit, formInput) {		var pDiv = document.getElementById(divShow);	var sDiv = document.getElementById(divEdit);		pDiv.style.display = 'none';	sDiv.style.display = 'block';			document.getElementById(formInput).focus();	document.getElementById(formInput).select();	}function hideSingleEditor(divShow, divEdit) {		var pDiv = document.getElementById(divShow);	var sDiv = document.getElementById(divEdit);		pDiv.style.display = 'block';	sDiv.style.display = 'none';	}function updateSingle(divShow,divEdit,thetype,thevar1,thevar2,thevar3) {			if(status_cancel == true) {		status_cancel = false;		} else {		sndAjaxReq(thetype,divShow,thevar1,thevar2,thevar3);		var pDiv = document.getElementById(divShow);	var sDiv = document.getElementById(divEdit);		pDiv.style.display = 'block';	sDiv.style.display = 'none';			}}/* toggle system */var global=0;var flag=0;function checkAll(formId, cName, check ) {if(check==1) { for (i=0,n=formId.elements.length;i<n;i++)  if (formId.elements[i].className.indexOf(cName) !=-1) formId.elements[i].checked = true; document.formId.checkall.checked=true; }  if(check==0) { for (i=0,n=formId.elements.length;i<n;i++)  if (formId.elements[i].className.indexOf(cName) !=-1) formId.elements[i].checked = false; document.formId.checkall.checked=false; }  }  function toggle(the_form) {if (global==0)global=1;else global=0;checkAll(document.getElementById(the_form), 'filecheck', global);}function selectOne(formId, boxNum) {    	formId.elements[boxNum].checked = true;		return confirm('checking number ' + boxNum);}function aToggle(the_form) {	checkStatus(document.getElementById(the_form), 'filecheck');if(flag==0){document.getElementById(the_form).checkall.checked=false;}else{document.getElementById(the_form).checkall.checked=true;}}/* comment system */function deleteComment(comment_id, myform) {		document[myform].hiddenType.value = 'deletecomment';	document[myform].singleID.value = comment_id;	submitIt(myform);	}function deleteCommentUser(comment_id, myform) {		document[myform].hiddenType.value = 'deletecommentuser';	document[myform].singleID.value = comment_id;	submitIt(myform);	}function deletePhoto(photo_id, myform) {		document[myform].hiddenType.value = 'deletephoto';	document[myform].singleID.value = photo_id;	submitIt(myform);	}function editPhoto(photo_id, myform) {		if(document[myform].title.value=="") {				alert("You must enter a title.");		stop;	}			document[myform].hiddenType.value = 'updatephoto';	document[myform].hiddenVar.value = document[myform].title.value;	document[myform].singleID.value = photo_id;			submitIt(myform);	}function editComment(comment_id, iteration, myform) {		if(document[myform]['comment_title'+iteration].value=="" || document[myform]['comment_body'+iteration].value=="") {				alert("You must enter a title and body.");		stop;	}			document[myform].hiddenType.value = 'updatecomment';		document[myform].hiddenVar.value = document[myform]['comment_title'+iteration].value;	document[myform].hiddenVar2.value = document[myform]['comment_body'+iteration].value;	document[myform].hiddenVar3.value = document[myform]['comment_extra'+iteration].value;	document[myform].singleID.value = comment_id;			submitIt(myform);	}function submitIt(myform) {	document[myform].submit();}function staticRating(rating) {	document.comment_form.comment_rating.value = rating;	alert(rating);		}function addToFriends(friend1, friend2, myform) {		document[myform].hiddenType.value = 'addtofriends';	document[myform].hiddenVar.value = friend1;	document[myform].hiddenVar2.value = friend2;		submitIt(myform);	}function deny_friend_request(request_id, myform) {		document[myform].hiddenType.value = 'denyfriendrequest';	document[myform].singleID.value = request_id;		submitIt(myform);	}function approve_friend_request(request_id, myform) {		document[myform].hiddenType.value = 'approvefriendrequest';	document[myform].singleID.value = request_id;		submitIt(myform);	}function approve_all_friends(myform) {		document[myform].hiddenType.value = 'approveallfriends';	submitIt(myform);	}function delete_friend(request_id, myform) {		var agree = confirm('Are you sure you want to remove this friend?');	// stop going through function if they click cancel	if(!agree) {		stop;	}		document[myform].singleID.value = request_id;	document[myform].hiddenType.value = 'deletefriend';	submitIt(myform);}// This function returns the appropriate reference, // depending on the browser.function getFlexApp(appName) {  if (navigator.appName.indexOf ("Microsoft") !=-1) {    return window[appName];  } else {    return document[appName];  }}function stopPlayer() {		//document.getElementById('audioplayer').pauseIt();	  	getFlexApp('audioplayer').pauseIt();}