if (self.makeCM) {
/*** 
This is the menu creation code - place it right after you body tag
Feel free to add this to a stand-alone js file and link it to your page.
**/

//Menu object creation
oCMenu=new makeCM("oCMenu") //Making the menu object. Argument: menuname

oCMenu.frames = 0

//Menu properties   
oCMenu.pxBetween=0
oCMenu.fromLeft=0 
// ################### Modified from 0 to 90px ################# */
oCMenu.fromTop=90   
oCMenu.rows=1 
oCMenu.menuPlacement="left"
                                                             
// oCMenu.offlineRoot="file:///D|/localsites/dnc2/dnc_local/"
//*** onlineRoot must be set to the root of the virtual directory for swap images of top menu to load properly. 
if (typeof amConnLocation != 'undefined') {
    // we have a dynamically-generated <base> tag that correctly specifies the protocol and location
    oCMenu.onlineRoot = amConnLocation;
} else {
    oCMenu.onlineRoot="http://www.dnc.com" 
}
oCMenu.resizeCheck=1 
oCMenu.wait=150
oCMenu.fillImg="cm_fill.gif"
oCMenu.zIndex=0

//Background bar properties
oCMenu.useBar=1
oCMenu.barWidth="980"
oCMenu.barHeight="menu" 
oCMenu.barClass="clBar"
oCMenu.barX=0 
oCMenu.barY=0
oCMenu.barBorderX=0
oCMenu.barBorderY=0
oCMenu.barBorderClass=""

//Level properties - ALL properties have to be specified in level 0
oCMenu.level[0]=new cm_makeLevel() //Add this for each new level
oCMenu.level[0].width=112
oCMenu.level[0].height=32 
oCMenu.level[0].regClass="clLevel0"
oCMenu.level[0].overClass="clLevel0over"
oCMenu.level[0].borderX=0
oCMenu.level[0].borderY=0
oCMenu.level[0].borderClass="clLevel0border"
oCMenu.level[0].offsetX=0
oCMenu.level[0].offsetY=0
oCMenu.level[0].rows=0
oCMenu.level[0].arrow=0
oCMenu.level[0].arrowWidth=0
oCMenu.level[0].arrowHeight=0
oCMenu.level[0].align="bottom"

//EXAMPLE SUB LEVEL[1] PROPERTIES - You have to specify the properties you want different from LEVEL[0] - If you want all items to look the same just remove this
oCMenu.level[1]=new cm_makeLevel() //Add this for each new level (adding one to the number)
//oCMenu.level[1].width=oCMenu.level[0].width
oCMenu.level[1].width=110
oCMenu.level[1].height=32
oCMenu.level[1].regClass="clLevel1"
oCMenu.level[1].overClass="clLevel1over"
oCMenu.level[1].borderX=1
oCMenu.level[1].borderY=1
oCMenu.level[1].align="right" 
//oCMenu.level[1].offsetX=-(oCMenu.level[0].width-2)/2+20
oCMenu.level[1].offsetX=0
oCMenu.level[1].offsetY=0
oCMenu.level[1].borderClass="clLevel1border"
//EXAMPLE SUB LEVEL[2] PROPERTIES - You have to specify the properties you want different from LEVEL[1] OR LEVEL[0] - If you want all items to look the same just remove this
oCMenu.level[2]=new cm_makeLevel() //Add this for each new level (adding one to the number)
oCMenu.level[2].width=110
oCMenu.level[2].height=32
oCMenu.level[1].offsetX=-1
oCMenu.level[1].offsetY=0
oCMenu.level[2].borderX=1
oCMenu.level[2].borderY=2
oCMenu.level[2].regClass="clLevel2"
oCMenu.level[2].overClass="clLevel2over"
oCMenu.level[2].borderClass="clLevel2border"


/******************************************
Menu item creation:
myCoolMenu.makeMenu(name, parent_name, text, link, target, width, height, regImage, overImage, regClass, overClass , align, rows, nolink, onclick, onmouseover, onmouseout) 
*************************************/
//***Set URLs for the top navigation menus and sub-menus
oCMenu.makeMenu('top0','','','/','','237','32','/images/master/cm_lower_lh_trim_1.jpg','/images/master/cm_lower_lh_trim_1.jpg','','','0','','nolink')

if (menuSelect == 1) {
  oCMenu.makeMenu('top1','','','/solutions/which/','','99','32','/images/master/solutions_active.gif','/images/master/solutions_rol.gif','clLevel0over')
} else {
  oCMenu.makeMenu('top1','','','/solutions/which/','','99','32','/images/master/solutions_.gif','/images/master/solutions_rol.gif','clLevel0over')
}

  oCMenu.makeMenu('sub10','top1','Which is right for me?&nbsp;&nbsp;&nbsp;>','/solutions/which/','','170','30')
  oCMenu.makeMenu('sub11','top1','DNCScrub&trade; Solutions&nbsp;&nbsp;&nbsp;>','','','170','30')
  oCMenu.makeMenu('sub12','top1','Compliance Guide','/solutions/complianceGuide/','','170','30')
  oCMenu.makeMenu('sub13','top1','TrainingMaster&trade;','/solutions/trainingMaster/','','170','30')
  oCMenu.makeMenu('sub14','top1','Data Enhancement','/solutions/dataEnhancement/','','170','30')
  oCMenu.makeMenu('sub15','top1','SmartBlock&trade;','/solutions/smartBlock/','','170','30')
  oCMenu.makeMenu('sub16','top1','Frequently Asked Questions','/solutions/faq/','','170','30')
  oCMenu.makeMenu('sub17','top1','Free Trial Account','/solutions/demo/','','170','30')

	oCMenu.makeMenu('sub112','sub11','DNCScrub&trade; Features','/solutions/dncscrub/','','150','30')
	oCMenu.makeMenu('sub113','sub11','DNCScrub&trade; Plans','/solutions/plans/','','150','30')

    oCMenu.makeMenu('sub101','sub10','Small Business','/solutions/which/small.adpf','','150','30')
	oCMenu.makeMenu('sub102','sub10','Mid-Size Call Center','/solutions/which/midsize.adpf','','150','30')
	oCMenu.makeMenu('sub103','sub10','Multiple Locations','/solutions/which/multi.adpf','','150','30')
	oCMenu.makeMenu('sub104','sub10','Tele-services Agency','/solutions/which/agency.adpf','','150','30')
	oCMenu.makeMenu('sub105','sub10','List Broker','/solutions/which/broker.adpf','','150','30')	

if (menuSelect == 2) {	
  oCMenu.makeMenu('top2','','','/complianceInfo/','','134','32','/images/master/compliance_on.gif','/images/master/compliance_rol.gif')
} else {
  oCMenu.makeMenu('top2','','','/complianceInfo/','','134','32','/images/master/compliance_.gif','/images/master/compliance_rol.gif')
}

    oCMenu.makeMenu('sub21','top2','News / Articles','/complianceInfo/News/','','130','30')
    //oCMenu.makeMenu('sub22','top2','Fact & Myth','/complianceInfo/factMyth/','','130','30')
    oCMenu.makeMenu('sub23','top2','FAQ','/complianceInfo/faq/','','130','30')
    oCMenu.makeMenu('sub24','top2','DNC Map','/complianceInfo/map/','','130','30')
    oCMenu.makeMenu('sub25','top2','Statutes','/legal/statutes/','','130','30')
    oCMenu.makeMenu('sub26','top2','Resources','/complianceInfo/Resources/','','130','30')
    oCMenu.makeMenu('sub27','top2','Compliance Wizard','/complianceInfo/wizard/','','130','30')
    oCMenu.makeMenu('sub28','top2','Regulatory Info','/legal/charts/','','130','30')
    oCMenu.makeMenu('sub29','top2','ExemptionMaster&trade;','/complianceInfo/exemptionMaster/','','130','30')

if (menuSelect == 3) {
  oCMenu.makeMenu('top3','','','/support/','','102','32','/images/master/tech_support_on.gif','/images/master/tech_support_rol.gif')
} else {
  oCMenu.makeMenu('top3','','','/support/','','102','32','/images/master/tech_support_.gif','/images/master/tech_support_rol.gif')
}
if (menuSelect == 8) {
  oCMenu.makeMenu('top4','','','/testimonials/','','159','32','/images/master/testimonials_on.gif','/images/master/testimonials_rol.gif')
} else {
  oCMenu.makeMenu('top4','','','/testimonials/','','159','32','/images/master/testimonials_.gif','/images/master/testimonials_rol.gif')
}

if (menuSelect == 4) {
  oCMenu.makeMenu('top5','','','/about/','','85','32','/images/master/about_on.gif','/images/master/about_rol.gif')
} else {
  oCMenu.makeMenu('top5','','','/about/','','85','32','/images/master/about_.gif','/images/master/about_rol.gif')
}
if (menuSelect == 5) {
  oCMenu.makeMenu('top6','','','/contact/','','87','32','/images/master/contact_on.gif','/images/master/contact_rol.gif')
} else {
  oCMenu.makeMenu('top6','','','/contact/','','87','32','/images/master/contact_.gif','/images/master/contact_rol.gif')
}

if (menuSelect == 9) {
  oCMenu.makeMenu('top9','','','http://forum.legaltelemarketing.com/','_blank','54','32','/images/master/forum_on.gif','/images/master/forum_rol.gif')
} else {
  oCMenu.makeMenu('top9','','','http://forum.legaltelemarketing.com/','_blank','54','32','/images/master/forum_.gif','/images/master/forum_rol.gif')
}






/* #### TM   End main nav additions #### */

// Was toying with this: oCMenu.makeMenu('Phone','','866-DNC-LIST','', '', '', '', '', '', '', 'white', 'bottom', '', 'nolink')


//Leave this line - it constructs the menu
// This is now done in the page itself to add page-specific elements to the common elements above: oCMenu.construct()		

}

// Handle swaps for div tags on homepage and orientation (navigation highlighting)

function dt_displayScrunchLayers() {
  var i,p,v,obj,args=dt_displayScrunchLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'':(v='hide')?'none':v; }
    obj.display=v; }
}

function hideAll() {
   dt_displayScrunchLayers('div-dnc','','hide');
   dt_displayScrunchLayers('div-legal','','hide');

}
function swap() {
    a=swap.arguments;
	MM_swapImage(a[0],'','/images/master/rgb-' + a[0] + '-on.gif',1);
    MM_swapImage('pixel','','/images/master/pixel-' + a[0] + '.gif',1);
	hideAll();
	dt_displayScrunchLayers('div-' + a[0],'','show'); 			
}

function swapBack() {
    a=swapBack.arguments;
    MM_swapImage('pixel','','/images/master/pixel-services.gif',1);
	MM_swapImage(a[0],'','/images/master/rgb-' + a[0] + '-off.gif',1);
}

//***For footer navigation menu to highlight current section/page this function must be called onLoad in the HTML body tag.
function checkFooterNav(){
	switch (menuSelect) {
        case "T":
            //T for Top-level but not Home. IE JScript doesn't require this but under Netscape Javascript, case 0 is matched otherwise.
       		 break;
		case 0:
		   	dt_displayScrunchLayers('home-on','','show');
		   	dt_displayScrunchLayers('home-off','','hide');
			break;
		case 1:
		   	dt_displayScrunchLayers('solutions-on','','show');
		   	dt_displayScrunchLayers('solutions-off','','hide');
			break;
		case 2:
		   	dt_displayScrunchLayers('info-on','','show');
		   	dt_displayScrunchLayers('info-off','','hide');
		   	break;
		case 3:
		   	dt_displayScrunchLayers('support-on','','show');
		   	dt_displayScrunchLayers('support-off','','hide');
		   	break;
		case 8:
		   	dt_displayScrunchLayers('testimonials-on','','show');
		   	dt_displayScrunchLayers('testimonials-off','','hide');
		   	break;		
		case 4:
		   	dt_displayScrunchLayers('about-on','','show');
		   	dt_displayScrunchLayers('about-off','','hide');
		   	break;
		case 5:
		   	dt_displayScrunchLayers('contact-on','','show');
		   	dt_displayScrunchLayers('contact-off','','hide');
			break;
		case 9:
		   	dt_displayScrunchLayers('blogs-on','','show');
		   	dt_displayScrunchLayers('blogs-off','','hide');
		   	break;
		 default:
		 break;
	} 
}

//***For left-side navigation menu to highlight current section/page this function must be called onLoad in the HTML body tag.
function checkLeftNav(){
	switch (menu2Select) {
		case 10:
		   	dt_displayScrunchLayers('index-on','','show');
		   	dt_displayScrunchLayers('index-off','','hide');
			break;
		case 11:
		   	dt_displayScrunchLayers('plans-on','','show');
		   	dt_displayScrunchLayers('plans-off','','hide');
			break;
		case 12:
		   	dt_displayScrunchLayers('which-on','','show');
		   	dt_displayScrunchLayers('which-off','','hide');
		   	break;
		case 13:
		   	dt_displayScrunchLayers('demo-on','','show');
		   	dt_displayScrunchLayers('demo-off','','hide');
		   	break;
		case 14:
		   	dt_displayScrunchLayers('faq-on','','show');
		   	dt_displayScrunchLayers('faq-off','','hide');
		   	break;
		case 15:
		   	dt_displayScrunchLayers('complianceGuide-on','','show');
		   	dt_displayScrunchLayers('complianceGuide-off','','hide');
		   	break;
		case 16:
		   	dt_displayScrunchLayers('features-on','','show');
		   	dt_displayScrunchLayers('features-off','','hide');
			break;
		case 17:
		   	dt_displayScrunchLayers('trainingMaster-on','','show');
		   	dt_displayScrunchLayers('trainingMaster-off','','hide');
		   	break;
		case 18:
		   	dt_displayScrunchLayers('dataEnhancement-on','','show');
		   	dt_displayScrunchLayers('dataEnhancement-off','','hide');
		   	break;
		case 19:
		   	dt_displayScrunchLayers('smartBlock-on','','show');
		   	dt_displayScrunchLayers('smartBlock-off','','hide');
		   	break;
		case 40:
		   	dt_displayScrunchLayers('aboutmain-on','','show');
		   	dt_displayScrunchLayers('aboutmain-off','','hide');
		   	break;
		case 41:
		   	dt_displayScrunchLayers('legal-on','','show');
		   	dt_displayScrunchLayers('legal-off','','hide');
		   	break;
		case 20:
		   	dt_displayScrunchLayers('ci-index-on','','show');
		   	dt_displayScrunchLayers('ci-index-off','','hide');
		   	break;		
		case 21:
		   	dt_displayScrunchLayers('ci-news-on','','show');
		   	dt_displayScrunchLayers('ci-news-off','','hide');
		   	break;		
		case 22:
		   	dt_displayScrunchLayers('ci-factMyth-on','','show');
		   	dt_displayScrunchLayers('ci-factMyth-off','','hide');
		   	break;		
		case 23:
		   	dt_displayScrunchLayers('ci-faq-on','','show');
		   	dt_displayScrunchLayers('ci-faq-off','','hide');
		   	break;		
		case 24:
		   	dt_displayScrunchLayers('ci-map-on','','show');
		   	dt_displayScrunchLayers('ci-map-off','','hide');
		   	break;		
		case 25:
		   	dt_displayScrunchLayers('ci-statutes-on','','show');
		   	dt_displayScrunchLayers('ci-statutes-off','','hide');
		   	break;		
		case 26:
		   	dt_displayScrunchLayers('ci-resources-on','','show');
		   	dt_displayScrunchLayers('ci-resources-off','','hide');
		   	break;		
		case 27:
		   	dt_displayScrunchLayers('ci-wizard-on','','show');
		   	dt_displayScrunchLayers('ci-wizard-off','','hide');
		   	break;		
		case 28:
		   	dt_displayScrunchLayers('ci-charts-on','','show');
		   	dt_displayScrunchLayers('ci-charts-off','','hide');
		   	break;		
		case 29:
		   	dt_displayScrunchLayers('ci-exemptionmaster-on','','show');
		   	dt_displayScrunchLayers('ci-exemptionmaster-off','','hide');
		   	break;		
		   	
		 default:
		 break;
	} 
}

function Login() {
/*
	Save account id to cookie, possibly validate form fields, maybe handle Forgot Password link?
*/
	// we save the account id in a cookie
		
	// Set expiration to a year from now.
//	var expiration = new Date();
//	expiration.setFullYear(expiration.getFullYear() + 1);
	am_setCookie('acctId', document.LoginForm.acctId.value, 31536000, '.');

	// document.LoginForm.submit;
	return true;
}

function LoginReady() {
/*
    Handle key down for login fields to ensure mimimum length 
*/
    var account = document.LoginForm.acctId.value;
    var username = document.LoginForm.username.value;
    var password = document.LoginForm.password.value;
    var buttonOrange = document.getElementById('loginButtonOrange');
    var buttonGray = document.getElementById('loginButtonGray');
    if (account.length >= 2 && 
        username.length >= 3 &&
        password.length >= 4)
    {
        buttonOrange.style.display = '';
        buttonGray.style.display = 'none';
        return true;
    } else {
        buttonOrange.style.display = 'none';
        buttonGray.style.display = '';
        return false;
    }
}

function ForgotPasswordClick() {
/*
    Handle "Forgot your password?" click
*/
    Login();
    document.ForgotPasswordForm.acctId.value = document.LoginForm.acctId.value;
    document.ForgotPasswordForm.username.value = document.LoginForm.username.value;
    document.ForgotPasswordForm.submit();
    return false;
}
