// CHANGED ON 5/15/2008 by dsemrow
// fixed to work in IE6 by Leo Pellerin 9/30/09
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function makeButtons() {
	output += '<table border="0" width="100%" cellpadding="0" cellspacing="0"><tr>';
	output += '<td><a href="'+PSSL+'WSCPRF2A?SESSION='+session+'&TABS='+tabsIn+'&LOGO='+logo+'&LINKBACK='+linkback+'"><img border="0" src="images/cust_access/butact.gif" width="94" height="21" alt="my account"></a></td>';
	// output += '<td><a href="'+SSL+'cust_access_asp/help_new/help_center.asp?SESSION='+session+'&TABS='+tabsIn+'&LOGO='+logo+'&LINKBACK='+linkback+endURL+'"><img border="0" src="images/cust_access/buthelp.gif" alt="learning center" width="118" height="21"></a></td>';
	//if (tabsPatents > 0) output += '<td><a href="'+PSSL+'WNDCHECK?SESSION='+session+'"><img border="0" src="images/cust_access/patcart.gif" alt="patent cart" width="102" height="21"></a></td>';
	//if (tabsDocuments > 0) output += '<td><a href="'+goPHP+'cust_access/cadirect.php?SESSION='+session+'&method=cart.view"><img border="0" src="images/cust_access/doccart.gif" alt="document cart" width="124" height="21"></a></td>';
	(linkback) ? output += '<td><a href="javascript:logOff(\''+linkback+'\')">' : output += '<td><a href="javascript:logOff(\'http://www.nerac.com\')">';
	output += '<img border="0" src="images/cust_access/butlog.gif" width="64" height="21" alt="log off"></a></td>';
	output += '</tr></table>';
    writeOutput();
}


function makeCATabs() {
	output += '<div id="subnav" style="width:1024px;">';
	output += '<ul class="subnav">';
	output += '<li class="dropdown"><a href="'+goPHP+'cust_access/camain.php?q=1&SESSION='+session+'" class="menu-toggle">home</a>';
	output += '</li>';
	output += '<li class="dropdown"><a class="menu-toggle">research</a>';
	output += '<ul>';
	output += '<li><a href="'+goPHP+'cust_access/srch_select_black2.php?q=1&SESSION='+session+'" class="button">research request</a></li>';
	output += '<li><a href="'+goPHP+'cust_access/ncp/index.php?SESSION='+session+'&method=ca.reportlist&map=RTN&noCache='+(new Date()).valueOf()+'" class="button">inbox</a></li>';
	output += '</ul>';
	output += '</li>';
	//output += '</ul>';
	//output += '</div>';
	//output += '<div style="position:relative;margin-left:200;">';
	//output += '<div id="subnav">';
	//output += '<ul class="subnav" style="position:relative;margin-left:200px;">';
	output += '<li class="dropdown"><a class="menu-toggle">alerts</a>';
	output += '<ul>';
	output += '<li><a href="'+goPHP+'cust_access/srch_select_black2.php?q=0&SESSION='+session+'" class="button">start an alert</a></li>';
  output += '<li><a href="'+PSSL+'WNDTTM1?session='+session+'&stitem=1&cat=ALL&map=TT" class="button">inbox</a></li>';
	output += '</ul>';
	output += '</li>';
	output += '<li class="dropdown"><a class="menu-toggle">patents</a>';
	output += '<ul>';
	output += '<li><a href="'+PSSL+'WPIMNU2?SESSION='+session+'&OPTION=SINGLE" class="button">order patents</a></li>';
	output += '<li><a href="'+PSSL+'WNDCHECK?SESSION='+session+'" class="button">patent cart</a></li>';
	output += '<li><a href="'+PSSL+'WNDHIST?SESSION='+session+'" class="button">patent history</a></li>';
	output += '<li><a href="'+goPHP+'cust_access/optipat.php">file wrappers</a></li>';
	output += '</ul>';
	output += '<li class="dropdown"><a class="menu-toggle" style="width:396px; background-color:#333366; background-image:none;"></a>';
	output += '</li>';
	output += '</ul>';
	output += '</div>';
	//output += '</div>';
  	writeOutput();
}

function makeNewButtons() {
	output += '<table width="850" cellpadding="0" cellspacing="0" border="0"><tr>';
	output += '<td align="left"><span style="color:#dd9201; font-family:arial; font-size:11px; font-weight: bold;">[</span>&nbsp;<a class="searchlink" href="'+goPHP+'cust_access/camain.php?q=1&SESSION='+session+'">MyNerac Home</a>&nbsp;<span style="color:#dd9201; font-family: arial; font-size:11px; font-weight: bold;">]</span>&nbsp;&nbsp;';
	output += '<span style="color:#dd9201; font-family:arial; font-size:11px; font-weight: bold;">[</span>&nbsp;<a class="searchlink" href="'+goPHP+'cust_access/srch_select_black2.php?q=1&SESSION='+session+'">Request Research</a>&nbsp;<span style="color:#dd9201; font-family: arial; font-size:11px; font-weight: bold;">]</span>&nbsp;&nbsp;';
	output += '<span style="color:#dd9201; font-family:arial; font-size:11px; font-weight: bold;">[</span>&nbsp;<a class="searchlink" href="'+goPHP+'cust_access/srch_select_black2.php?q=0&SESSION='+session+'">Start an Alert</a>&nbsp;<span style="color:#dd9201; font-family: arial; font-size:11px; font-weight: bold;">]</span>&nbsp;&nbsp;';
	output += '<span style="color:#dd9201; font-family:arial; font-size:11px; font-weight: bold;">[</span>&nbsp;<a class="searchlink" href="'+PSSL+'WNDCHECK?SESSION='+session+'">Patent Cart</a>&nbsp;<span style="color:#dd9201; font-family: arial; font-size:11px; font-weight: bold;">]</span>&nbsp;&nbsp;';
	output += '<span style="color:#dd9201; font-family:arial; font-size:11px; font-weight: bold;">[</span>&nbsp;<a class="searchlink" href="'+goPHP+'cust_access/ncp/index.php?SESSION='+session+'&method=ca.reportlist&map=RTN&noCache='+(new Date()).valueOf()+'">Research Inbox</a>&nbsp;<span style="color:#dd9201; font-family: arial; font-size:11px; font-weight: bold;">]</span>&nbsp;&nbsp;';
	output += '<span style="color:#dd9201; font-family:arial; font-size:11px; font-weight: bold;">[</span>&nbsp;<a class="searchlink" href="'+PSSL+'WNDTTM1'+tmpURL+'ALL&MAP=TT">Alerts Inbox</a>&nbsp;<span style="color:#dd9201; font-family: arial; font-size:11px; font-weight: bold;">]</span>&nbsp;&nbsp;';
	output += '<span style="color:#dd9201; font-family:arial; font-size:11px; font-weight: bold;">[</span>&nbsp;<a class="searchlink" href="'+PSSL+'WSCPRF2A?SESSION='+session+'&TABS='+tabsIn+'&LOGO='+logo+'&LINKBACK='+linkback+'">My Account</a>&nbsp;<span style="color:#dd9201; font-family: arial; font-size:11px; font-weight: bold;">]</span>&nbsp;&nbsp;';
	output += '<span style="color:#dd9201; font-family:arial; font-size:11px; font-weight: bold;">[</span>&nbsp;';
	(linkback) ? output += '<a class="searchlink" href="javascript:logOff(\''+linkback+'\')">' : output += '<a class="searchlink" href="javascript:logOff(\'http://www.nerac.com\')">';
	output += 'Log Off</a>&nbsp;<span style="color:#dd9201; font-family: arial; font-size:11px; font-weight: bold;">]</span></td>';
	output += '</tr></table>';
	writeOutput();
}

function makeFooter_old() {
	output += '<div style="background-color:#000000; border-top: 1px solid #666666; border-bottom: 1px solid #666666; height:150px; display: block; float: left; position:relative; width:1024px;"></div>';
	output += '<div id="footer" style="position:relative; overflow:hidden; height:250px; margin-top:0px;">';
	output += '<div id="footer-columns">';
	output += '<div id="f-newbottom">';
	output += '<div class="fb-row">';
	output += '<span>[ </span>';
	output += '<a href="http://devweb.nerac.com/php/cust_access/camain.php">home</a>';
	output += '<span> ]&nbsp;&nbsp;&nbsp;[ </span>';
	output += '<a href="http://www.nerac.com/">nerac.com</a>';
	output += '<span> ]&nbsp;&nbsp;&nbsp;[ </span>';
	output += '<a href="http://www.nerac.com/img/Nerac-privacypolicy08.pdf">privacy statement</a>';
	output += '<span> ]&nbsp;&nbsp;&nbsp;[ </span>';
	output += '<a href="http://www.nerac.com">log-off</a>';
	output += '<span> ] </span>';
	output += '</div>';
	output += '<div class="fb-row">';
	output += '<p>(c) 2009 All Rights Reserved. Nerac Headquarters  - One Technology Drive - Tolland, CT 06084 - 1.860.872.7000</p>';
	output += '</div></div></div></div><!-- end footer -->';
	writeOutput();
}

function makeFooter() {
	output += '<br clear="both" />';
	output += '<div style="position:relative">';
	output += '<!-- start footer -->';
	output += '<div id="footer" style="position:relative; overflow:visible; margin-top:20px;">';
	output += '<div id="footer-columns">';
	output += '<div class="footer-column fc-spacer-left"></div>';
	output += '<div class="footer-column" id="footer-column-a"><div class="fc-content">';
	output += '<br><br><br><br><br>';
	output += '</div><!-- fc-content --></div><!-- footer-column -->';
	output += '<div class="footer-column " id="footer-column-b"><div class="fc-content"></div><!-- fc-content --></div><!-- footer-column -->';
	output += '<div class="footer-column " id="footer-column-c"><div class="fc-content"></div></div>';
	output += '<br clear="both" />';
	output += '<div style="position:relative;border-top: 1px solid #666666;width:1010px;">';
	output += '<div style="position:relative;margin-left:10px;z-index:+10px;">';
	output += '<font class="footerlink"> [&nbsp;</font>';
	output += '<a class="footerlink" href="'+goPHP+'cust_access/camain.php">Home</a>';
	output += '<font class="footerlink"> ] &nbsp;&nbsp;&nbsp;[ </font>';
	output += '<a class="footerlink" href="http://www.nerac.com/">nerac.com</a>';
	output += '<font class="footerlink"> ] &nbsp;&nbsp;&nbsp;[ </font>';
	output += '<a class="footerlink" href="http://www.nerac.com/img/Nerac-privacypolicy08.pdf">Privacy statement</a>';
	output += '<font class="footerlink"> ] &nbsp;&nbsp;&nbsp;[ </font>';
	output += '<a class="footerlink" href="'+goPHP+'cust_access/contact_us.php">Contact us</a>';
	output += '<font class="footerlink"> ] &nbsp;&nbsp;&nbsp;[ </font>';
	if (linkback != "")
	 {
	 output += '<a class="footerlink" href="javascript:logOff(\''+linkback+'\')">Log off</a>';
	 }
	else
	 {
	 output += '<a class="footerlink" href="javascript:logOff(\'http://www.nerac.com\')">Log off</a>';
	 }
	output += '<font class="footerlink"> ]</font><br/>';
	output += '<div class="fb-row">';
	output += '<p>(c) 2009 All Rights Reserved. Nerac Headquarters  - One Technology Drive - Tolland, CT 06084 - 1.860.872.7000</p>';
	output += '</div>';
	output += '</div></div></div><!-- fc-content --></div><!-- footer-column --></div><!-- footer-column fc-spacer-left --></div><!-- footer-columns --></div></div>';

	output += '<!-- end footer -->';
	
	
	writeOutput();
	
// Google Stats	
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
try {
    var pageTracker = _gat._getTracker("UA-7217546-2");
    pageTracker._trackPageview();
    } catch(err) {}

	
	
}


function makeLogonFooter() {
	output += '<br clear="both" />'
	output += '<div style="position:relative">'
	output += '<!-- start footer -->'
	output += '<div id="footer" style="position:relative; overflow:visible; margin-top:20px;">'
	output += '<div id="footer-columns">'
	output += '<div class="footer-column fc-spacer-left"></div>'
	output += '<div class="footer-column" id="footer-column-a"><div class="fc-content">'
	output += '<br><br><br><br><br><br><br><br><br><br><br>'
	output += '</div><!-- fc-content --></div><!-- footer-column -->'
	output += '<div class="footer-column " id="footer-column-b"><div class="fc-content"></div><!-- fc-content --></div><!-- footer-column -->'
	output += '<div class="footer-column " id="footer-column-c"><div class="fc-content"></div></div>'
	output += '<br clear="both" />'
	output += '<div style="position:relative;border-top: 1px solid #666666;width:1010px;">'
	output += '<div style="position:relative;margin-left:10px;z-index:+10px;">'
	output += '<font class="footerlink"> [&nbsp;</font>'
	output += '<a class="footerlink" href="http://www.nerac.com/">nerac.com</a>'
	output += '<font class="footerlink"> ] &nbsp;&nbsp;&nbsp;[ </font>'
	output += '<a class="footerlink" href="http://www.nerac.com/img/Nerac-privacypolicy08.pdf">Privacy statement</a>'
	output += '<font class="footerlink"> ] &nbsp;&nbsp;&nbsp;[ </font>'
	output += '<a class="footerlink" href="http://www.nerac.com/contact_us.php#">Contact us</a>'
	output += '<font class="footerlink"> ] &nbsp;&nbsp;&nbsp;[ </font>'
	if (linkback != "")
	 {
	 output += '<a class="footerlink" href="javascript:logOff(\''+linkback+'\')">Log off</a>';
	 }
	else
	 {
	 output += '<a class="footerlink" href="javascript:logOff(\'http://www.nerac.com\')">Log off</a>';
	 }
	output += '<font class="footerlink"> ]</font><br/>'
	output += '<div class="fb-row">'
	output += '<p>(c) 2009 All Rights Reserved. Nerac Headquarters  - One Technology Drive - Tolland, CT 06084 - 1.860.872.7000</p>'
	output += '</div>'
	output += '</div></div></div><!-- fc-content --></div><!-- footer-column --></div><!-- footer-column fc-spacer-left --></div><!-- footer-columns --></div></div>'	

	output += '<!-- end footer -->'
	writeOutput();
	
// Google Stats	
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
try {
var pageTracker = _gat._getTracker("UA-7217546-2");
pageTracker._trackPageview();
} catch(err) {}	
	
}



var DQMe = 0;
function makeMainNav() {
	if (tabsSearchResults == 2) {
		output += '<td><a href="'+goPHP+'cust_access/jwmain.php?SESSION='+session+'" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'home\',\'\',\'images/cust_access/n_buthome_b.gif\',1)"><img name="home" border="0" src="images/cust_access/n_buthome.gif" width="89" height="26"></a></td>';
	} else {
		output += '<td><a href="'+goPHP+'cust_access/camain.php?SESSION='+session+'" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'home\',\'\',\'images/cust_access/n_buthome_b.gif\',1)"><img name="home" border="0" src="images/cust_access/n_buthome.gif" width="89" height="26"></a></td>';
	}
	if (tabsSearchResults != 2) { //TOC only
		if ((tabsSearch == 1 || tabsSearch == 3) || retro > 0) {
			output += '<td><a href="'+SSL+'cust_access_asp/gateways/searching.asp'+tmpURL2+'"><img border="0" name="menu'+DQMe+'" id="menu'+DQMe+'" onmouseover="showMenu(event)" onmouseout="hideMenu(event)" src="images/cust_access/n_research.gif" width="118" height="26"></a></td>';
			DQMe++;
		}
	}
	if (tabsPatents > 0) {
		output += '<td><a href="'+SSL+'cust_access_asp/gateways/patents.asp'+tmpURL2+'"><img border="0" name="menu'+DQMe+'" id="menu'+DQMe+'" onmouseover="showMenu(event)" onmouseout="hideMenu(event)" src="images/cust_access/n_patents.gif" width="99" height="26"></a></td>';
		DQMe++;
	}
	if (tabsToc > 0 || toc > 0) {
		output += '<td><a href="'+SSL+'cust_access_asp/gateways/toc.asp'+tmpURL2+'"><img border="0" name="menu'+DQMe+'" id="menu'+DQMe+'" onmouseover="showMenu(event)" onmouseout="hideMenu(event)" src="images/cust_access/n_alerts.gif" width="99" height="26"></a></td>';
		DQMe++;
	}
	if (tabsDocuments > 0) {
		//output += '<td><a href="'+SSL+'cust_access_asp/gateways/documents.asp'+tmpURL2+'"><img border="0" name="menu'+DQMe+'" id="menu'+DQMe+'" onmouseover="showMenu(event)" onmouseout="hideMenu(event)" src="images/cust_access/butdoc.gif" width="136" height="26"></a></td>';
		DQMe++;
	}
	writeOutput();
}
function logOff(url) {
	window.location = goPHP+'cust_access/calogin.php?method=logout&url=' + url;
}

//header for Customer Access pages  added 7/14/09  LJP
function makeHeader() {
	
	


	
	
document.write('<div style="position:absolute;top:143px;height:600px; width:1024px;  opacity:0.9;  filter:alpha(opacity=90); background-color:#000000;z-index:-1 "></div>');
//document.write('<div style="position:absolute;left:1024px;top:0px;width:300px;height:600px;background-color:black;border:0px solid white"></div>');
document.write('<div style="display:block; height:126px; width:1024px; overflow:hidden;">');
document.write('<div style="float:right; display:block; height:126px; width:263px; border:0px; margin-top:30px; margin-right:5px;">');

(logo) ? document.write('<a href="'+goPHP+'cust_access/camain.php?q=1&SESSION='+session+'" class="menu-toggle"><img border="0" src="'+clogo+'" height="50"></a>') : document.write('<a href="'+goPHP+'cust_access/camain.php?q=1&SESSION='+session+'" class="menu-toggle"><img src="images/cust_access/banner-logo2.png" border="0"></a>');
document.write('</div></div>');
output += '<div id="subnav" style="width:1024px;height:17px;background-color:#333366">';
output += '<a href="javascript:logOff(\'http://www.nerac.com\')"><img align="right" src="images/cust_access/logOff.png" /></a>';
output += '	<ul class="subnav" style="height:17px;background-color:black">';
output += '		<li class="dropdown">';
output += '			<a id="TABSHomeLink" href="makeCATabs_MKF" class="menu-toggle">home</a></li>';
output += '		<li class="dropdown" id="TABSResearch" style="display:none">';
output += '			<a id="TABSResearchLink" href="makeCATabs_MKF" class="menu-toggle">research</a>';
output += '			<ul>';
output += '				<li><a id="TABSResearchRequest" href="makeCATabs_MKF" class="button">research request</a></li>';
output += '				<li><a id="TABSResearchInbox" href="makeCATabs_MKF" class="button">inbox</a></li>';
output += '			</ul>';
output += '		</li>';
output += '		<li class="dropdown" id="TABSAlerts" style="display:none">';
output += '			<a id="TABSAlertsLink" href="makeCATabs_MKF" class="menu-toggle">alerts</a>';
output += '			<ul>';
output += '				<li><a id="TABSAlertsStart" href="makeCATabs_MKF" class="button">start an alert</a></li>';
output += '				<li><a id="TABSAlertsInbox" href="makeCATabs_MKF" class="button">inbox</a></li>';
output += '			</ul>';
output += '		</li>';
output += '		<li class="dropdown" id="TABSPatents" style="display:none">';
output += '			<a id="TABSPatentsLink" href="makeCATabs_MKF" class="menu-toggle">patents</a>';
output += '			<ul>';
output += '				<li><a id="TABSPatentsOrder" href="makeCATabs_MKF" class="button">order patents</a></li>';
output += '				<li><a id="TABSPatentsCart" href="makeCATabs_MKF" class="button">patent cart</a></li>';
output += '				<li><a id="TABSPatentsHistory" href="makeCATabs_MKF" class="button">patent history</a></li>';
output += '				<li><a id="TABSPatentsWrappers" href="makeCATabs_MKF">file wrappers</a></li>';
output += '			</ul>';
output += '</li></ul></div>';
writeOutput();
	
if (tabsSearchResults == 2) {document.getElementById("TABSHomeLink").href= goPHP + 'cust_access/jwmain.php?SESSION=' + session
		} else {
			document.getElementById("TABSHomeLink").href= goPHP + 'cust_access/camain.php?SESSION=' + session
		}	
		
		if (tabsSearchResults != 2) { 
			if ((tabsSearch == 1 || tabsSearch == 3) || retro > 0) {
				document.getElementById("TABSResearch").style.display="block";
				document.getElementById("TABSResearchLink").href = goPHP + 'cust_access/Menu_Research_tab.php?SESSION=' + session;
				document.getElementById("TABSResearchRequest").href =  goPHP + 'cust_access/srch_select_black2.php?q=1&SESSION=' + session;
				document.getElementById("TABSResearchInbox").href = goPHP + 'cust_access/ncp/index.php?SESSION=' + session + '&method=ca.reportlist&map=RTN&noCache=' + (new Date()).valueOf();
			}
		}
		
		if (tabsPatents > 0) {
			document.getElementById("TABSPatents").style.display="block";
			document.getElementById("TABSPatentsLink").href = goPHP + 'cust_access/Menu_Patents_tab.php?SESSION=' + session;
			document.getElementById("TABSPatentsOrder").href = PSSL+'WPIMNU2?SESSION='+session+'&OPTION=SINGLE';
			document.getElementById("TABSPatentsCart").href = PSSL+'WNDCHECK?SESSION='+session;
			document.getElementById("TABSPatentsHistory").href = PSSL+'WNDHIST?SESSION='+session;
			document.getElementById("TABSPatentsWrappers").href = goPHP+'cust_access/optipat.php';
		}		
		
		if (tabsToc > 0 || toc > 0) {
			document.getElementById("TABSAlerts").style.display="block";
			document.getElementById("TABSAlertsLink").href = goPHP + 'cust_access/Menu_Alerts_tab.php?SESSION=' + session;
			document.getElementById("TABSAlertsStart").href = goPHP+'cust_access/srch_select_black2.php?q=0&SESSION='+session;
			document.getElementById("TABSAlertsInbox").href = PSSL+'WNDTTM1?session='+session+'&stitem=1&cat=ALL&map=TT';

		}		


	
}
	
//preload images for custom dialog
MM_preloadImages('images/cust_access/wait.gif', 'images/cust_access/hourGlass.gif');
