﻿// JScript File
<!--
var ns4 = (document.layers) ? true : false;
var ie4 = (document.all && !document.getElementById) ? true : false;
var ie5 = (document.all && document.getElementById) ? true : false;
var ns6 = (!document.all && document.getElementById) ? true : false;
// copyright 1999 Idocs, Inc. http://www.idocs.com
// Distribute this script freely but keep this notice in place
function numbersonly(myfield, e, dec)
{
var key;
var keychar;

if (window.event)
   key = window.event.keyCode;
else if (e)
   key = e.which;
else
   return true;
keychar = String.fromCharCode(key);

// control keys
if ((key==null) || (key==0) || (key==8) || 
    (key==9) || (key==13) || (key==27) )
   return true;

// numbers
else if ((("0123456789.").indexOf(keychar) > -1))
   return true;
else
   return false;
}
function datesonly(myfield, e, dec)
{
var key;
var keychar;

if (window.event)
   key = window.event.keyCode;
else if (e)
   key = e.which;
else
   return true;
keychar = String.fromCharCode(key);

// control keys
if ((key==null) || (key==0) || (key==8) || 
    (key==9) || (key==13) || (key==27) )
   return true;

// numbers
else if ((("0123456789/").indexOf(keychar) > -1))
   return true;

else
   return false;
}
function FreeTrialMsg()
{
    var ans = confirm('You are currently signed up for the \nFREE TRIAL VERSION of AlasOnline.\n\n' +
    'Click "OK" to active your account \nnow and take full advantage of all \nAtlasOnline has to offer!' +
    '\n\nClick "Cancel" to go to AtlasOnline.');

    if(ans)
    {
        window.location.href('SubscriptionRenew.aspx');
    }
}

 

function popup(which, w, h) {
	var direct;
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	direct = which;
	window.open(direct,w + 'x' + h,'toolbar=no,status=no,scrollbars=yes,resizable=yes,location=no,menubar=no,directories=no,width=' + w + ',height=' + h + ', top=' + wint + ', left=' + winl);
}
function fullpopup(which)
{
    window.open(which);
}
function OpenLabels(which,id) {
	var direct;
	direct = "http://www.musiciansatlas.com/AONMailingLabels/Default.aspx?wh=" + which.value + "&mtdid=" + id;
	//direct = "MailingLabels/ConvertLabelToPdf.aspx?wh=" + which.value + "&mtdid="+id;
	alert(direct);
		window.open(direct,"_blank");

}

function refreshParent() 
{ 
	window.opener.location.reload();
	window.close();
}

var toggleselect = false;
var toggleselect2 = false;
var toggleselect3 = false;
function SetAllCheckBoxes(whichpage,FieldName, CheckValue, which,ts,title)
{
	if(!document.aspnetForm)
	{
	
		return;
		}
	var objCheckBoxes = document.aspnetForm.elements[FieldName];
	if(!objCheckBoxes)
		return;
	var countCheckBoxes = objCheckBoxes.length;
	if(!countCheckBoxes)
		objCheckBoxes.checked = CheckValue;
	else
		// set the check value for all check boxes
		for(var i = 0; i < countCheckBoxes; i++)
			objCheckBoxes[i].checked = CheckValue;
	
	
	if(CheckValue)
		which.value = "Deselect " + title;
	else
		which.value = "Select " + title;
		
	ToggleSelect(ts);
		
}

function SetAllCheckBoxesNoButton(FieldName, CheckValue)
{
	if(!document.aspnetForm)
	    return;
	
	var objCheckBoxes = document.aspnetForm.elements[FieldName];
	
	if(!objCheckBoxes)
		return;
		
	var countCheckBoxes = objCheckBoxes.length;
	
	if(!countCheckBoxes>0)
	{
	    objCheckBoxes.checked = CheckValue;
	}
	else
	{
		// set the check value for all check boxes
		for(var i = 0; i < countCheckBoxes; i++)
			objCheckBoxes[i].checked = CheckValue;
    }		
}
function ToggleSelect(ts)
{
    switch(ts)
    {
	    case "toggleselect":    	
		    toggleselect=(toggleselect) ? false : true;
		    break;
		    
	    case "toggleselect2":    	
	        toggleselect2=(toggleselect2) ? false : true;
	        break;
    	
	    case "toggleselect3":    	
		    toggleselect3=(toggleselect3) ? false : true;
		    break;
    }
		
}
 var state = 'none'; 

function showhide(layer_ref) { 

    if (state == 'block') { 
        state = 'none'; 
    } 
    else { 
        state = 'block'; 
    } 
    if (document.all) { //IS IE 4 or 5 (or 6 beta) 
        eval( "document.all." + layer_ref + ".style.display = state"); 
    } 
    if (document.layers) { //IS NETSCAPE 4 or below 
        document.layers[layer_ref].display = state; 
    } 
    if (document.getElementById &&!document.all) { 
        hza = document.getElementById(layer_ref); 
        hza.style.display = state; 
    } 
} 
//-->


/*
Simple Image Trail script- By JavaScriptKit.com
Visit http://www.javascriptkit.com for this script and more
This notice must stay intact
*/

var offsetfrommouse=[15,15]; //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset
var displayduration=0; //duration in seconds image should remain visible. 0 for always.
var currentimageheight = 270;	// maximum image size.

var defaultimageheight = 40;	// maximum image size.
var defaultimagewidth = 40;	// maximum image size.

if (document.getElementById || document.all){
	document.write('<div id="trailimageid">');
	document.write('</div>');
	document.write('<div id="trailimageidcap">');
	document.write('</div>');
}

function gettrailobj(){
	if (document.getElementById)
		return document.getElementById("trailimageid").style
	else if (document.all)
		return document.all.trailimagid.style
}

function gettrailobjnostyle(){
	if (document.getElementById)
		return document.getElementById("trailimageid")
	else if (document.all)
		return document.all.trailimagid
}
function gettrailobjcap(){
	if (document.getElementById)
		return document.getElementById("trailimageidcap").style
	else if (document.all)
		return document.all.trailimagidcap.style
}

function gettrailobjnostylecap(){
	if (document.getElementById)
		return document.getElementById("trailimageidcap")
	else if (document.all)
		return document.all.trailimagidcap
}

function truebody(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function showtrail(title,f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,page){
	
	document.onmousemove=followmouse;
	
	switch (page){
		case "mrgrecord": 
			newHTML = '<div style="padding: 5px; background-color: #FEFAE7; border: 1px solid #888;width:400px">';
			newHTML = newHTML + '<div class="highlightblue" style="padding: 5px;text-align:center"><span class="whitesubtitle">' + decodeMyHtml(title) + '</span><br/>';
			newHTML = newHTML + '</div>';
			if(f1!='')
			{
				newHTML = newHTML + '<br /><span class="body">' + decodeMyHtml(f1) + '</span><br/>';
			}
			if(f2!='')
			{
			newHTML = newHTML + '<span class="body">' + decodeMyHtml(f2) + '</span><br/>';
			}
			if(f3!='')
			{
			newHTML = newHTML + '<br />';
			newHTML = newHTML  + '<span class="body">'+ decodeMyHtml(f3) + '</span><br/>';
			}
				
			newHTML = newHTML + '</div>';
			break;
		case "mylist": 
			newHTML = '<div style="padding: 5px; background-color: #FEFAE7; border: 1px solid #888;width:300px">';
			newHTML = newHTML + '<div class="highlightblue" style="padding: 5px;text-align:center"><span class="whitesubtitle">' + decodeMyHtml(title) + '</span></div><br/>';
			if(f1!='')
			{
				newHTML = newHTML + '<span class="body">' + decodeMyHtml(f1) + '</span><br/>';
			}
			if(f2!='')
			{
			newHTML = newHTML + '<span class="body">' + decodeMyHtml(f2) + '</span><br/><br/>';
			}
			if(f3!='')
			{
			newHTML = newHTML + '<br />';
			newHTML = newHTML  + '<span class="body">'+ decodeMyHtml(f3) + '</span><br/>';
			}
				
			newHTML = newHTML + '</div>';
			break;
		case "mycustomlist": 
			newHTML = '<div style="padding: 5px; background-color: #FEFAE7; border: 1px solid #888;width:300px">';
			newHTML = newHTML + '<div class="highlightblue" style="padding: 3px;text-align:center"><span class="whitesubtitle">' + decodeMyHtml(title) + '</span></div><br />';
			if(f1!='')
			{
				newHTML = newHTML + '<span class="body">' + decodeMyHtml(f1) + '</span><br/>';
			}
			if(f2!='')
			{
			newHTML = newHTML + '<span class="body">' + decodeMyHtml(f2) + '</span><br/>';
			}
			if(f3!='')
			{
			newHTML = newHTML + '<br />';
			newHTML = newHTML  + '<span class="body">'+ decodeMyHtml(f3) + '</span><br/>';
			}
				
			newHTML = newHTML + '</div>';
			break;
		case "mytask": 
			newHTML = '<div style="padding: 5px; background-color: #FEFAE7; border: 1px solid #888;">';
			newHTML = newHTML + '<span class="bluebodybold">' + decodeMyHtml(title) + '</span>';
			
			if(f1!='')
			{
			    newHTML = newHTML + '<img src="images/notclearbits/time.gif" alt="Email Reminder Set" title="Email Reminder Set" />' ;
			}
			if(f2!='')
			{
			    newHTML = newHTML +  '<img src="images/notclearbits/cellphone.gif" alt="Text Message Reminder Set" title="Text Message Reminder Set" />' ;
			}
			newHTML = newHTML + '<hr />';
			if(f3!='')
			{
			    newHTML = newHTML + '<span class="smbody">'+ decodeMyHtml(f3) + '</span><br/>';
			}
			if(f4!='')
			{
			    newHTML = newHTML + '<span class="smbody">'+ decodeMyHtml(f4) + '</span><br/>';
			}
			if(f5!='')
			{			
			    newHTML = newHTML  + '<span class="smbody">Attached Record: '+ decodeMyHtml(f5) + '</span><br/>';
			}
			if(f6!='')
			{			
			    newHTML = newHTML  + '<span class="smbody">Band: '+ decodeMyHtml(f6) + '</span><br/>';
			}
			if(f7!='')
			{			
			    newHTML = newHTML  + '<span class="smbody">Note: '+ decodeMyHtml(f7) + '</span><br/>';
			}
			if(f8!='')
			{			
			    newHTML = newHTML  + '<span class="smbody">'+ decodeMyHtml(f8) + '</span><br/>';
			}	
			
			newHTML = newHTML + '</div>';
			break;
		case "myairplay": 
			newHTML = '<div style="padding: 5px; background-color: #FEFAE7; border: 1px solid #888;width:200px">';
			newHTML = newHTML + '<div class="highlightblue" style="padding: 3px;text-align:center"><span class="whitesubtitle">' + decodeMyHtml(title) + '</span></div><br/>';
		if(f1!='')
			{
				newHTML = newHTML + '<span class="body">' + decodeMyHtml(f1) + '</span><br/>';
			}
			if(f2!='')
			{
			newHTML = newHTML + '<span class="body">' + decodeMyHtml(f2) + '</span><br/>';
			}
			if(f3!='')
			{
			newHTML = newHTML + '<br />';
			newHTML = newHTML  + '<span class="body">'+ decodeMyHtml(f3) + '</span><br/>';
			}
				
			newHTML = newHTML + '</div>';
			newHTML = newHTML + '</div>';
			break;
		case "myband": 
			newHTML = '<div style="padding: 5px; background-color: #FEFAE7; border: 1px solid #888;">';
			newHTML = newHTML + '<span class="bluebodybold">' + decodeMyHtml(title) + '</span><br/>';
			if(f1!='')
			{
				newHTML = newHTML + '<span class="body">' + decodeMyHtml(f1) + '</span><br/>';
			}
			if(f2!='')
			{
			newHTML = newHTML + '<span class="body">' + decodeMyHtml(f2) + '</span><br/>';
			}
			if(f3!='')
			{
			newHTML = newHTML + '<br />';
			newHTML = newHTML  + '<span class="body">'+ decodeMyHtml(f3) + '</span><br/>';
			}
				
			newHTML = newHTML + '</div>';
			break;
		case "spins": 
			newHTML = '<div style="padding: 5px; background-color: #FEFAE7; border: 1px solid #888;">';
			newHTML = newHTML + '<span class="bluebodybold">' + decodeMyHtml(title) + '</span><br/>';
			if(f1!='')
			{
				newHTML = newHTML + '<span class="body">' + decodeMyHtml(f1) + '</span><br/>';
			}
			if(f2!='')
			{
			newHTML = newHTML + '<span class="body">' + decodeMyHtml(f2) + '</span><br/>';
			}
			if(f3!='')
			{
			newHTML = newHTML + '<br />';
			newHTML = newHTML  + '<span class="body">'+ decodeMyHtml(f3) + '</span><br/>';
			}
				
			newHTML = newHTML + '</div>';
			break;	
		case "myhelp": 
			newHTML = '<div style="padding: 5px; background-color: #FEFAE7; border: 1px solid #888;width:300px">';
			newHTML = newHTML + '<span class="bluebodybold"><img src="images/help.png" alt="Help" /> ' + decodeMyHtml(title) + '</span><br/>';
			
			if(f1!='')
			{
				newHTML = newHTML + '<hr /><span class="body">' + decodeMyHtml(f1) + '</span><br/>';
			}	
				
			newHTML = newHTML + '</div>';
			
			offsetfrommouse=[-120,15];
			break;
		default : newHTML = newHTML + '<div style="padding: 5px; background-color: #FFF; border: 1px solid #888;"></div>';
}
	gettrailobjnostyle().innerHTML = newHTML;
	gettrailobj().visibility="visible";
}


function hidetrail(){
	gettrailobj().visibility="hidden"
	document.onmousemove=""
	gettrailobj().left="-500px"

}

function showtrailcap(img,cls,title){
	
	document.onmousemove=followmousecap;
			
	newHTML = '<div style="padding: 0px; background-color: #FCF3CC; border: 1px solid #888;" class="DetailLabel">';
	newHTML = newHTML + '<img src=\'' + img + '\' class=\''+cls+'\' align=\'absmiddle\' />&nbsp;';			
	newHTML = newHTML +  decodeMyHtml(title);			
	newHTML = newHTML + '</div>';
		
	gettrailobjnostylecap().innerHTML = newHTML;
	gettrailobjcap().visibility="visible";
}

function hidetrailcap(){
	gettrailobjcap().visibility="hidden"
	document.onmousemove=""
	gettrailobjcap().left="-500px"

}


	function followmouse(e){

	var xcoord=offsetfrommouse[0]
	var ycoord=offsetfrommouse[1]

	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(window.innerHeight)

	if (typeof e != "undefined"){
		if (docwidth - e.pageX < defaultimagewidth + 2*offsetfrommouse[0]){
			xcoord = e.pageX - xcoord - defaultimagewidth; // Move to the left side of the cursor
		} else {
			xcoord += e.pageX;
		}
		if (docheight - e.pageY < defaultimageheight + 2*offsetfrommouse[1]){
			ycoord += e.pageY - Math.max(0,(2*offsetfrommouse[1] + defaultimageheight + e.pageY - docheight - truebody().scrollTop));
		} else {
			ycoord += e.pageY;
		}

	} else if (typeof window.event != "undefined"){
		if (docwidth - event.clientX < defaultimagewidth + 2*offsetfrommouse[0]){
			xcoord = event.clientX + truebody().scrollLeft - xcoord - defaultimagewidth; // Move to the left side of the cursor
		} else {
			xcoord += truebody().scrollLeft+event.clientX
		}
		if (docheight - event.clientY < (defaultimageheight + 2*offsetfrommouse[1])){
			ycoord += event.clientY + truebody().scrollTop - Math.max(0,(2*offsetfrommouse[1] + defaultimageheight + event.clientY - docheight));
		} else {
			ycoord += truebody().scrollTop + event.clientY;
		}
	}
	
			gettrailobj().left=xcoord+"px";
			gettrailobj().top=ycoord+"px";
			


}

	function followmousecap(e){

	var xcoord=offsetfrommouse[0]
	var ycoord=offsetfrommouse[1]

	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(window.innerHeight)

	if (typeof e != "undefined"){
		if (docwidth - e.pageX < defaultimagewidth + 2*offsetfrommouse[0]){
			xcoord = e.pageX - xcoord - defaultimagewidth; // Move to the left side of the cursor
		} else {
			xcoord += e.pageX;
		}
		if (docheight - e.pageY < defaultimageheight + 2*offsetfrommouse[1]){
			ycoord += e.pageY - Math.max(0,(2*offsetfrommouse[1] + defaultimageheight + e.pageY - docheight - truebody().scrollTop));
		} else {
			ycoord += e.pageY;
		}

	} else if (typeof window.event != "undefined"){
		if (docwidth - event.clientX < defaultimagewidth + 2*offsetfrommouse[0]){
			xcoord = event.clientX + truebody().scrollLeft - xcoord - defaultimagewidth; // Move to the left side of the cursor
		} else {
			xcoord += truebody().scrollLeft+event.clientX
		}
		if (docheight - event.clientY < (defaultimageheight + 2*offsetfrommouse[1])){
			ycoord += event.clientY + truebody().scrollTop - Math.max(0,(2*offsetfrommouse[1] + defaultimageheight + event.clientY - docheight));
		} else {
			ycoord += truebody().scrollTop + event.clientY;
		}
	}
	
			gettrailobjcap().left=xcoord+"px";
			gettrailobjcap().top=ycoord+"px";
			


}
function encodeMyHtml(s) {
	encodedHtml = escape(s);
	//encodedHtml = encodedHtml.replace(/\//g,"%2F");
	encodedHtml = encodedHtml.replace(/\?/g,"%3F");
	encodedHtml = encodedHtml.replace(/=/g,"%3D");
	encodedHtml = encodedHtml.replace(/&/g,"%26");
	encodedHtml = encodedHtml.replace(/@/g,"%40");
	return encodedHtml;
}
function decodeMyHtml(s) {
	
	//s=s.replace("&apos;","'")
	//s=s.replace("&apos;","'")
	//s=s.replace("&apos;","'")
	//s=s.replace("&apos;","'")
	//s=s.replace("&apos;","'")
	//s=s.replace("&apos;","'")
	//s=s.replace("&apos;","'")
	//s=s.replace("&apos;","'")
	//s=s.replace("&apos;","'")
//	s=s.replace("&apos;","'")
	//s=s.replace("&apos;","'")
//	s=s.replace("&apos;","'")
//s=s.replace("&apos;","'")
	return s;
}

//Hide status bar msg II script- by javascriptkit.com
//Visit JavaScript Kit (http://javascriptkit.com) for script
//Credit must stay intact for use

function hidestatus(){
    window.status=''
    return true
}

if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)

document.onmouseover=hidestatus
document.onmouseout=hidestatus

function clickIE() 
{
    if (document.all) 
    {
        return false;
    }
} 

function clickNS(e) 
{
    if (document.layers||(document.getElementById&&!document.all)) { 
        if (e.which==2||e.which==3) 
        {
            return false;
        }
    }
 } 
//REMOVE COMMENTS FOR LIVE - THIS SCRIPT HIDES THE 
//CONTEXT MENU FROM USERS

if (document.layers) 
{
   document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown=clickNS;
} 
else
{
    document.onmouseup=clickNS;
    document.oncontextmenu=clickIE;
} 

document.oncontextmenu=new Function("return false") 
//END CONTEXT HIDE MENU

function rusure(){
	question = confirm("Are you sure you want to delete this record?")
	if (question !="0")
	{	
		return true;
	}
	else
	{	
		return false;
	}
}
function rusure2(itemname){
	question = confirm("Are you sure you want to delete '" + itemname + "'?")
	if (question !="0")
	{	
		return true;
	}
	else
	{	
		return false;
	}
}
function copyhtml(ctl) 
        { 
            var textRange;
            textRange = ctl.createTextRange(); 
            textRange.execCommand("RemoveFormat"); 
            textRange.execCommand("Copy");         
       } 
function formatCurrency(num) {
    num = num.toString().replace(/\$|\,/g,'');
    if(isNaN(num))
    num = "0";
    sign = (num == (num = Math.abs(num)));
    num = Math.floor(num*100+0.50000000001);
    cents = num%100;
    num = Math.floor(num/100).toString();
    if(cents<10)
    cents = "0" + cents;
    for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
    num = num.substring(0,num.length-(4*i+3))+','+
    num.substring(num.length-(4*i+3));
    return (((sign)?'':'-') + '$' + num + '.' + cents);
}
 function show(sw,obj) {
	// show/hide the divisions
	if (sw && (ie4 || ie5) ) document.all[obj].style.visibility = 'visible';
	if (!sw && (ie4 || ie5) ) document.all[obj].style.visibility = 'hidden';
	if (sw && ns4) document.layers[obj].visibility = 'visible';
	if (!sw && ns4) document.layers[obj].visibility = 'hidden';
}

        