function GetAffiliateCode() {



var DefaultAffiliateCode = '222';

var thisurl = location.href;

var ql = thisurl.indexOf('=');



if(ql < 0) { ql = thisurl.indexOf('#'); }

if(ql >= 0) { return thisurl.substr(ql + 1); }



return DefaultAffiliateCode;

}



ThisAffiliateCode = GetAffiliateCode();



function SwapLinks() {

	if(ThisAffiliateCode != 222) {

		var links = document.getElementsByName('navbarlink'), i, link, j, textLink;

		

		for (i = 0; i < links.length; i++)

		{

			link = links[i];

			textLink = true;

			

			for (j = 0; j < link.childNodes.length; j++)

				if (link.childNodes[j].nodeType != 3)

					textLink = false;

					

			if (textLink)

				link.setAttribute('href', link.getAttribute('href') + '?af=' + ThisAffiliateCode);

		}



	}



}



function GetOutput() {

var retVal;

if(ThisAffiliateCode == 222) { retVal = '<span class="phone">Call <br /> 1-800-917-0222<br />or<br />Order Securely Below:</span>'; }

else { retVal = '<span class="phone">Call <br /> 1-800-917-0222<br />Extension:<span class="phoneext">'+GetAffiliateCode()+'</span><br />or order securely below.</span>'; }

return retVal;

}



function AppendBlueLink(blueLink, text) {

	if(ThisAffiliateCode != 222)

		document.write('<a href="'+blueLink+'?af='+ThisAffiliateCode+'" name="navbarlink"><span class="blueText">'+text+'</span></a>');

	else

		document.write('<a href="'+blueLink+'" name="navbarlink"><span class="blueText">'+text+'</span></a>');

}



function AppendFooterLink(footerLink, text) {

	if(ThisAffiliateCode != 222)

		document.write('<a href="'+footerLink+'?af='+ThisAffiliateCode+'" name="navbarlink"><strong>'+text+'</strong></a>');

	else

		document.write('<a href="'+footerLink+'" name="navbarlink"><strong>'+text+'</strong></a>');

}




function popUp(URL) {







day = new Date();







id = day.getTime();







eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=700,height=500,left = 785,top = 350');");







}


function popUpSample(URL) {







day = new Date();







id = day.getTime();







eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=840,height=314,left = 785,top = 350');");







}

function popUpLabel(URL) {







day = new Date();







id = day.getTime();







eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=875,height=330,left = 785,top = 350');");







}

function popUpDisplay(URL) {







day = new Date();







id = day.getTime();







eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=540,height=580,left = 785,top = 350');");







}

function popUpPay(URL) {







day = new Date();







id = day.getTime();







eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=829,height=585,left = 785,top = 350');");







}
