// JavaScript Document

var usrGlbl;  
var bsf = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var cd1 = '01234567890123456';
var mbType ;
var usrName;
var mbNb ; 	
var isLeader ;
var hq = location.href.indexOf("hq.") > -1 ? 'hq.' : '';
var mb;
var Comment = '';
var isLoggedIn = 0;
var CO;
//var joinLink = isNonMember(usrGlbl) ? '<li class="leftConnectBlue">&nbsp;</li><li class="middleBlue"><a href="/membership/join-asq.html?headerJoin">Join ASQ</a></li><li class="rightBlue">&nbsp;</li>' : '' ;
getUsrGlbl(); 


//alert(location.href) ;

if (document.cookie.indexOf("ctx=asq") >-1) {
	document.cookie="prvctx=asq;path=/;domain=asq.org" ;
}
else if (document.cookie.indexOf("ctx=kc") >-1) {
	document.cookie="prvctx=kc;path=/;domain=asq.org" ;
}
else if (document.cookie.indexOf("ctx=qp") >-1) {
	document.cookie="prvctx=qp;path=/;domain=asq.org" ;
}
else if (document.cookie.indexOf("ctx=dv") >-1) {
	document.cookie="prvctx=dv;path=/;domain=asq.org" ;
}

if (location.href.indexOf("qualityprogress/") > -1 || location.href.indexOf("quality-progress/") > -1 ) {
	document.cookie="ctx=qp;path=/;domain=asq.org" ;
}
else if ( 
				location.href.indexOf("knowledge-center/") 				> -1
			|| 	location.href.indexOf("cost-of-quality/") 				> -1
			||	location.href.indexOf("economic_case/") 				> -1
			||	location.href.indexOf("food-safety/") 					> -1
			||	location.href.indexOf("food-quality/") 					> -1
			||	location.href.indexOf("innovation/") 					> -1
			||	location.href.indexOf("lean-six-sigma/") 				> -1
			||	location.href.indexOf("management-system-standards/")	> -1
			||	location.href.indexOf("social_responsibility/")			> -1
			||	location.href.indexOf("2008-futures-study/")			> -1
			||	location.href.indexOf("global-issues/")					> -1
			||	location.href.indexOf("healthcare-innovations/")		> -1
			||	location.href.indexOf("economy/")						> -1
			||	location.href.indexOf("future-of-quality/")				> -1
		) {
	document.cookie="ctx=kc;path=/;domain=asq.org" ;
}
else if (location.href.indexOf("/divisions-forums/") > -1 ) {
	document.cookie="ctx=dv;path=/;domain=asq.org" ;
}
else {
	document.cookie="ctx=asq;path=/;domain=asq.org" ;
}

function WTlog(thislink) {
	//alert("Logging");
	if ( document.cookie.indexOf("qazqsa29") > 0 || document.cookie.indexOf("nonmsa29") > 0 ) {
		wrapDcsMultiTrack(thislink.href) ; 
	}
	else {
		document.cookie="wtdlay=" + thislink.href + ";path=/;domain=asq.org";
	}
	//alert("BCM TEST 9 APR 2009. thislink: " + thislink + " thislink.href: " + thislink.href);
	// pageTracker._trackPageview(thislink.href);
}

function WTFileTagging(thislink) {
	WTlog(thislink);
}

function WTlogDlay() {
	if (document.cookie.indexOf("wtdlay") > 0) {
		var startAt		= document.cookie.indexOf("wtdlay")+7; 
		var remainingPart	= document.cookie.substring(startAt);

		wturl = remainingPart.indexOf(";") >-1 	? remainingPart.substring(0,remainingPart.indexOf(";")) 
												: remainingPart ;
		wrapDcsMultiTrack(wturl) ;
		var passedTime  = new Date(new Date().getTime() - 60000);
		document.cookie="wtdlay=asq1;path=/;domain=asq.org;expires=" 	+ passedTime.toGMTString();
	}
}

function wrapDcsMultiTrack (mylink){
	thelink = mylink.replace(/http:.+\.asq.org/,"");
	dcsMultiTrack('DCS.dcssip','asq.org','DCS.dcsuri',thelink,'WT.ac','ASQ_NON_HTML') ;
	// if (location.href.indexOf(".hq.") > -1) { alert("FOR TESTING: thelink: " + thelink); } // show alert on hq
}

//This function is used for highlighting navigation to save on template numbers
function highlight(nav) {
    if (document.getElementById(nav) != null){ 
        document.getElementById(nav).className = 'selected'; //selected
    }
}

function highlightTab(tab,nav) {
	if (document.getElementById(tab) != null){ 
		document.getElementById(tab).className = 'overnav'; //selected
	}
	if (document.getElementById(nav) != null){
		document.getElementById(nav).className = 'selected'; //selected
	}
}
function checkSignInCookie(memberPage) {
	if (document.cookie.indexOf("qazqsa29") > 0) {
		if ( isNonMember(getUsrGlbl())  ) {
			// nothing
		}
		else {
			window.location.href  = memberPage;
		}
	}
}
function rot07(input){
    if (!input) return '';
    for (var output = '',i=0;i<input.length;i++) {
        character = input.charAt(i);
        position = cd1.indexOf(character);
        if (position > -1)
            character = cd1.charAt(position + 5);
        output += character;
    }
    return output;
}

function getUsrGlbl() {
	var allCookies = document.cookie.toString();
	if ( allCookies.indexOf("10.1.7.144") > -1) {
		//alert (allCookies);
	}

	if(document.cookie.toString().indexOf("nebsuc") > -1) {
		var startAt			= allCookies.indexOf("nebsuc")+7; 
		var remainingPart 	= allCookies.substring(startAt);

		usrGlbl = remainingPart.indexOf(";") >-1 	? remainingPart.substring(0,remainingPart.indexOf(";")) 
													: remainingPart ;
		usrGlbl= decode(usrGlbl) ;
		if (document.cookie.toString().indexOf("qazqsa29") > -1) {
			startAt			= allCookies.indexOf("qazqsa29")+9; 
			remainingPart 	= allCookies.substring(startAt);

			var mbNb = remainingPart.indexOf(";") >-1 	? remainingPart.substring(0,remainingPart.indexOf(";")) 
														: remainingPart ;
			this.mbNb = rot07(mbNb);
		}
		if (usrGlbl != null){
			var posa= usrGlbl.indexOf("~"); 
			var usrNm= usrGlbl.substring(0,usrGlbl.indexOf("~")); 
			//alert(usrNm);
			var pos1 = usrGlbl.indexOf("~",usrGlbl.indexOf("~")+1)+1;
			var pos2 = usrGlbl.indexOf("~",pos1);

			this.usrGlbl = usrGlbl ;
			this.usrNm = usrNm ;
			this.mbType = this.usrGlbl.substring(pos1,pos2);

			pos1 = usrGlbl.indexOf("~CO:");
			if (pos1 > -1) {
				CO = usrGlbl.substring(pos1+4);
				if ( CO.indexOf("~") > -1 ) {
					CO = CO.substring(0,CO.indexOf("~"));
					//alert(CO);
				}
			}
			//alert(CO);

			// to support Ray's Flash NON-MEMBER introduction			
			var aYrFromNow = new Date(new Date().getTime() + (1000*3600*24*365) );
			//alert(aYrFromNow.toGMTString());
			document.cookie="mbtype=" + this.mbType + ";path=/;domain=asq.org;expires=" + aYrFromNow ;
                        
			//alert("<!-- JR temp...\n" + usrGlbl + "-->");
			//document.write(this.usrNm) ;
			this.isLeader = (usrGlbl.indexOf("LEADER") > -1 ? 1 : 0) ;
			//alert("isLeader: " + this.isLeader);
		}
		return usrGlbl ;
	}
}


// *******************************************************
// member login fucntion for Quality Progress header area 
// *******************************************************
function dsplLgn2(site) {
//	alert(site);
	WTlogDlay() ;
	if (usrGlbl != null){

		if ( this.usrNm != null && this.usrNm != '') { 

		
			if ( 	location.href.indexOf("group-registration") == -1 &&
				( 	usrGlbl.indexOf("ORGANIZATION") > -1 || 
					usrGlbl.indexOf("SUSTAINING") > -1 || 
					usrGlbl.indexOf("SCHOOL") > -1 	|| 
					usrGlbl.indexOf("DISTRICT") > -1
				) 
			) {

				if (location.href.indexOf("/members/") > -1) {
					location.href = '/members/group-registration.html';
				}
			}

			/////  HEADER 
			var header ;

			if (site == 'qp') {
				header= 'Logged In as ' + this.usrNm  ;
			}
			else {
				mb = (isParticipant(usrGlbl) || isNonMember(usrGlbl) ) ? '' : 'members/'; 
				header= 'Logged In as ' + this.usrNm  + ' &nbsp;|&nbsp; <a href="http://' + hq + 'asq.org/log-out.html?prev=/qualityprogress">Log Out</a> &nbsp;|&nbsp; <a href="http://' + hq + 'asq.org/' + mb + 'account/manage-account.html">My Account</a> &nbsp;|&nbsp; <a href="http://' + hq + 'asq.org/perl/members/bookmarks.pl?action=viewbookmarks&ctx=qp">My Saved Articles</a> &nbsp;|&nbsp; <a href="http://' + hq + 'asq.org/" target="_blank">ASQ.org</a>' + (hq ? '' : '<META NAME="WT.rv" CONTENT="1"> ') ;

			}
			
			
			document.getElementById('loginarea2').innerHTML = header ; 


		}
		
	}
}


// *******************************************************
// regular member login header links
// *******************************************************
function dsplLgn(site) {
	//alert(site);
	WTlogDlay() ;

	if (usrGlbl != null){

		if ( this.usrNm != null && this.usrNm != '') { 

		
			if ( 	location.href.indexOf("group-registration") == -1 &&
				( 	usrGlbl.indexOf("ORGANIZATION") > -1 || 
					usrGlbl.indexOf("SUSTAINING") > -1 || 
					usrGlbl.indexOf("SCHOOL") > -1 	|| 
					usrGlbl.indexOf("DISTRICT") > -1
				) 
			) {
				//alert ("A " + usrGlbl) ;

				if (location.href.indexOf("/members/") > -1) {
					location.href = '/members/group-registration.html';
					return;
				}
			}
			else {
				//alert ("B " + usrGlbl) ;
			}

			/////  HEADER 
			var header ;

			if (site == 'qp') {
				header= 'Logged In as ' + this.usrNm  ;
			}
			else {
				mb = (isParticipant(usrGlbl) || isNonMember(usrGlbl) ) ? '' : 'members/'; 

// Made image links absolute for thePort 
				/* if (location.href.indexOf("community.asq.") > -1) {
					header= '<span class="bluebold">Logged In as ' + this.usrNm  + '</span> <br /> <a href="/editor/app/logout.aspx">Log Out</a> <img src="http://www.asq.org/img/templates/nonmember/header-member-logout.gif" />&nbsp;&nbsp;<a href="http://www.asq.org/account/manage-account.html">My Account</a> <img src="http://www.asq.org/img/templates/nonmember/header-my-account.gif" />&nbsp;&nbsp; <a href="http://www.asq.org/store/shopping_cart.html">View Shopping Cart</a> <img src="http://www.asq.org/img/templates/nonmember/header-shopping-cart.gif" />&nbsp;&nbsp;<a href="http://www.asq.org/qualityprogress/index.html" target="_blank">Quality Progress Magazine</a> <img src="http://www.asq.org/img/templates/nonmember/header-qp.gif" />' +  (hq ? '' : '<META NAME="WT.rv" CONTENT="1">') ;
				} */
				if (location.href.indexOf("community.asq.") > -1) {
					header= '<div class="tab"><ul class="login"><li class="leftDark">&nbsp;</li><li class="middleDark"><a href="http://asq.org/store/index.html?header">Store</a></li><li class="sep middleDark">|</li><li class="middleDark"><a href="http://asq.org/store/shopping_cart.html">Shopping Cart</a></li><li class="sep middleDark">|</li><li class="middleDark"><em><a href="http://asq.org/qualityprogress/index.html">Quality Progress</a></em></li><li class="leftConnect">&nbsp;</li><li><a href="http://asq.org/account/manage-account.html">My Account</a></li><li class="sepL">|</li><li><a href="/editor/app/logout.aspx">Log Out</a></li><li class="right">&nbsp;</li></ul></div>' +  (hq ? '' : '<META NAME="WT.rv" CONTENT="1">') ;
					headerRight= '<div id="welcomeString">Welcome, ' + this.usrNm  + '\!</div><div id="loginText"><!--// for spacing only in logged in view //--></div>' +  (hq ? '' : '<META NAME="WT.rv" CONTENT="1">') ;
				}
				// SHOW JOIN NOW LINK ONLY TO REGISTERED USERS WHEN LOGGED IN - 20101115 RMK
				if (isNonMember(usrGlbl)) {
					header= '<div id="toppanel"><div class="tab"><ul class="login"><li class="leftDark">&nbsp;</li><li class="middleDark"><a href="http://asq.org/store/index.html?header">Store</a></li><li class="sep middleDark">|</li><li class="middleDark"><a href="http://asq.org/store/shopping_cart.html">Shopping Cart</a></li><li class="sep middleDark">|</li><li class="middleDark"><em><a href="http://asq.org/qualityprogress/index.html">Quality Progress</a></em></li><li class="leftConnect">&nbsp;</li><li><a href="http://' + hq + 'asq.org/' + mb + 'account/manage-account.html">My Account</a></li><li class="sepL">|</li><li><a href="http://' + hq + 'asq.org/log-out.html">Log Out</a></li><li class="leftConnectBlue">&nbsp;</li><li class="middleBlue"><a href="http://' + hq + 'asq.org/membership/join-asq.html?headerJoin">Join ASQ</a></li><li class="rightBlue">&nbsp;</li></ul></div></div>' +  (hq ? '' : '<META NAME="WT.rv" CONTENT="1">') ;
					headerRight= '<div id="welcomeString">Welcome, ' + this.usrNm  + '\!</div><div id="loginText"><!--// for spacing only in logged in view //--></div>' +  (hq ? '' : '<META NAME="WT.rv" CONTENT="1">') ;
				}
				
				// UPDATED HEADER LINKS - 20100209/RMK				
				 else {
					header= '<div id="toppanel"><div class="tab"><ul class="login"><li class="leftDark">&nbsp;</li><li class="middleDark"><a href="http://asq.org/store/index.html?header">Store</a></li><li class="sep middleDark">|</li><li class="middleDark"><a href="http://asq.org/store/shopping_cart.html">Shopping Cart</a></li><li class="sep middleDark">|</li><li class="middleDark"><em><a href="http://asq.org/qualityprogress/index.html">Quality Progress</a></em></li><li class="leftConnect">&nbsp;</li><li><a href="http://' + hq + 'asq.org/' + mb + 'account/manage-account.html">My Account</a></li><li class="sepL">|</li><li><a href="http://' + hq + 'asq.org/log-out.html">Log Out</a></li><li class="leftConnectBlue">&nbsp;</li><li class="middleBlue"><a href="http://' + hq + 'asq.org/referandreward/index.html?headerRefer">Refer a Member</a></li><li class="rightBlue">&nbsp;</li></ul></div></div>' +  (hq ? '' : '<META NAME="WT.rv" CONTENT="1">') ;
					headerRight= '<div id="welcomeString">Welcome, ' + this.usrNm  + '\!</div><div id="loginText"><!--// for spacing only in logged in view //--></div>' +  (hq ? '' : '<META NAME="WT.rv" CONTENT="1">') ;
				} 

				/* else {
					header= '<span class="bluebold">Logged In as ' + this.usrNm  + '</span> <br /> <a href="http://' + hq + 'asq.org/log-out.html">Log Out</a> <img src="/img/templates/nonmember/header-member-logout.gif" />&nbsp;&nbsp;<a href="/' + mb + 'account/manage-account.html">My Account</a> <img src="/img/templates/nonmember/header-my-account.gif" />&nbsp;&nbsp; <a href="http://asq.org/store/shopping_cart.html">View Shopping Cart</a> <img src="/img/templates/nonmember/header-shopping-cart.gif" />&nbsp;&nbsp;<a href="http://asq.org/qualityprogress/index.html" target="_blank">Quality Progress Magazine</a> <img src="/img/templates/nonmember/header-qp.gif" />' +  (hq ? '' : '<META NAME="WT.rv" CONTENT="1">') ;
				} */

				
			}

			/////  MEMBERSHIP RENEWAL  

			if ( 		usrGlbl.indexOf("RNU") 				> -1 ||
						usrGlbl.indexOf("RNL") 				> -1 ||
						usrGlbl.indexOf("RND") 				> -1 
				) {

				// JR 2010-10-21  there is now also a usrGlbl.indexOf("MSC"). It stands for 'MemberSinCe'.

				var message = getRenewMessage(this.usrGlbl) ; 
				if (message.length > 0) {
					headerRight += ( '<br/>' + message ) ; 
				}
				if ( isGroup(usrGlbl) || isParticipant(usrGlbl) ) {
					if (document.getElementById('headTable') != null) {					
						document.getElementById('manage_URL').href 		= '/members/participant/manage-account.html' ;
						document.getElementById('manage_img').src 		= '/img/templates/manage-my-account.gif' ;
						document.getElementById('manage_img').alt 		= 'Manage My Account' ;
						document.getElementById('callout3_img').alt 	= 'Join ASQ' ;
						document.getElementById('callout3_img').src 	= '/img/templates/join-asq-today.gif' ;
						document.getElementById('callout3_url').href	= '/members/participant/join-asq.html' ;
						if (document.getElementById('MySectionsBlurb') != null) {					
							document.getElementById('MySectionsBlurb').style.display 	= 'block' ;
						}
						if (document.getElementById('MyNetworksBlurb') != null) {					
							document.getElementById('MyNetworksBlurb').style.display 	= 'block' ;
						}
						if (document.getElementById('MyForumsBlurb') != null) {					
							document.getElementById('MyForumsBlurb').style.display		= 'block' ;
						}
						if (document.getElementById('MyForumsBlurb') != null) {					
							document.getElementById('MyBoardsBlurb').style.display 		= 'block' ;
						}
					}
				}

				/////  BENEFITS LINK 
				if (document.getElementById('headTable') != null) {
					//document.getElementById('quality_img').src = '/img/templates/home/we-are-quality.gif' ;
					if 		( usrGlbl.indexOf("ORG")>-1 || isParticipant(usrGlbl) ) {		
						document.getElementById('benefits_URL').href = '/members/participant/benefits-enterprise.html' ;
					}
					else if 	( usrGlbl.indexOf("SUSTAINING")>-1 ) {		
						document.getElementById('benefits_URL').href = '/members/participant/benefits-site.html' ;
					}
					else if 	( usrGlbl.indexOf("SCHOOL")>-1 ||  usrGlbl.indexOf("DISTRICT")>-1 ) {		
						document.getElementById('benefits_URL').href = '/members/participant/benefits-educational.html' ;
					}
					else if 	( usrGlbl.indexOf("NON-MEMBER")>-1 ) {		
						////document.getElementById('benefits_URL').href = '' ;
					}
				}

			}

			if ( location.href.indexOf("/membership/") > -1 || location.href.indexOf("/perl/members/") > -1) {
				if ( isGroup(usrGlbl) || isParticipant(usrGlbl) || isNonMember(usrGlbl)) {
					// alert("its group or participant or NONMEMBER BCM 20 MAR");// nothing 
				}
				else {
					if (document.getElementById('membershipTabs') != null) {
						// alert("its NOT group or participant BCM 20 MAR \n " + usrGlbl);
						document.getElementById('membershipTabs').innerHTML= '<table border="0" cellspacing="0" cellpadding="0"><tr><td><a href="/membership/members/your-benefits.html" id="ym">Your Membership<br />Benefits and Features</a></td><td><a href="/membership/members/did-you-know.html" id="dyk"><br />Did You Know...?</a></td><td><a href="/membership/members/renew.html" id="renew"><br />Renew</a></td><td><a href="/membership/members/get-involved.html" id="gi"><br />Get Involved</a></td><td><a href="/members/account/membership.html" id="uym">Upgrade Your<br />Membership</a></td></tr></table>';
						document.getElementById('callouts').innerHTML= 		 '<table border="0" width="620" cellspacing="0" cellpadding="0"><tr><td width="160" align="left" valign="top" class="bluecell"><img src="/img/templates/membership/persfull-photo.jpg" alt="Jenny Persfull" width="160" height="190" /></td><td width="310" align="left" valign="top" class="whiterightborder" id="teasercell"><img src="/img/templates/membership/persfull-blurb.gif" alt="Quality is about people" width="310" height="190" /></td><td width="150" align="left" valign="top" class="bluecell"><a href="/members/account/manage-account.html"><img src="/img/templates/manage-my-account-2.gif" alt="Manage my account" width="150" height="64" border="0" /></a><a href="/member-gift/index.html"><img src="/img/templates/free-gift-membership.gif" alt="Access this months free member gift" width="150" height="64" border="0" /></a><a href="/referandreward/"><img src="/img/templates/refer-and-reward-150.gif"  alt="Refer and Reward" width="150" height="62" border="0"></a></td></tr></table>';
					}
				}
			}
			
			
			if ( location.href.indexOf("/membership/why-become-a-member/overview.html") > -1) {
				if ( isGroup(usrGlbl) || isParticipant(usrGlbl) || isNonMember(usrGlbl)) {
					// alert("its group or participant or NONMEMBER BCM 20 MAR");// nothing 
				}
				else {
					if (document.getElementById('membSwap') != null) {
						// alert("its NOT group or participant BCM 20 MAR \n " + usrGlbl);
						document.getElementById('membSwap').innerHTML= '<div id="moveOverThere"><div class="sidebar" style="float:right; background-image:none; background-color:#95B6F0 "><a href="http://asq.org/members/leadership/elections/2013-candidates.html"><strong>ASQ Selects Candidates<br />for its Board of Directors</strong></a><br /></div><p class="blueheadline"><strong>Are You Using Your Membership Benefits?</strong></p><ol><li><p><strong>Network, seek solutions, and share ideas with industry peers.<br /></strong>Your membership includes access to more than 250 local Sections and 27 Forums and Divisions &ndash; <a href="/members/communities/index.html">which do you belong to?</a></p></li><li><p><strong>Access member-discounts on ASQ products and services. <br /></strong>Members can <a href="http://asq.org/certification/fees.html" title="http://asq.org/certification/fees.html">register for certification exams for up to $180 less</a> than the list price! Save up to 40% on <a href="http://asq.org/conferences/" title="http://www.asq.org/conferences/">conferences</a>, <a href="http://www.asq.org/training/" title="http://asq.org/training/">training</a>, <a href="http://asq.org/pub/" title="http://asq.org/pub/">journals</a>, <a href="http://asq.org/quality-press/index.html" title="http://asq.org/quality-press/index.html">books and standards</a>.</p></li><li><p><strong> Search and download job specific articles, white papers and more!<br /></strong>Use our <a href="/knowledge-center/index.html">Knowledge Center</a> to explore quality topics and navigate through a vast array of quality tools and resources.</p></li><li><p><strong>Grow your profession with our practical and relevant Body of Knowledge.<br /></strong> Our <a href="/membership/benefits/qic.html">professional information specialists</a> will help you find the right quality resources from our library of articles, journals and other resources on quality and management.</p></li><li><p><strong>Stay up-to-date on the latest trends in quality with your subscription to <em><a href="/qualityprogress/index.html" target="_blank">Quality Progress magazine.<br /></a></em></strong> All members receive ASQ&rsquo;s monthly flagship publication, which brings you the latest thinking on quality from industry experts, plus terrific features like the annual <a href="/pub/qualityprogress/salary_survey/">Salary Survey</a>.</p></li><li><p><strong>Levels of membership are flexible &ndash; as you grow professionally, <a href="/membership/individuals/overview.html">your membership can evolve with you</a>.<br /></strong> We also offer <a href="/membership/individuals/senior.html">advanced levels of membership</a> for current members who serve as ASQ leaders.</p></li><li><p><strong>ASQ Membership identifies you as someone who strives for excellence and seeks to Make Good Great&reg;.<br /></strong> Join the <a href="/communities/economic-case/index.html">Economic Case for Quality&reg; Network</a>: Learn best practices and promote the use of quality in your organization.</p></li><li><p><strong>ASQ has been the world&rsquo;s leading authority on quality for the past 60 years, and will be for generations to come.<br /></strong> Quality tools and techniques are moving beyond their historic base in <a href="/manufacturing/why-quality/overview.html">manufacturing</a> and taking root in <a href="/education/why-quality/overview.html">education</a>, <a href="/services/why-quality/overview.html">service</a>, <a href="/healthcare-use/why-quality/overview.html">healthcare</a> and <a href="/government/why-quality/overview.html">government</a>. We&rsquo;ve only just begun.</p></li><li><p><strong> Take advantage of ASQ&rsquo;s proven resources to prepare you for <a href="/certification/">certification</a>.</strong><br />ASQ offers the best <a href="/training/topics/certification-preparation.html">training</a>, <a href="/quality-press/search-results/index.html?page=category&category=7aaaCertification">books</a> and <a href="/training/formats/web-based/certification-preparation.html">e-learning solutions</a> to help you prepare for and pass each ASQ certification exam.</p></li></ol></div>';
						document.getElementById('acrossPage').innerHTML= 		 '<div class="sectiontitle">Your Membership Benefits</div>';
						document.getElementById('subLeftNav').innerHTML= 		 '<div id="pushMeOver"><div id="leftsubnav"><ul><li id="mh"><a href="/index.html">My ASQ Home</a></li><li id="ayb"><a href="/members/account/benefits.html">Access Benefits</a></li><li id="ram"><a href="/referandreward/">Refer a Member</a></li><li id="mo"><a href="/membership/organizations/overview.html">Membership for Your Organization</a></li></ul><div class="sectiontitle">Manage My Account </div><ul><li id="ca"><a href="/members/account/change_address" target="_blank">Change Contact Information </a></li><li id="um"><a href="/members/account/membership.html">Upgrade Membership</a></li><li id="cp"><a href="/perl/members/chpd.pl?login=1">Change Password</a></li><li id="up"><a href="/members/account/build_profile_main.html">Update Profile</a></li><li id="cs"><a href="https://secure.asq.org/ecommerce/changesection/execute/loginSetup" target="_blank">Change Section</a></li></ul></div></div>';
						
					}
				}
			}

			
			if ( location.href.indexOf("/global/") > -1) {
				if ( isGroup(usrGlbl) || isParticipant(usrGlbl) ) {
					// nothing 
				}
				else {
					if (document.getElementById('mainText') != null) {
						document.getElementById('mainText').innerHTML= '<p class="blueheadline">Take Advantage of Your ASQ Member Benefits!</p><p><strong><a href="/members/">My ASQ</a></strong> &ndash; Access the online member community. Find information tailored to your needs. Connect with members in your industry or area.</p><p><strong><a href="/members/news/newsletters/gazeta/index.html"><em>Gazeta Global</em></a></strong> &ndash; Read the current issue of this electronic newsletter written specifically for international members like you. There is also an archive of past issues.</p><p><strong><a href="/discuss/">International Quality Discussion Board</a></strong> &ndash; Discuss quality from an international perspective. Topics of discussion might include multinational operations, international standards, or even cultural and economic considerations as they impact the application of quality principles.</p>';
						document.getElementById('promoBoxes').innerHTML= 		 '';
						document.getElementById('secondaryNav').innerHTML= '<ul><li id="o"><a href="/global/membership/overview.html">Your Benefits</a></li><li id="m"><a href="/members/index.html">My ASQ</a></li></ul>';
					}
				}
			}
			
			
			if ( location.href.indexOf("/advocacy/") > -1) {
				if ( isGroup(usrGlbl) || isParticipant(usrGlbl) ) {
					// nothing 
				}
				else {
					if (document.getElementById('mainText') != null) {
						document.getElementById('mainText').innerHTML= '<p class="blueheadline">Network</p><p><strong>Quality Networks:</strong> You can <a href="/advocacy/network/my-networks.html">access the ASQ Networks you&#8217;ve already selected</a>. Or you can <a href="/communities/">peruse all the networks</a> to see if it&#8217;s time to join a new one.</p><p><strong><a href="/advocacy/network/my-sections.html">Your ASQ Sections:</a></strong> Get in touch with your local section and get involved.</p><p><strong><a href="http://asq.org/java_members/calendar/submitEvent.jsp">Create an Event:</a></strong> Are you organizing an ASQ-related event? We&#8217;ll help you spread the word.</p><p><strong><a href="http://hq.asq.org/discuss/">ASQ&#8217;s Interactive Community:</a></strong> Online options for connecting with others who share your interest in advocating quality.</p><p><strong>Help Us Make a Difference:</strong> Learn more about the power of quality, so you can more effectively carry the message to your peers and community.</p><ul class="bulletOrange"><li><a href="/learn-about-quality/cost-of-quality/overview/overview.html">The Cost of Quality:</a> Actually, it&#8217;s <em>not</em> having quality that costs us. Here&#8217;s a basic primer on the concept.</li><li><a href="/economic-case/">Making the Case for Quality:</a> Get an executive-level look at how quality pays in any organization and how to "make the case" for quality in your organization. Includes resources you can put to work immediately.</li></ul>';
						document.getElementById('promoBoxes').innerHTML= 		 '';
						document.getElementById('secondaryNav').innerHTML= '<ul><li id="o"><a href="/advocacy/network/">Overview</a></li><li id="n"><a href="/advocacy/network/my-networks.html">Quality Networks</a></li><li id="s"><a href="/advocacy/network/my-sections.html">Your ASQ Section</a></li><li id="ce"><a href="http://asq.org/java_members/calendar/submitEvent.jsp">Create Event</a></li><li id="ic"><a href="http://asq.org/discuss/">Interactive Community</a></li><li id="cq"><a href="/learn-about-quality/cost-of-quality/overview/overview.html">Cost of Quality</a></li><li id="cfq"><a href="/economic-case/">Case for Quality</a></li></ul>';
					}
				}
			}
			
			
// show adding voices to members on microsite *******************************************************************************************
			
			if ( location.href.indexOf("/voice-of-quality/") > -1) {
				if ( isGroup(usrGlbl) || isParticipant(usrGlbl) ) {
					// nothing 
				}
				else {
					if (document.getElementById('seeAddVoice') != null) {
						document.getElementById('seeAddVoice').innerHTML= '<article class="postIndent"><header><h1>&nbsp;Adding New Voices</h1></header><p>ASQ Full, Senior, and Fellow members were given the chance to give the gift of a six-month, no-cost membership to colleagues through the Adding New Voices Program. The quality community eagerly embraced the opportunity. Five thousand gifts were given during World Quality Month in November 2010. Thank you to those members who participated in raising the voice of quality throughout the world!</p><img class="bottomEdge" src="/voice-of-quality/img/post-indent-bottom-edge.jpg" width="880" height="24"></article>';
						
					}
				}
			}
			
			
			
// My ASQ sub-menu when logged in *******************************************************************************************
			
			
			//alert("JR tempo.." + "isNonMember(usrGlbl): " + isNonMember(usrGlbl) + usrGlbl);
			if ( isGroup(usrGlbl) ) {
					// nothing 
			}
			
			
			else if ( isParticipant(usrGlbl) ) { //show Manage Account sub menu and registered user links
				if (document.getElementById('myMenu')){
					document.getElementById('myMenu').style.display='block';
					};
				
			}
			
			else {
				if (document.getElementById('myMenu')){ //show My ASQ sub menu and member links
					document.getElementById('myMenu').style.display='block';
					};
				
			}
			
			
			document.getElementById('loginarea').innerHTML = header ;
			document.getElementById('headerTabs2').innerHTML = headerRight ; // 20100208/RMK - ADDED FOR NEW HEADER LINKS


		}
		//dsplCommentPrompt();
	}
	
	//Changes left nave links based on hq ================================================================================================================
	if (hq == "hq.") {
	$("a[href^='http://asq.org']")
	   .each(function()
	   { 
		  this.href = this.href.replace(/^http:\/\/asq\.org/,"http://www.hq.asq.org");
	   });
	}

	
} // end of dsplLgn


// added for enterprise member names to show on My ASQ - rmk 20091109

function orgNameplate(){
	
	var whoThis = '';
	
	if ( this.CO && this.CO != "") {	
	//alert("YES: ORG name assigned in cookie");
		whoThis = 
		'<h2>My ASQ - Access to Your Membership</h2>' +
		'<p class="orgMemText">As an employee of ' + this.CO  + ', you have access to:</p>' ;	
                                   
		if (whoThis) {
			document.getElementById('orgMessageBox').innerHTML = whoThis ; 
        }

                 
	}
	else {
	//alert("NO: You have no ORG name assigned in cookie");
	  		whoThis = 
			'<h2>My ASQ - Access to Your Membership</h2>' +
			'<p>These membership tours show you how to:</p>' ;
		if (whoThis) {
			document.getElementById('orgMessageBox').innerHTML = whoThis ; 
        }
  
	}


}



// added for customer records login state for the upper right login box 20090618 rmk
function logBox(){

	var loginBox1 = '';

	if 		(typeof(mbType) == 'undefined') { } 
	else if (mbType.indexOf("NON-MEMBER") > -1 || mbType.indexOf("PARTICIPANT") > -1 ) {
		loginBox1 = 
			'<div id="regUserLogBox">' +
			'<h3>Your ASQ registration gives you:</h3>' +
			'<ul><li><a href="/account/manage-account.html">Account management</a></li>' +
			'<li>Quicker article access</li>' +
			'<li>Easier purchasing</li></ul>' +
			'<p>Need more from ASQ? <a href="/membership/benefits/index.html">Join ASQ today!</a></p>' +
            '</div>' ;

	}
	else {
		loginBox1 = 
			'<p>Member View</p>' +
            '<br />' ;
 
	}

	if (loginBox1) {
		document.getElementById('seeStatus').innerHTML = loginBox1 ; 
	}
	

}



// added for customer records login state for the left nav 20090618 rmk
function personalizeNav(){

	var htmlSnippet3 = '';

	if 		(typeof(mbType) == 'undefined') { } 
	else if (mbType.indexOf("NON-MEMBER") > -1 || mbType.indexOf("PARTICIPANT") > -1 ) {
		htmlSnippet3 = 
			'<h2><a href="http://' + hq + 'asq.org/account/manage-account.html"><img class="qualityBy" src="/img/templates/shared/manage-account.jpg" alt="Manage Account" width="160" height="29" border="0" /></a></h2>' +			
			'<ul class="blue">' +
			'<li><a href="http://' + hq + 'asq.org/account/my-certification.html">My Certifications</a></li>' +
			'<li><a href="http://' + hq + 'asq.org/account/my-news.html">My News</a></li>' +
			//'<li><a href="/account/my-saved-articles.html">My Saved Articles</a></li>' +
			'<li><a href="http://' + hq + 'asq.org/perl/members/bookmarks.pl?action=viewbookmarks&ctx=myasq">My Saved Articles</a></li>' +
			'<li><a href="http://' + hq + 'asq.org/account/my-communities.html">My Communities</a></li>' +
			'<li><a href="http://' + hq + 'asq.org/account/manage-account.html">My Account</a></li>' +
			'<li><a href="http://' + hq + 'asq.org/membership/individuals/overview.html">Join ASQ</a></li>' +
			'</ul>';

	}
	else { //My ASQ links
		htmlSnippet3 = 
			'<h2><a href="http://' + hq + 'asq.org/members/index.html"><img class="qualityBy" src="/img/templates/shared/my-member-site.jpg" alt="My ASQ" width="160" height="29" border="0" /></a></h2>' +			
			'<ul class="blue">' +
			'<li><a href="http://' + hq + 'asq.org/members/certification/index.html">My Certifications</a></li>' +
			'<li><a href="http://' + hq + 'asq.org/members/news/index.html">My News</a></li>' +
			'<li><a href="http://' + hq + 'asq.org/perl/members/bookmarks.pl?action=viewbookmarks&ctx=myasq">My Saved Articles</a></li>' +
			'<li><a href="http://' + hq + 'asq.org/members/communities/index.html">My Communities</a></li>' +
			'<li><a href="http://' + hq + 'asq.org/members/account/manage-account.html">My Account</a></li>' +
			'</ul>';
 
	}

	if (htmlSnippet3) {
		document.getElementById('snippet3').innerHTML = htmlSnippet3 ; 
	}

	
}








function getRenewMessage(usrGlbl) {
	var mths = new Array('','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
	var message = '';
	if ( document.cookie.indexOf("10.1.7.144") > -1) {
		//alert(usrGlbl);
	}
	if (usrGlbl.indexOf("~RN") > -1 ) {
		var ren = usrGlbl.substring(usrGlbl.indexOf("~RN")+1,usrGlbl.indexOf("~RN")+14);
//alert(ren);
//alert(ren);

		if ( ren != null && ren.length > 0) {
					
			var arrayRnDt = (ren.substring(3)).split("/");
			var mm 		= arrayRnDt[0];
			var m 		= mm.substring(0,1) == '0' ? mm.substring(1) : mm ;
			var dd 		= arrayRnDt[1];
			var d 		= dd.substring(0,1) == '0' ? dd.substring(1) : dd ;
			var yyyy 	= arrayRnDt[2];
			var yyyy2 	= parseInt(yyyy)+1;
			var formattedDate = mths[parseInt(m)] + ' ' + dd + ', ' + yyyy ;
//alert(yyyy);
//alert(yyyy2);
			// RNU ReNew Unpaid 
			// I don't think we need this because what membership wants to show is if the membership WILL EXPIRE, not if it ALREADY expired - Barry Mitchell 4/21/2008
			if ( 	 ren.indexOf("RNU") > -1) {

				var beginDate = new Date(yyyy,m-1,d);
				var currDate  = new Date();
				nbDaysSinceBeginDate = Math.round( (currDate-beginDate) / (1000*3600*24) ) ;

				var expiredMessage = nbDaysSinceBeginDate + ' days ago';

				if ( document.cookie.indexOf("10.1.7.") > -1) {
					if 		(nbDaysSinceBeginDate > 90) { expiredMessage = '+90 days ago '	}
					else if (nbDaysSinceBeginDate > 30) { expiredMessage = '+30 days ago ' 	}
					else if (nbDaysSinceBeginDate >  0) { expiredMessage = 'recently '		}
				}
				
				message = '<div id="renewString2">Your membership has expired. <a href="/membership/renew.html"><strong>RENEW NOW!</strong></a></div>' ;
			}
			// RNL ReNewaL
			// I borrowed code from above and switched it around to show messages to memberships who WILL EXPIRE - Barry Mitchell
			if (ren.indexOf("RNL") > -1) {
				
				var expiredMessage;
				var beginDate = new Date(yyyy,m-1,d);
				var currDate = new Date();
				
				nbDaystilRenewDate = Math.round( (beginDate-currDate) / (1000*3600*24) ) ;
				var everyThing = ren + ', ' + beginDate + ', ' + currDate + ', ' + nbDaystilRenewDate;
				//alert(everyThing);


					if 		(nbDaystilRenewDate <  1) { expiredMessage = '<div id="renewString2">Your membership has expired. <a href=\"/membership/renew.html\" class=\"ulined\"><strong>RENEW NOW</strong></a>.</div>'		}
					else if (nbDaystilRenewDate < 30) { expiredMessage = '<div id="renewString2">Your membership will expire on ' + formattedDate + '. <a href=\"/membership/renew.html\" class=\"ulined\"><strong>RENEW NOW</strong></a> to avoid interrupting your <a href=\"/membership/benefits/index.html\" class=\"ulined\">benefits</a>.</div>' 	}
					else if (nbDaystilRenewDate < 90) { expiredMessage = '<div id="renewString2">Your membership will expire in less than 90 days. <a href=\"/membership/renew.html\" class=\"ulined\"><strong>RENEW NOW!</strong></a></div>' }
					if (expiredMessage != null) {
				  message = expiredMessage ;}
				  	//else {
						//everyThing = everyThing + 'This is from within RNL.';
						//alert(everyThing);
						//}
			}
			// RND ReNeweD
			else if ( ren.indexOf("RND") > -1 ) {
				   message = '<div id="renewString2">Membership Renewed ' + formattedDate + '. Thank you.</div>';
			} 
			if ( document.cookie.indexOf("10.1.7.144") > -1) {
				//alert(usrGlbl);
			}
		}
	}

	if ( message.indexOf("undefined") > -1) { 
		message = '' ;
	}
	if (message != null){
	return message;}
	//else { everyThing = everyThing + 'This is from end of getRenewMessage.'
	//alert(everyThing);
		//}
}


function getPublMessage(usrGlbl) {
	var publDirName = location.href.substring(location.href.indexOf("/pub/")+5,location.href.lastIndexOf("/") ) ; 
	var usrBnefName;
	if (publDirName == 'qualityprogress'){
		publDirname = 'QP';
	}
	else if (publDirName == 'sixsigma'){
		publDirname = 'SSF';
	}
	return '<br>' + publDirName;
}

function decode(encStr) {
  var bits, decOut = '', i = 0;
  for(; i<encStr.length; i += 4){
    bits =
     (bsf.indexOf(encStr.charAt(i))    & 0xff) <<18 |
     (bsf.indexOf(encStr.charAt(i +1)) & 0xff) <<12 | 
     (bsf.indexOf(encStr.charAt(i +2)) & 0xff) << 6 |
      bsf.indexOf(encStr.charAt(i +3)) & 0xff;
    decOut += String.fromCharCode(
     (bits & 0xff0000) >>16, (bits & 0xff00) >>8, bits & 0xff);
    }
  if(encStr.charCodeAt(i -2) == 61)
    undecOut=decOut.substring(0, decOut.length -2);
  else if(encStr.charCodeAt(i -1) == 61)
    undecOut=decOut.substring(0, decOut.length -1);
  else undecOut=decOut;
  
  return unescape(undecOut);		//line add for chinese char
}

var gAutoPrint = true; // Flag for whether or not to automatically call the print function
function printFriendly()
{
	if (document.getElementById != null)
	{
		var html ;
		if (location.href.indexOf("/qualityprogress/") > -1) {
			html = '<HTML>\n<HEAD><link rel=\"stylesheet\" href=\"/quality_progress/qp-templates/includes/print.css\" type=\"text/css\"><style>#articleThumbs img {width:auto;height:auto;border:none;}</style>\n';
			html += '\n</HEAD>\n<BODY><table border=0 cellspacing=0 cellpadding=0 align=right><tr><td width=140 valign=top><img src=\"/quality_progress/qp-templates/img/logo-140x90-bw.gif\" border=0></td></tr></table>\n';
		}
		else {
			html = '<HTML>\n<HEAD><link rel=\"stylesheet\" href=\"/includes/global.css\" type=\"text/css\"><link rel=\"stylesheet\" href=\"/includes/audience.css\" type=\"text/css\">\n';
			html += '\n</HEAD>\n<BODY style=\"font: 11px/13px verdana, arial, sans-serif\"><table border=0 cellspacing=0 cellpadding=0 align=right><tr><td width=69 valign=top><img src=\"/img/templates/shared/asq_logo_s.gif\" border=0></td></tr></table>\n';
		}

		if (document.getElementById("printFriendly")) {
			var printPageElem = document.getElementById("printFriendly");
		}
		else if (document.getElementById("contentmiddlenorightorleft")) {
			var printPageElem = document.getElementById("contentmiddlenorightorleft");
		}
		else if (document.getElementById("contentmiddlenoright")) {
			var printPageElem = document.getElementById("contentmiddlenoright");
		}
		else if (document.getElementById("main")) {
			var printPageElem = document.getElementById("main");
		}
		
		
		
		if (printPageElem != null)
		{
				html += printPageElem.innerHTML;
		}
		else
		{
			alert("Could not find the printFriendly section in the HTML");
			return;
		}
			
		html += '\n<table width=95% border=0 cellspacing=0 cellpadding=5 align=center><tr><td><hr>Copyright &copy; 2005-2008 American Society for Quality. All rights reserved.<br>Republication or redistribution of ASQ content is expressly prohibited without the prior written consent.<br>ASQ shall not be liable for any errors in the content, or for any actions taken in reliance thereon.</td></tr></table></BODY>\n</HTML>';
		
		var printWin = window.open("","printFriendly");
		printWin.document.open();
		printWin.document.write(html);
		printWin.document.close();
		if (gAutoPrint)
			printWin.print();
	}
	else
	{
		alert("Sorry, the printer friendly feature works\nonly in javascript enabled browsers.");
	}
}

function openNewWindow(theURL,winName,features) {
    			window.open(theURL,winName,features);
}

function isGroup(usr){
	if 	( 	usr.indexOf("ORG") 			> -1	|| 
			usr.indexOf("SCHOOL") 		> -1 	|| 
			usr.indexOf("SUSTAINING") 	> -1	||
			usr.indexOf("DISTRICT") 	> -1 ) {
		return true;
	}
}

function isParticipant(usr) {
	if 	( usr.indexOf("PARTICIPANT") >-1 ) {
		return true;
	}
}

function isNonMember(usr) {
	if 	( usr.indexOf("NON-MEMBER") >-1 ) {
		return true;
	}
	else {
		return false;
	}
}

function dsplCommentPrompt() {
	// now handled at server level 
	if (document.getElementById('linkorform') != null) {
		document.getElementById('linkorform').innerHTML = 
		'<div id="addComment"><hr>' + 
		'<form name="commentform" id="commentform" method="POST" action="/perl/members/comments.pl?action=comment" />' +
		'<p><label for="#">Name</label> <input type="text" name="cusname" size="40" /> <em><br />(required)</em></p> ' + 
		'<p><label for="#">Email</label> <input type="text" name="email" size="40" /> <em><br />(required, but will not be published)</em></p> ' +
		'<p><label for="#">Thoughts and Comments</label><br /><textarea name="comments" cols="60" rows="8"></textarea></p> ' +
		'<p><input type="submit" value="Submit" /></p> ' +
		'</form> </div>';
	}
}

function inSmallWindow(theUrl,param1,param2) {
	window.open(theUrl,"commentconfirm","width=435,height=435");
}

//outage message script to be called by specialMessage() in header.html
//BCM 18 DEC 2008

var today = new Date();
var active_date = new Date("December 17, 2010");
var expiration_date = new Date("January 3, 2011");
expiration_dateStr = expiration_date.toUTCString();

//here
function setCookie(cookieName, cookieValue, cookieExpires, cookiePath, cookieDomain)  
{
	cookieValue = escape(cookieValue);
	document.cookie = cookieName + "=" + cookieValue + "; expires=" + cookieExpires + "; path=" + cookiePath + "; domain=" + cookieDomain;
}
// here


function getCookie(name)
{ 
	var cookieString = document.cookie;
	var index = cookieString.indexOf(name + "=");

	if (index == -1)
		{ return null; }

	index = cookieString.indexOf("=", index) + 1;
	var endstr = cookieString.indexOf(";", index);

	if (endstr == -1) 
		{ endstr = cookieString.length; }

	return unescape(cookieString.substring(index, endstr));
}


function specialMessage()
{ 
	if (today <= expiration_date) {
		//alert('its earlier than ' + expiration_date);
		if (today >= active_date) {
			//alert('its after ' + active_date);
			var pagesviewed = getCookie('SpecialMessage');
			if (pagesviewed != 'shown') // if the user has seen the popup do not show it again.
				{ 
					window.open("/office-closed-message.html","survey","menubar=no,width=495,height=225,toolbar=no");
					document.cookie = 'SpecialMessage=shown;expires=' + expiration_dateStr + ';path=/;domain=asq.org';
				}
		}
		//else { alert('its before ' + active_date); }
	}
	//else { alert('its after ' + expiration_date); }
}


// *** toggle for article shell forms ***


/* TURNED OFF TO TEST HEADER IN IE6 - RMK 20100318
======================================================================= 

var isMIE = 0;

function detectBrowser() //detectBrowser() is available for anyuse
{
var browser=navigator.appName;
var b_version=navigator.appVersion;
var version=parseFloat(b_version);
if (browser=="Microsoft Internet Explorer") {
	 isMIE = 1;
	 }
}

======================================================================= 
*/


// the following sets up toggle for form

if (document.getElementById('formSwitch')){
document.getElementById('formSwitch').onclick = toggleForm;
document.getElementById('formBlock').style.display = 'none';
}
if (document.getElementById('formSwitch2')){
document.getElementById('formSwitch2').onclick = toggleForm;
document.getElementById('formBlock').style.display = 'none';
}

var thehiddenForm = document.getElementById('formBlock');

function toggleForm(){

	if (isMIE == 1){

		if (thehiddenForm.style.display == 'inline-block') {
			thehiddenForm.style.display = 'none';

		} else {
			thehiddenForm.style.display = 'inline-block';
		}
	} else {
		if (thehiddenForm.style.display == 'block') {
			thehiddenForm.style.display = 'none';

		} else {
			thehiddenForm.style.display = 'block';

		}
	}

}

// the following is a generic strip of special characters
function stripHTML(string) { 
    return string.replace(/<(.|\n)*?>/g, ''); 
}

// the following is a generic cookie check for login, any member type
function checkLogin() {
	 if ( document.cookie.indexOf("qazqsa29") > -1 || document.cookie.indexOf("nonmsa29") > -1 || document.cookie.indexOf("qazqsa19")  > -1 ) {  
	 	isLoggedIn = 1	;
        }
	//alert (isLoggedIn);
}

function checkLogin2() {
	 if ( document.cookie.indexOf("qazqsa29") > -1 || document.cookie.indexOf("nonmsa29") > -1 || document.cookie.indexOf("qazqsa19")  > -1 ) {  
	 	isLoggedIn = 1	;
        }
	else {
	 	isLoggedIn = 0	;
	}
	//alert (isLoggedIn);
}

function loginToggle(someid){
	//alert('loginToggle ' + someid);
	if (isLoggedIn)	{
		document.getElementById(someid).innerHTML = "<strong>something</strong>";
	}
}

function checkSurvey() 
{ 
	var pagesviewed = getCookie('ASQClickSurvey01'); 
	if (pagesviewed != 'taken') // if the user has seen the popup do not show it again.
	{ 
	
		parseInt(pagesviewed);
		if (pagesviewed >= 5) 
		{ 
			window.open("/includes/surveys/click-survey-intro.html","survey","menubar=no,width=500,height=300,toolbar=no");
			document.cookie = 'ASQClickSurvey01=taken;expires=' + dontExpire + ';path=/;domain=asq.org';
		}
		
		else
		{
			parseInt(pagesviewed); 
			pagesviewed++;
			document.cookie = 'ASQClickSurvey01=' + pagesviewed + ';path=/;domain=asq.org';
		}
	}		
}

// Email validation -  Checks for exact match between emails
function compareEmails(){
	if(document.form.email.value!=document.form.email_validate.value){
	 alert("Sorry, your e-mail addresses do not match.");
		return false;
	}
	else{return true;}
}

