function fnHeader(nav)
{
	var str="";
	str+="<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
	str+= "<tr>";
	str+= "	<td valign='top' width='278'><a href='index.php'><img src='images/shell/header_logo_380.gif' alt='Carbon Sciences' border='0' /></a></td>";
	str+= "	<td align='right' valign='top' width='10'><img src='images/shell/spacer.gif' alt='' height='10' width='10' border='0' /></td>";
	str+= "	<td align='left' valign='top'>";
		str+= "<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
			str+= "<tr>";
				str+= "<td colspan='2'>";
					str+= "<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
						str+= "<tr>";
							str+= "<td align='right' valign='top'>";
								str+= "<table border='0' cellspacing='0' cellpadding='0'>";
									str+= "<tr>";
										str+= "<td></td>";
										str+= "<td width='10'><img src='images/shell/spacer.gif' alt='' height='10' width='10' border='0' /></td>";
									str+= "</tr>";
									str+= "<tr>";
										str+= "<td align='left'>";
											str+= "<table border='0' cellspacing='0' cellpadding='0'>";
												str+= "<tr>";
															if(nav!='Home'){ 
																str+= "<td width='16'><a href='index.php'><img src='images/shell/header_button.gif' alt='' height='16' width='16' border='0' /></a></td>";
																str+= "<td><img src='images/shell/spacer.gif' alt='' height='10' width='5' border='0' /></td>";
																str+= "<td><a class='no_ul' href='index.php'>HOME</a></td>";
																str+= "<td width='20'><img src='images/shell/spacer.gif' alt='' height='10' width='20' border='0' /></td>";
															  }  
															str+= "<td width='16'><a href='about.html'><img src='images/shell/header_button.gif' alt='' height='16' width='16' border='0' /></a></td>";
															str+= "<td><img src='images/shell/spacer.gif' alt='' height='10' width='5' border='0' /></td>";
															str+= "<td><a class='no_ul' href='about.html'>ABOUT </a></td>";
															str+= "<td width='20'><img src='images/shell/spacer.gif' alt='' height='10' width='20' border='0' /></td>";
															str+= "<td width='16'><a href='contact.html'><img src='images/shell/header_button.gif' alt='' height='16' width='16' border='0' /></a></td>";
															str+= "<td width='6'><img src='images/shell/spacer.gif' alt='' height='10' width='5' border='0' /></td>";
															str+= "<td><a class='no_ul' href='contact.html'>CONTACT</a></td>";
														str+= "</tr>";
													str+= "</table>";
												str+= "</td>";
												str+= "<td width='10'></td>";
											str+= "</tr>";
										str+= "</table>";
									str+= "</td>";
								str+= "</tr>";
								str+= "<tr>";
									str+= "<td align='left' valign='top'><img src='images/shell/spacer.gif' alt='' height='10' width='10' border='0' /></td>";
								str+="</tr>";
							str+= "</table>";
						str+= "</td>";
					str+= "</tr>";
					  if(nav!="Home"){  
						str+= "<tr>";
							str+= "<td width='10'><img src='images/shell/spacer.gif' alt='' height='10' width='10' border='0' /></td>";
							str+= "<td>";
								str+= "<h2 class='tagline'><i></i></h2>";
							str+= "</td>";
						str+= "</tr>";
					  } 
				str+= "</table>";
			str+= "</td>";
		str+= "</tr>";
	str+= "</table>";
	document.write(str);
	}

function fnBanner(bannav)
	{
	var str1="";
		str1+="<table width='931' border='0' cellspacing='0' cellpadding='0'>";
		str1+="<tr>";
			str1+="<td valign='bottom' width='378'><img src='images/shell/sub_header1.jpg' alt='' height='23' width='378' border='0' /></td>";
			str1+="<td valign='bottom' width='109'><a href='market.html' onmouseout=switchNav('subnav_market','_off','gif');  onmouseover= switchNav('subnav_market','_on','gif'); ><img id='subnav_market' src='images/nav/subnav_market_off.gif' alt='Market' name='subnav_market' height='38' width='109' border='0' /></a></td>";
			str1+="<td valign='bottom' width='109'><a href='technology.html' onmouseout=switchNav('subnav_technology','_off','gif'); onmouseover=switchNav('subnav_technology','_on','gif');><img id='subnav_technology' src='images/nav/subnav_technology_off.gif' alt='Technology' name='subnav_technology' height='38' width='109' border='0' /></a></td>";
			str1+="<td valign='bottom' width='110'><a href='applications.html' onmouseout=switchNav('subnav_applications','_off','gif');  onmouseover=switchNav('subnav_applications','_on','gif');><img id='subnav_applications' src='images/nav/subnav_applications_off.gif' alt='Applications' name='subnav_applications' height='38' width='110' border='0' /></a></td>";
			str1+="<td valign='bottom' width='111'><a href='investors.php' onmouseout=switchNav('subnav_investors','_off','gif');  onmouseover=switchNav('subnav_investors','_on','gif');><img id='subnav_investors' src='images/nav/subnav_investors_off.gif' alt='Investors' name='subnav_investors' height='38' width='111' border='0' /></a></td>";
			str1+="<td valign='bottom' width='114'><a href='news.php' onmouseout=switchNav('subnav_news','_off','gif');  onmouseover=switchNav('subnav_news','_on','gif');><img id='subnav_news' src='images/nav/subnav_news_off.gif' alt='News' name='subnav_news' height='38' width='114' border='0' /></a></td>";
		str1+="</tr>";
	str1+="</table>";
	  	if(bannav=='Home'){ 
			str1+="<img src='images/shell/sub_header2.jpg' alt='Transforming CO2 Into High Value Products' width='931' border='0' />";
 		}else {
  			str1+="<img src='images/shell/sub_header2.jpg' alt='Transforming CO2 Into High Value Products' height='37' width='931' border='0' />";
 		}
	document.write(str1);
}

function fnFooter()
	{
	var str2="";
	str2+="<table border='0' cellspacing='0' cellpadding='0'>";
	str2+="<tr>";
		str2+="<td width='961'><img src='images/shell/home_body_bottom.gif' alt='' height='12' width='961' border='0' /></td>";
	str2+="</tr>";
	str2+="<tr>";
		str2+="<td align='left' width='961'>";
			str2+="<table border='0' cellspacing='2' cellpadding='0'>";
				str2+="<tr>";
					str2+="<td valign='top'><img src='images/shell/spacer.gif' alt='' height='10' width='10' border='0' /></td>";
					str2+="<td valign='top'></td>";
				str2+="</tr>";
				str2+="<tr>";
					str2+="<td valign='top'></td>";
					str2+="<td valign='top'><span class='font11'>Copyright &copy; 2008 Carbon Sciences&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href='contact_privacy.html'>Privacy Policy</a></span></td>";
				str2+="</tr>";
			str2+="</table>";
		str2+="</td>";
	str2+="</tr>";
	str2+="</table>";
document.write(str2);
}
 function switchNav(target_img, highlight, ext){
			target_src = document.getElementById(target_img);
			target_src.src = "images/nav/" + target_img + highlight + "." + ext;
		}

function fnNewsletterSubmission(){
	var str3='';
	str3+="<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
		str3+="<tr>";
			str3+="<td valign='bottom'>";
			
					str3+="<form method=post action='http://app.intellicontact.com/icp/signup.php' name='icpsignup' accept-charset='UTF-8' onsubmit='return verifyRequired();' >";
					str3+="<input type='hidden' name='redirect' value='http://www.carbonsciences.com/01/subscribe-ok.html' />";
					str3+="<input type='hidden' name='errorredirect' value='http://www.carbonsciences.com/01/subscribe-failed.html' />";
					str3+="<img src='images/shell/newsletter_title.jpg' width='89' height='13' border='0' alt='' /><br /><br />";
					str3+="<span style='color:#000000;'>Subscribe to our newsletter for periodic news and updates</span>";
					str3+="<div style='padding-top:10px;'>";
					str3+="<div class='newsletter_bg'><input type='text' name='fields_email' class='newsletter_txt_box' value='your email address' onclick='return fnClear(this);'  onblur='return fnSet(this)' /></div>";
					str3+="<input id='submit' type='image' name='submit' src='images/shell/btn_signup.jpg' alt='Sign Up' width='75' height='25' class='btn_newsletter' />";
					str3+="</div>";
					str3+="<input type='hidden' name='listid' value='4968'>";
					str3+="<input type='hidden' name='specialid:4968' value='6SKR'>";
					str3+="<input type='hidden' name='clientid' value='144987'>";
					str3+="<input type='hidden' name='formid' value='477'>";
					str3+="<input type='hidden' name='reallistid' value='1'>";
					str3+="<input type='hidden' name='doubleopt' value='0'>";
					str3+="</form>";				
				
			str3+="</td>";
			str3+="<td width='2'><img src='images/shell/spacer.gif' alt='' height='109' width='2' border='0' /></td>";
		str3+="</tr>";
	str3+="</table>";
document.write(str3);
}

function fnNewsletterhome(){
	var str3='';
	str3+="<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
		str3+="<tr>";
			str3+="<td valign='bottom'>";
			
					str3+="<form method=post action='http://app.intellicontact.com/icp/signup.php' name='icpsignup' accept-charset='UTF-8' onsubmit='return verifyRequired();' >";
					str3+="<input type='hidden' name='redirect' value='http://www.carbonsciences.com/01/subscribe-ok.html' />";
					str3+="<input type='hidden' name='errorredirect' value='http://www.carbonsciences.com/01/subscribe-failed.html' />"; 
 					str3+="<img src='images/shell/newsletter_title.jpg' width='89' height='13' border='0' alt='' /><br /><br />";
					str3+="<span style='color:#000000;'>Subscribe to our newsletter for periodic news and updates</span>";
					str3+="<div style='padding-top:10px;'>";
					str3+="<div class='newsletter_bg'><input type='text' name='fields_email' class='newsletter_txt_box' value='your email address' onclick='return fnClear(this);'  onblur='return fnSet(this)' /></div>";
					str3+="&nbsp;<input id='submit' type='image' name='submit' src='images/shell/btn_signup.jpg' alt='Sign Up' width='75' height='25' class='btn_newsletter' />";
					str3+="</div>";
					str3+="<input type='hidden' name='listid' value='4968'>";
					str3+="<input type='hidden' name='specialid:4968' value='6SKR'>";
					str3+="<input type='hidden' name='clientid' value='144987'>";
					str3+="<input type='hidden' name='formid' value='477'>";
					str3+="<input type='hidden' name='reallistid' value='1'>";
					str3+="<input type='hidden' name='doubleopt' value='0'>";
					str3+="</form>";				
				
			str3+="</td>";
			str3+="<td width='2'><img src='images/shell/spacer.gif' alt='' height='109' width='2' border='0' /></td>";
		str3+="</tr>";
	str3+="</table>";
document.write(str3);
}



function verifyRequired() {
	if ((document.icpsignup.fields_email.value == "your email address") || (document.icpsignup.fields_email.value == "")) {
		alert("The Email field is required.");
		return false;
	}
	if(notEmail(document.icpsignup.fields_email,"email address")) {return false;}
	return true;
}

function fnClear(obj){
	if((Trim(obj.value)=='') || (obj.value=='your email address')){
		obj.value='';
		return false;
	}
}
function fnSet(obj){
	if((Trim(obj.value)=='')){
		obj.value='your email address';
		return false;
	}
}
function Trim(nStr){return nStr.replace(/(^\s*)|(\s*$)/g, "");}
function notEmail(obj,msg){
	var exp=/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
	if (!exp.test(Trim(obj.value))){
		alert("Please enter valid "+msg);
		obj.focus();
		return true;
	}else
		return false;
}
