function trackClick(url,name) {

	if ( typeof(dcsMultiTrack) != 'undefined' )

	{

		dcsMultiTrack('DCS.dcsuri',url,'WT.ti',name);

	}

}



function setCookie(name,value,expire,path){

	document.cookie = name + "=" + escape(value) + ((expire == null) ? "" : ("; expires=" + expire.toGMTString())) + ((path) ? "; path=" + path : "");

}



function getCookie(name){

	var search = name + "=";

	if (document.cookie.length > 0){

		offset = document.cookie.indexOf(search); 

		if (offset != -1){

			offset += search.length; 

			end = document.cookie.indexOf(";", offset); 

			if (end == -1)

				end = document.cookie.length;



			return unescape(document.cookie.substring(offset, end));

		} 

	}

}



function killCookie(name,path){

	theValue = getCookie(name);

	if (theValue)

		document.cookie = name + '=' + theValue + '; expires=Fri, 13-Apr-1970 00:00:00 GMT' + ((path) ? '; path=' + path : '');

}



function filter(filterParam){

	document.location.href = filterParam;

}



function resort(cookieName, sortOrder, reloadUrl){

	setCookie(cookieName, sortOrder, null, "/");

	document.location.href = reloadUrl;

}



function setlist(eventID){

	var chasm = screen.availWidth;

	var mount = screen.availHeight;



	var w = 500;

	var h = 400;



	setlistsWindowHandle = null;

	setlistsWindowHandle = window.open('/setlists.aspx?eid=' + eventID,'SetList','resizable,width=' + w + ',height=' + h + ',left=' + ((chasm - w - 10) * .5) + ',top=' + ((mount - h - 30) * .5) + ',scrollbars=yes');

	if (setlistsWindowHandle.blur) setlistsWindowHandle.focus();

}



function lyrics(productID, trackID){

	var chasm = screen.availWidth;

	var mount = screen.availHeight;



	var w = 500;

	var h = 400;



	lyricsWindowHandle = null;

	lyricsWindowHandle = window.open('/lyrics.aspx?pid=' + productID + '&tid=' + trackID,'Lyrics','resizable,width=' + w + ',height=' + h + ',left=' + ((chasm - w - 10) * .5) + ',top=' + ((mount - h - 30) * .5) + ',scrollbars=yes');

	if (lyricsWindowHandle.blur) lyricsWindowHandle.focus();

}



function gallery(galleryID, photoID, folderID){

	var chasm = screen.availWidth;

	var mount = screen.availHeight;



	var w = 550;

	var h = 550;



	galleryWindowHandle = null;

	galleryWindowHandle = window.open('/photos.aspx?gid=' + galleryID + '&pid=' + photoID + '&fid=' + folderID,'Gallery','resizable,width=' + w + ',height=' + h + ',left=' + ((chasm - w - 10) * .5) + ',top=' + ((mount - h - 30) * .5) + ',scrollbars=yes');

	if (galleryWindowHandle.blur) galleryWindowHandle.focus();

}



function paramaterFrom(param,argument)

{

	argument = '=' + argument + '&';

	if (argument.indexOf(param) != -1)

	{

		locStart = argument.indexOf(param) + param.length + 1;

		locEnd = argument.indexOf('&',locStart);

		if (locEnd < locStart)

			locEnd = argument.length;



		return argument.substring(locStart,locEnd);

	}

	else

		return null;

}



function replaceString(fullS,oldS,newS){

	for (var i=0; i < fullS.length; i++){

		if (fullS.substring(i,i + oldS.length) == oldS)

			fullS = fullS.substring(0,i) + newS + fullS.substring(i + oldS.length,fullS.length);

	}

	return fullS;

}



function unPackUrl(url) {

	return replaceString(replaceString(replaceString(replaceString(url,"!","?"),"^","&"),"|","="),"$","/");

}