var smartmail ; //Need to define it for footer in smartmail template
var html = '';

html += '<table width="735" cellpadding="0" cellspacing="0" border="0">';
html += '<tr>';
html += '<td><img src="' + gr + '/images/global/spacer.gif" width="10" height="1" border="0" alt="" /></td>';
html += '<td><img src="' + gr + '/images/global/spacer.gif" width="42" height="1" border="0" alt="" /></td>';
html += '<td><img src="' + gr + '/images/global/spacer.gif" width="673" height="1" border="0" alt="" /></td>';
html += '<td><img src="' + gr + '/images/global/spacer.gif" width="10" height="1" border="0" alt="" /></td>';
html += '</tr>';
html += '<tr>';
html += '<td></td>';
html += '<td><table cellpadding="0" cellspacing="0" border="0"><tr><td>';
html += '<img src="' + gr + '/images/global/spacer.gif" width="10" height="17" border="0" alt="" /><br>';
html += '<img src="' + gr + '/images/global/ge_tm_masthead.gif" width="42" height="42" alt="GE" border="0"/>';
html += '<div class="hide"><a href="#skip"><img src="' + gr + '/images/global/spacer.gif" width="1" height="1" border="0" alt="Skip global navigation" /></a></div></td></tr>';
html += '<tr><td><img src="' + gr + '/images/global/spacer.gif" width="1" height="5" border="0" alt="" /></td></tr>';
html += '</table>';
html += '</td>';
    
html +='<td align="right">';
html += '<table width="673" cellpadding="0" cellspacing="0" border="0" >';
html += '<form action="http://egems.gehealthcare.com/globalsearch/gemsredirector.jsp" method="get" id="simplesearch" name="simplesearch" accept-charset="utf-8">';
html += '<tr>';
html += '<td colspan="5"><img src="' + gr +'/images/global/spacer.gif" width="1" height="10" border="0" alt="" /></td>';
html += '</tr>';
html += '<tr><td align="right" colspan="5"><img src="' + logo[0] + '" width="400" height="20" alt="' + logo[1] + '" border="0"></td></tr>';
html += '<tr><td colspan="5" align="right" height="20" valign="top" class="mastSubTitle">' 
if(country != "")
{
     html += country ;
} 
html += '</td></tr>';
html += '<tr>';
html += '<td align="right" width="100%" class="mastLink">';

// Stock ticker to be added
html += '<span class="globalArrow">&gt;&nbsp;</span><a class="mastLink" href="'+stock_url+'">'+stock+'</a>&nbsp;';

for(var i=0 ; i <mastlinks.length-1 ; i++)
{             
	html += '<span class="globalArrow">&gt;&nbsp;</span><a href="' + mastlinks[i][1] + '" class="mastLink">' + mastlinks[i][0] + '</a>&nbsp;' ;  
}	

html += '</td>';
html += '<td ><img src="' + gr + '/images/global/spacer.gif" width="10" height="1" border="0" alt="" /></td>';
html += '<td align="right">';

html += '<input type="text" name="qt" id="qt" value="&nbsp;--&nbsp;Search&nbsp;--" class="globalInput" size="8" style="width:100px;" onblur="setFieldValue(\'document.simplesearch.qt\',\'&nbsp;--&nbsp;Search&nbsp;--\')" onfocus="setFieldValue(\'document.simplesearch.qt\',\'&nbsp;--&nbsp;Search&nbsp;--\')" /></td>';        
html += '<td ><img src="' + '/images/global/spacer.gif" width="2" height="1" border="0" alt="" /></td>';
html += '<td align="right"><a href="JavaScript:document.simplesearch.submit();"><img src="' + gr + '/images/global/button_go.gif" width="22" height="20" alt="" border="0"></a></td>';
html += '</tr>';
html += '</form>';
html += '<tr>';
html += '<td colspan="5"><img src="' + gr + '/images/global/spacer.gif" width="1" height="5" border="0" alt="" /></td>';
html += '</tr>';
html += '</table>';
html += '</td>';
html += '<td></td>';
html += '</tr>';
html += '</table>';
html += '<!-- ========== END MASTHEAD (A00) ========== -->';
html += '<!-- ========== BEGIN PRIMARY NAVIGATION (A01) ========== -->';

html += '<table width="735" border="0" cellpadding="0" cellspacing="0">';
html += '<tr>';

var menu_len = menu.length;

var img_width=735/(menu_len-1);
if(menu_len == 3){
	img_width=245;
}
else if(menu_len == 4){
	img_width=183;
}
else if(menu_len == 5){
	img_width=146;
}

	
for(var j=0 ; j< menu_len ; j++)
{        
	 html += '<td><a href="' + menu[j][3] + '">';
	 if( primary_nav == menu[j][0]) 
	 {
	 	html += '<img src="' + menu[j][1] + '" '; 
	 }
	else{
		html += '<img src="' + menu[j][2] + '" '; 
	}
	 html += 'width="'+img_width+'" height="19" alt="' + menu[j][4] + '" border="0" /></a></td>';  
         html += '<td><img src="' + gr + '/images/global/spacer.gif" width="1" height="1" alt="" border="0" /></td>';  
}  	
html += '</tr>';
html += '</table>';
html += '<!-- ========== END PRIMARY NAVIGATION (A01) ========== -->';
                                                                    
document.write(html);                                                 

