



function getDotcom( url )
{
	url=url.toLowerCase();
	url=url.replace( /^.+\:\/\//, "" );
	url=url.replace( /\/.*/, "" );
	url=url.replace( /:[\d]*/, "" );
	var urls=url.split(".");
	if( urls.length>0 ) { url=urls[urls.length-1];
		if( urls.length>1 ) { url=urls[urls.length-2] + "." + url; }
	}
	return url;
}

function setEffort( aff )
{ 
    
  
  aff_duration = 1000 * 60 * 60 * 24 * 30;
  aff_date = new Date( (new Date()).getTime() + aff_duration );
  if( typeof(aff)!="undefined" && aff!='' ) {
  	document.cookie='AM_EFFORT=' + escape(aff) + '; path=/; domain=.artistdirect.com; expires=' + aff_date.toGMTString();
  }
  return true; 
}

function chkEffort()
{ 
  e=getParam('aff'); 
  if(e&&e!='' ){setEffort(e);} 
}

function styEscape( sty )
{ return sty.toLowerCase().replace(/ /g,'').replace(/&/g,'').replace(/\//g,'').replace(/alternative/gi,'alt').replace(/#/gi,''); }

function valEscape( val )
{
	if( val != null ) {
	val = val.replace( / /g, '+' );
	val = val.replace( /&/g, 'and' );
	val = val.replace( /=/g, '%3D' );
	}
	return val;
}

var NAD_xevals = new Array();
var NAD_listpos = new Array();
var NAD_popstatus = '';
var nad_keywords = '';


// OAS positions
var n_top = 'Top';  //top banner
var n_bottom = 'Bottom'; //bottom banner
var n_tower = 'Left'; //left hand side tower
var n_mrect = 'Right'; //300x250 rect
var n_pop = 'Frame1'; //1x1 pop up
var n_shop = 'Middle'; //shop banner
var n_windowbanner = 'TopRight';  //half banner in window players
var n_windowminibanner = 'x52';
//var n_whatshot = 'x20';  //whats hot module on homepage
var n_whatshot = 'x10';

var n_bottomrect = 'Bottom1'; //300x250 at the bottom of screen

//video preroll
var n_vidpreroll = 'Position2';

//190x30s
var n_news = 'x01';
var n_charts = 'x03';
var n_listen = 'x05'; //feature downloads
var n_ringtones = 'x07';
var n_poll = 'x11';
var n_newreleases = 'x09';
var n_verge = 'x15';
var n_essential = 'x13';
var n_albumreview = 'x13';
var n_wallpaper = 'x50';
var n_playerskin = 'x53';

// USDM only UMG videos test
var n_umg = 'x95';

//sponsorships
var n_newssponsor = 'Middle3';
var n_listensponsor = 'Middle1';
var n_watchsponsor = 'Middle2';

//site-wide special mid banner sponsorship
var n_sitewide_sponsor = 'Middle';

