// ---------------------------------------------------------
// PageNav.js 
// ---------------------------------------------------------
var gstPageName = "";
var gstPageName = "";

/*
var gstContacts = new Array(
"DB", "David Buckley", "dbuckley@teedco.com",
"JD", "John Dillon", "jdillon@teedco.com",								  
"AD", "Alex D'Agostino", "adagostino@teedco.com",		
"ST", "Shawn Teed", "steed@teedco.com",							  
"GT", "Geoff Teed", "gteed@teedco.com");

var gstSpecialtyData = new Array(
"All Specialties", 
"Cardiothoracic",
"Emergency Medicine",
"Internal Medicine",
"Radiology",
"Otolaryngology");

var gstStateData = new Array(
"All", "All States", "",
"AL", "Alabama", "GA,MS,KY,FL,LA",
"AK", "Alaska", "WA",
"AZ", "Arizona", "CA,NV,UT,NM,CO",
"AR", "Arkansas", "OK,LA,MS,MO,TX",
"CA", "California", "NV,AZ,OR,WA",
"CO", "Colorado", "KA,TX,NM,AZ,UT,WY,NE",
"CT", "Connecticut", "NY,NJ,MA,RI,NH,VT,PA,ME",
"DE", "Delaware", "MD,NJ,PA,DC,VA",
"DC", "District of Columbia", "MD,NJ,PA,DC,VA,DE",
"FL", "Florida", "GA,AL,SC",
"GA", "Georgia", "FL,AL,SC,KY,NC,MI,LA",
"HI", "Hawaii", "CA",
"ID", "Idaho", "OR,WA,MT,WY,UT,NV",
"IL", "Illinois", "MO,MI,MN,WI,IN,OH",
"IN", "Indiana", "OH,IL,MI,KY,WV",
"IA", "Iowa", "MN,SD,NE,MO,IL,WI",
"KS", "Kansas", "MO,NE,CO,OK,AR",
"KY", "Kentucky", "TN,IL,ID,OH,WV,VA,NC",
"LA", "Louisiana", "TX,OK,AR,MS",
"ME", "Maine", "NH,VT,MA,RI,CT",
"MD", "Maryland", "DC,VA,DE,WV,NY,PA,NJ",
"MA", "Massachusetts", "CT,RI,NY,VT,NH,ME",
"MI", "Michigan", "OH,IN,IL,WI",
"MN", "Minnesota", "WI,IA,NE,ND,SD",
"MS", "Mississippi", "AL,FL,GA,LA,AR,TN",
"MO", "Missouri", "IA,IL,AR,OK,KA,NE",
"MT", "Montana", "ID,WY,ND,SD,WA,OR",
"NE", "Nebraska", "IA,MO,KA,CO,WY,SD",
"NV", "Nevada", "CA,OR,ID,UT,AZ",
"NH", "New Hampshire", "VT,ME,MA,RI,CT,NY",
"NJ", "New Jersey", "NY,PA,DE,CT,MD",
"NM", "New Mexico", "AZ,UT,CO,KA,OK,TX",
"NY", "New York", "PA,NJ,CT,MA,VT",
"NC", "North Carolina", "SC,WV,VA,TN,KY",
"ND", "North Dakota", "SD,WY,MT,MN,IA",
"OH", "Ohio", "MI,PA,NY,IN,KY,WV,IL",
"OK", "Oklahoma", "TX,NM,CO,KA,MO,AR,LA",
"OR", "Oregon", "WA,ID,NV,CA",
"PA", "Pennsylvania", "NY,NJ,OH,CT,DE,MD",
"RI", "Rhode Island", "CT,MA,NY,NH,VT",
"SC", "South Carolina", "NC,VA,WV,KY,TN,GA,FL",
"SD", "South Dakota", "NE,WY,MT,ND,MN,IA",
"TN", "Tennessee", "KY,NC,SC,GA,AL,MS,AK,MO,IL",
"TX", "Texas", "KA,NM,OK,AR,LA",
"UT", "Utah", "CO,NM,AZ,NV,ID,WY",
"VT", "Vermont", "NY,NH,ME,MA,CT,RI",
"VA", "Virginia", "WV,MD,NC,SC,TN,KY",
"WA", "Washington", "OR,ID,MT,CA",
"WV", "West Virginia", "VA,NC,TN,KY,OH,PA,SC",
"WI", "Wisconsin", "MN,IA,IN,MI,IL",
"WY", "Wyoming", "SD,NE,CO,UT,ID,MT");
*/

// ----------------------------------------------------------
// FUNCTION: WriteContactName
// ----------------------------------------------------------
function WriteContactName(stInitials)
{
	stContactName = "";
	for(i=0; i<gstContacts.length; i++){
	   	if (gstContacts[i] == stInitials){
	   	  	stContactName = gstContacts[i+1];
			break;
	    }
		i=i+2;
	}
	document.write(stContactName);
}
// ----------------------------------------------------------
// FUNCTION: WriteContactEmail
// ----------------------------------------------------------
function WriteContactEmail(stInitials)
{
	stContactEmail = "";
	for(i=0; i<gstContacts.length; i++){
	   	if (gstContacts[i] == stInitials){
	   	  	stContactEmail = gstContacts[i+2];
			break;
	    }
		i=i+2;
	}
	document.write(stContactEmail);
}
// ----------------------------------------------------------
// FUNCTION: WriteTourismLink
// ----------------------------------------------------------
function WriteTourismLink(stInitials)
{
	if (stInitials != "~"){
		stStateName = "";
		stTourismLink = "";
		for(i=0; i<gstStateData.length; i++){
			if (gstStateData[i] == stInitials){
				stStateName = gstStateData[i+1];
				stTourismLink = gstStateData[i+3];
				break;
			}
			i=i+3;
		}
		document.write("<a href='" + stTourismLink + "' target='_blank'>" + stStateName + " Website</a>");
	}
}
// ----------------------------------------------------------
// FUNCTION: WriteStateOptions
// ----------------------------------------------------------
function WriteStateOptions()
{
	stStateSearch = GetCookieValue("StateSearch");
	document.writeln('<select size="1" name="state">'); 
	for(i=0; i<gstStateData.length; i++){
	   	if (gstStateData[i] == stStateSearch){
	   	  	document.writeln('<option selected value='+gstStateData[i]+'>' + gstStateData[i+1] );
	    }
		else{
			document.writeln('<option value='+gstStateData[i]+'>' + gstStateData[i+1]);
		}
		i=i+3;
	}
	document.writeln('</select>'); 	
}
// ----------------------------------------------------------
// FUNCTION: WriteSpecialtyOptions
// ----------------------------------------------------------
function WriteSpecialtyOptions()
{
	stSpecialtySearch = GetCookieValue("SpecialtySearch");
	document.writeln('<select size="1" name="specialty">'); 
	for(i=0; i<gstSpecialtyData.length; i++){
	   	if (gstSpecialtyData[i] == stSpecialtySearch){
	   	  	document.writeln('<option selected value="'+gstSpecialtyData[i]+'">' + gstSpecialtyData[i] );
	    }
		else{
			document.writeln('<option value="'+gstSpecialtyData[i]+'">' + gstSpecialtyData[i]);
		}
	}
	document.writeln('</select>'); 	
}

// ----------------------------------------------------------
// FUNCTION: WriteNearby
// ----------------------------------------------------------
function WriteNearbyCheckbox()
{
	stNearbySearch = GetCookieValue("NearbySearch");
	
	if (stNearbySearch == "YES")	{				
		document.writeln(' <input type="checkbox" name="nearby" value="YES" CHECKED>include nearby states'); 
	}
	else{
		document.writeln(' <input type="checkbox" name="nearby" value="YES">include nearby states'); 
	}
	
}
// ----------------------------------------------------------
// FUNCTION: SetNearby
// ----------------------------------------------------------
function SetSearchCookies(myForm)
{
	if (myForm.nearby.checked) {
		stNearbySearch = "YES";
	}
	else{
		stNearbySearch = "NO";
	}
	document.cookie = "SpecialtySearch=" + myForm.specialty.value +";expires=" ;

	document.cookie = "StateSearch=" + myForm.state.value +";expires=" ;
	document.cookie = "NearbySearch=" + stNearbySearch +";expires=" ;
	//document.cookie = "NearbyClause=;expires=" ;
	document.cookie = "NearbyClause=" + GetNearbyClause() +";expires=" ;
	//alert('State=['+GetCookieValue("StateSearch")+']'+' Nearby=['+GetCookieValue("NearbySearch")+']'+' SpecialtySearch=['+GetCookieValue("SpecialtySearch")+']');
}
// ----------------------------------------------------------
// FUNCTION: GetNearbyClause
// ----------------------------------------------------------
function GetNearbyClause()
{
	stNearby = "";
	stStateSearch = GetCookieValue("StateSearch");
	stNearbySearch = GetCookieValue("NearbySearch");
	if (stNearbySearch == "YES") {
		for(i=0; i<gstStateData.length; i++){
		   	if (gstStateData[i] == stStateSearch){
		   	  	stNearby = gstStateData[i+2];
				return stNearby;
			}
			i=i+2;
		}
	}
	return stNearby;
}
// ----------------------------------------------------------
// FUNCTION: GetCookie
// ----------------------------------------------------------
function GetCookieValue(stCookieName)
{
	thisCookie = document.cookie.split("; ");
  	for(i=0; i<thisCookie.length; i++){
	   	if (stCookieName==thisCookie[i].split("=")[0]){
	   	  return thisCookie[i].split("=")[1];
	    }
	}
	return "Jobs:";	
}
// ----------------------------------------------------------
// FUNCTION: WriteSkills
// ----------------------------------------------------------
function WriteSkills( stModalities, stOtherSkills )
{
 
	if (stModalities.length > 1){
		stModalities = stModalities.substring(2, stModalities.length)
		
		if (stOtherSkills.length == 0){
			stModalities = stModalities.substring(0, stModalities.length-1)
		}
		document.write( stModalities +' '+ stOtherSkills );
	}
	else {
		document.write( stOtherSkills );
	}

 	
}	
// ----------------------------------------------------------
// FUNCTION: WriteBookMarkImage
// ----------------------------------------------------------
function WriteBookmarkImage(stID)
{
	stBookmarks = GetCookieValue("Bookmarks");
	if ( stBookmarks.indexOf(stID) >=0) {
		document.write("<IMG NAME='BTN_" +stID+ "' SRC='images/btn_bookmark_on.gif' ALT='Toggle Bookmark for this Job' BORDER='0'>");
	}
	else {
		document.write("<IMG NAME='BTN_" +stID+ "' SRC='images/btn_bookmark_off.gif' ALT='Toggle Bookmark for this Job' BORDER='0'>");
	}
}	

// ----------------------------------------------------------
// FUNCTION: SetBookmark
// ----------------------------------------------------------
function SetBookmark(stAC, stID)
{
	stMark = stAC + "-" + stID;
	stBookmarks = GetCookieValue("Bookmarks");
	if ( stBookmarks.indexOf(stMark)>=0) {
	
		if (stBookmarks.length<=12){                 
			stBookmarks="Jobs:";
		}
		else {
			stBookmarks=stBookmarks.replace(" "+stMark, "");
		}
		//alert('del['+stBookmarks+']');
		document.cookie = "Bookmarks=" + stBookmarks +";expires=" ;
		temp = "document.BTN_"+stID+".src='images/btn_bookmark_off.gif';";
		eval(temp);
	}
	else {
		//alert('add['+stBookmarks+']');
		document.cookie = "Bookmarks=" + stBookmarks + " " + stMark +";expires=" ;
		temp = "document.BTN_"+stID+".src='images/btn_bookmark_on.gif';";
		eval(temp);
	}
}	

	


// ----------------------------------------------------------
// FUNCTION: MM_findObj(n, d)
// ----------------------------------------------------------
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()
// ----------------------------------------------------------
function MM_swapImage() { //v3.0
  var i,j=0,x;
  var 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: MM_swapImgRestore(
// ----------------------------------------------------------
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: Load_Pics()
// ----------------------------------------------------------
function Load_Pics(){
	
	if (document.images) {
  		welcome_f1 = new Image(135, 28); welcome_f1.src = "images/link_welcome.gif";
		welcome_f2 = new Image(135, 28); welcome_f2.src = "images/link_welcome_f2.gif";
		
		aboutus_f1 = new Image(130, 28); aboutus_f1.src = "images/link_aboutus.gif";
		aboutus_f2 = new Image(130, 28); aboutus_f2.src = "images/link_aboutus_f2.gif";
		
		practices_f1 = new Image(135, 28); practices_f1.src = "images/link_practices.gif";
		practices_f2 = new Image(135, 28); practices_f2.src = "images/link_practices_f2.gif";
		
		physicians_f1 = new Image(135, 28); physicians_f1.src = "images/link_physicians.gif";
		physicians_f2 = new Image(135, 28); physicians_f2.src = "images/link_physicians_f2.gif";
		
		
		search_jobs_f1 = new Image(135, 28); search_jobs_f1.src = "images/link_search_jobs.gif";
		search_jobs_f2 = new Image(135, 28); search_jobs_f2.src = "images/link_search_jobs_f2.gif";
		
		library_f1 = new Image(135, 28); library_f1.src = "images/link_library.gif";
		library_f2 = new Image(135, 28); library_f2.src = "images/link_library_f2.gif";
		
		resources_f1 = new Image(135, 28); resources_f1.src = "images/link_resources.gif";
		resources_f2 = new Image(135, 28); resources_f2.src = "images/link_resources_f2.gif";
		
		testimonials_f1 = new Image(135, 28); testimonials_f1.src = "images/link_testimonials.gif";
		testimonials_f2 = new Image(135, 28); testimonials_f2.src = "images/link_testimonials_f2.gif";
		
		contact_f1 = new Image(135, 28); contact_f1.src = "images/link_contact.gif";
		contact_f2 = new Image(135, 28); contact_f2.src = "images/link_contact_f2.gif";
		
		//links_f1 = new Image(130, 28); links_f1.src = "images/link_links.gif";
		//links_f2 = new Image(130, 28); links_f2.src = "images/link_links_f2.gif";
			
	 	home_f1 = new Image(75, 25); home_f1.src = "images/btn_home.gif";
		home_f2 = new Image(75, 25); home_f2.src = "images/btn_home_f2.gif";		
				
	 	top_f1 = new Image(75, 25); top_f1.src = "images/btn_top.gif";
		top_f2 = new Image(75, 25); top_f2.src = "images/btn_top_f2.gif";
		
	
		
	}	
}


// ----------------------------------------------------------
// FUNCTION: Write_NavItem
// ----------------------------------------------------------
function Write_NavItem(stName, stLink, stTip)
{
	if (gstPageName == stName ){
	    document.write('<TR><TD>');
		document.writeln('<IMG height="28" src="images/link_'+stName+'_f3.gif" width="135" border=0" '); 
		document.writeln('name="'+stName+'" alt="'+stTip+'"></TD></TR>');
	}
	else {				
	    document.write('<TR><TD><A onmouseover="MM_swapImage(');
		document.write("'"+stName+"','','images/link_"+stName+"_f2.gif', 1); ");
		document.writeln('" onmouseout="MM_swapImgRestore();" href="'+stLink+'" target="_top"> ');
		document.writeln('<IMG height="28" src="images/link_'+stName+'.gif" width="135" border=0" '); 
		document.writeln('name="'+stName+'" alt="'+stTip+'"></A></TD></TR>');
	}
}	
// ----------------------------------------------------------
// FUNCTION: Write_HorzRule
// ----------------------------------------------------------
function Write_HorzRule(stColspan, stImg, stIndent)
{
	stRule = "images/horz_rule.gif"
	if (stImg == "LT"){
		stRule = "images/horz_rule_tantall.gif"
	}
	document.writeln('<tr><td colspan="'+stColspan +'">');
		document.writeln('<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">');
				
		// horz rule with spacer			
		document.write  ('<tr><td align="left" width="100%" background="'+stRule+'">');
		document.writeln('<img src="images/pic_spacer.gif" alt="" width="1" height="11" border="0"></td>');	
		if (stIndent != "NONE"){		
			document.write('<td><img src="images/pic_spacer.gif" alt="" width="10" height="11" border="0"></td>');
		}
		document.writeln('</tr></table>');	
	document.writeln('</td></tr>');	
}

// ----------------------------------------------------------
// FUNCTION: Write_PageNav
// ----------------------------------------------------------
function Write_PageNav()	
{
			// begin menu cell
			document.writeln('<table width="170" height="700" background="images/ht_sidebar_400.jpg" border="0" cellspacing="0" cellpadding="0">');		
				document.writeln('<tr><td valign="top"><span class="menu">');
				document.writeln('<table width="100%" background="" border="0" cellspacing="0" cellpadding="0">');
				
					document.writeln('<tr><td rowspan="3" align="left" width="5" height="100%"><img src="images/pic_spacer.gif" ');
					document.writeln(' alt="" width="5" height="10" border="0"></td>');
								
					document.writeln('<td align="left" width="130" height="190"><img src="images/pic_spacer.gif" ');
					document.writeln(' alt="" width="130" height="190" border="0"></td>');
					
					document.writeln('<td align="left" width="15" height="190"><img src="images/pic_spacer.gif" ');
					document.writeln(' alt="" width="15" height="190" border="0"></td></tr>');
											
					document.writeln('<tr><td align="left" valign="top">');	
					document.writeln('<table width="130" background="" border="0" cellspacing="0" cellpadding="0">');	

					Write_NavItem("welcome","index.html", "Welcome");
					Write_NavItem("aboutus","aboutus.html", "About Us");
					Write_NavItem("search_jobs","opportunities.php", "Search Job Database");						

		document.write('<TR><TD>');
		document.writeln('<IMG height="12" src="images/pic_spacer.gif" width="135" border=0" '); 
		document.writeln('name="" alt=""></TD></TR>');
					
					Write_NavItem("practices","practices.html", "For Practices");	
					Write_NavItem("physicians","physicians.html", "For Physicians");
					Write_NavItem("testimonials","testimonials.html", "Testimonials");

		document.write('<TR><TD>');
		document.writeln('<IMG height="12" src="images/pic_spacer.gif" width="135" border=0" '); 
		document.writeln('name="" alt=""></TD></TR>');
					Write_NavItem("library","library.html", "Career Library");
					// Write_NavItem("resources","resources.html", "Other Resources");						
					Write_NavItem("contact","contact.html", "Contact Us");

		document.write('<TR><TD>');
		document.writeln('<IMG height="12" src="images/pic_spacer.gif" width="135" border=0" '); 
		document.writeln('name="" alt=""></TD></TR>');
					
				//	Write_NavItem("account","account.html", "Online Account");		
					

		//added NAPR Logo
	    document.write('<TR><TD>');
		document.writeln('<IMG height="20" src="images/pic_spacer.gif" width="135" border=0" '); 
		document.writeln('name="" alt=""></TD></TR>');
		
	    document.write('<TR><TD align=center>');
		document.writeln('<IMG height="150" src="images/NAPR_Logo.gif" width="135" border=0" '); 
		document.writeln('name="" alt=""></TD></TR>');


					document.writeln('</table>');	
					document.writeln('</td><td align="left" width="15" height="100%">&nbsp;</td></tr>');					
					
				document.writeln('</table></span></td></tr>');
				
								
						
			document.writeln('</table>');		
			// end menu					
}
// ----------------------------------------------------------
// FUNCTION: Write_PageHead
// ----------------------------------------------------------
function Write_PageHead(PageIsFramed)
{
		    
			// page header
			document.writeln('<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" background="images/ht_banner_bgnd.gif">');
			document.write  ('<tr>');
			document.writeln('');
			
			// left image (spacer)
			document.write  ('<td height="130" width="50%" valign="top" align="right" >');
			document.write  ('<img src="images/pic_spacer.gif" width="5" height="130" border="0"></td>');
			
			document.write  ('<td height="130" width="450" valign="top" align="right">');
			document.write  ('<img src="images/ht_logo_center.gif" alt="Teed &amp; Company, Inc." width="450" height="130" align="right" border="0"></td>');
			
			if (PageIsFramed) {
			  document.write  ('<td height="130" width="17" valign="top" align="right">');
			  document.write  ('<img src="images/pic_spacer.gif" width="17" height="130" border="0"></td>');
			}
			
			document.writeln('</tr></table>');
}

function Write_PageTitle(stPageName, PageIsFramed)
{
			// Page Title and Top Nav Buttons	
			document.writeln('<table width="100%" border="0" cellspacing="0" cellpadding="1" align="center">');
			
			// verticle spacer			
			document.writeln('<tr><td colspan="2" width="95%"><img src="images/pic_spacer.gif" ');
			document.writeln('alt="spacer" width="3" height="4" border="0"></td></tr>'); 
			
			// <HR> Page Title <HR>
					document.writeln('<tr><td align="left" valign="middle" width="95%">'); 
				document.writeln('<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">');		
				// document.write  ('<tr><td align="left" width="100%" background="images/horz_rule.gif">');
				// document.writeln('<img src="images/pic_spacer.gif" alt="" width="1" height="16" border="0"></td></tr>');	
				document.write  ('<tr><td align="left" valign="top">'); 	
			
				document.writeln('<img src="images/pghd_'+stPageName+'.gif" alt="page heading"  width="350" height="34" border="0"></td></tr>');				
				document.write  ('<tr><td align="left" width="100%" background="images/horz_rule.gif">');
				document.writeln('<img src="images/pic_spacer.gif" alt="" width="1" height="10" border="0"></td></tr>');	
				document.writeln('</table></td>');
			
			    // Nav Buttons	
			    document.writeln('<td width="165" align="center" valign="bottom">');
				
				// Home Button
				if (gstPageName == "welcome"){
					document.writeln('<img src="images/btn_home_d.gif" alt="" ');
					document.write('width="75" height="25" border="0" >');
				}
				else {				
					stName="home"; stNum="1"; stLink="index.html"; stTip="home page"; 
					document.writeln('<a onmouseover="MM_swapImage(');
					document.write  ("'"+stName+stNum+"','','images/btn_"+stName+"_f2.gif', 1); ");
					document.write  ('" onmouseout="MM_swapImgRestore();" href="'+stLink+'" target="_top">');
					document.write  ('<img height="25" src="images/btn_'+stName+'.gif" width="75" border=0" '); 
					document.write  ('name="'+stName+stNum+'" alt="'+stTip+'"></a>');					
				}
					
				// Contact Button
				if (gstPageName == "contact"){
					document.writeln('<img src="images/btn_contact_d.gif" alt="" ');
					document.write('width="75" height="25" border="0" >');
				}
				else {	
					stName="btn_contact"; stNum="1"; stLink="contact.html"; stTip="contact us";
					document.writeln('<a onmouseover="MM_swapImage(');
					document.write  ("'"+stName+stNum+"','','images/"+stName+"_f2.gif', 1); ");
					document.write  ('" onmouseout="MM_swapImgRestore();" href="'+stLink+'" target="_top">');
					document.write  ('<img height="25" src="images/'+stName+'.gif" width="75" border=0" '); 
					document.write  ('name="'+stName+stNum+'" alt="'+stTip+'"></a>');				
				}							
				document.write  ('<img src="images/pic_spacer.gif" alt="spacer" width="3" height="10" border="0">');
				document.writeln('<img src="images/pic_spacer.gif" alt="" width="165" height="20" border="0" align="top"></td>');
			
			if (PageIsFramed) {
			  document.write  ('<td height="10" width="15" valign="top" align="right">');
			  document.write  ('<img src="images/pic_spacer.gif" width="15" height="10" border="0"></td>');
			}
			
			document.writeln('</tr></table>');
}


// ----------------------------------------------------------
// FUNCTION: Begin_Page
// ----------------------------------------------------------
function Begin_PageNav(stPageName, stShow)
{
	gstPageName = stPageName;
	Load_Pics();
	
	document.writeln('<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="1">');
	document.writeln('<a name=top><table width="100%" border="0" cellspacing="0" cellpadding="0">');
	
		// begin Left pane 
		document.writeln('<tr><td width="170" background="images/ht_sidebar_300.gif" valign="top" align="left">');
					
		// --------------------------------------------
		// Nav Items
		// --------------------------------------------
		Write_PageNav();
			
		// end Left Pane (with a transparent spacer to fix Netscape width issues)
		document.writeln('<img src="images/pic_spacer.gif" alt="" width="165" height="10" border="0"></td>');
		
		// begin Right pane
		document.writeln('<td align="left" valign="top" width="100%">');
		document.writeln('<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">');
		document.writeln('<tr><td>');
		
		// --------------------------------------------
		// PageHead
		// --------------------------------------------
		Write_PageHead(false);
			
		document.writeln('</td></tr><tr><td>');
			
		Write_PageTitle(stPageName, false);

		document.writeln('</td></tr><tr><td>');
		
		// media HTML writes rest of Right pane
		document.writeln('<table width="100%" border="0" cellspacing="2" cellpadding="2" align="center">');	
	
}


// ----------------------------------------------------------
// FUNCTION: End_Page
// ----------------------------------------------------------
function End_PageNav()
{
		// end body cell
		document.writeln('</table></td></tr>');
		
	
		//---- whytrain Us items --------
		document.writeln('<tr><td>');
			document.writeln('<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">');
			
			// horz rule with spacer			
			document.write  ('<tr><td align="left" width="100%" background="images/horz_rule.gif">');
			document.writeln('<img src="images/pic_spacer.gif" alt="" width="1" height="16" border="0"></td>');				
			document.write('<td><img src="images/pic_spacer.gif" alt="" width="14" height="10" border="0">');
			document.writeln('</td></tr></table>');	
		document.writeln('</td></tr>');	
					
		document.writeln('<tr><td>');
			document.writeln('<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center"><tr>');
					
			// left cell
			document.writeln('<td align="left" width="49%" valign="top">');	
			document.writeln('<b>Teed & Company, Inc.</b><br>');
			document.writeln('<font size="-1">27 Ann Street<br>');
			document.writeln('Norwalk, CT 06854</font>');
			document.writeln('</td>');	
			
			// right cell
			document.writeln('<td align="right" width="49%" valign="top">');	
			document.writeln('&nbsp;&nbsp;<font size="-1"><b>info@teedco.com</b><br>');
			document.writeln('Phone: 203.857.0191<br>');
			document.writeln('Fax: 203.857.0190</font>');
			document.writeln('</td>');
							
			// spacer cell	
			document.writeln('<td><img src="images/pic_spacer.gif" alt="" width="14" height="10" border="0">');
			document.writeln('</td></tr></table>');	
		document.writeln('</td></tr>');	
			
		
		document.writeln('<tr><td>');
			// horz rule with spacer			
			document.writeln('<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">');
			document.write  ('<tr><td align="left" width="100%" background="images/horz_rule.gif">');
			document.writeln('<img src="images/pic_spacer.gif" alt="" width="1" height="14" border="0"></td>');	
			document.write  ('<td><img src="images/pic_spacer.gif" alt="" width="14" height="10" border="0">');
			document.writeln('</td></tr></table>');	
		document.writeln('</td></tr>');	
		
		//---- end whytrain Us items -----
		
		//---- bottom page navigation items --------
		document.writeln('<tr><td>');
			document.writeln('<span class="options"><table width="100%" border="0" cellspacing="0" cellpadding="0" align="center"><tr>');
			document.writeln('<td align="left"><a href="http://www.humanitects.com"><img src="images/ht_advert.gif" alt="humanitects" border="0"></a></td>');
			
			document.writeln('<td width="98%" valign="middle" align="right">');
	
			// Home Button
			if (gstPageName == "welcome"){
				document.writeln('<img src="images/btn_home_d.gif" alt="" ');
				document.write('width="75" height="25" border="0" >');
			}
			else {				
				stName="home"; stNum="2"; stLink="index.html"; stTip="home page"; 
				document.writeln('<a onmouseover="MM_swapImage(');
				document.write  ("'"+stName+stNum+"','','images/btn_"+stName+"_f2.gif', 1); ");
				document.write  ('" onmouseout="MM_swapImgRestore();" href="'+stLink+'">');
				document.write  ('<img height="25" src="images/btn_'+stName+'.gif" width="75" border=0" '); 
				document.write  ('name="'+stName+stNum+'" alt="'+stTip+'"></a>');					
			}
			
			// Top of Page Button			
			stName="top"; stNum="1"; stLink="#top"; stTip="top of page";
			document.writeln('<a onmouseover="MM_swapImage(');
			document.write  ("'"+stName+stNum+"','','images/btn_"+stName+"_f2.gif', 1); ");
			document.write  ('" onmouseout="MM_swapImgRestore();" href="'+stLink+'">');
			document.write  ('<img height="25" src="images/btn_'+stName+'.gif" width="75" border=0" '); 
			document.write  ('name="'+stName+stNum+'" alt="'+stTip+'"></a>');					
			document.writeln('</td>');
				
			document.writeln('<td><img src="images/pic_spacer.gif" alt="" width="10" height="10" border="0"></td>');
			document.writeln('</tr><tr><td colspan="3" height="20">&nbsp;</td></tr></table></span>');	
		document.writeln('</td></tr></table>');
		//---- end bottom page navigation items ----
		
	// end outermost table and HTML body
	document.writeln('</td></tr></table></body>');
		
}

// ----------------------------------------------------------
// FUNCTION: ClientItems
// ----------------------------------------------------------
function Write_ClientItems(stClientName, stList, stPrev, stNext, stNum)
{
	document.writeln('<tr><td colspan="2" >');
	document.writeln('<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">');
	document.writeln('<tr><td align="left" valign="middle" width="95%" class="HeadMed">'); 
	document.writeln('<b>'+stClientName+'</b></td>');
	
	document.writeln('<td width="165" align="center" valign="bottom">');	
	Write_ListBtns(stList, stPrev, stNext, stNum);
	document.writeln('</td>');
	document.writeln('</tr></table></td></tr>');
}	

// ----------------------------------------------------------
// FUNCTION: Write_ListBtns
// ----------------------------------------------------------
function Write_ListBtns(stList, stPrev, stNext, stNum)
{	
	// List Button
	if (stList == ""){
		document.writeln('<img src="images/btn_list_d.gif" alt="" ');
		document.write('width="50" height="25" border="0" >');
	}
	else {
		stName="list"; stLink=stList; stTip="view list";
		document.writeln('<a onmouseover="MM_swapImage(');
		document.write  ("'"+stName+stNum+"','','images/btn_"+stName+"_f2.gif', 1); ");
		document.write  ('" onmouseout="MM_swapImgRestore();" href="'+stLink+'">');
		document.write  ('<img height="25" src="images/btn_'+stName+'.gif" width="50" border=0" '); 
		document.write  ('name="'+stName+stNum+'" alt="'+stTip+'"></a>');				
	}
	// Prev Button
	if (stPrev == ""){
		document.writeln('<img src="images/btn_prev_d.gif" alt="" ');
		document.write('width="50" height="25" border="0" >');
	}
	else {		
		stName="prev"; stLink=stPrev; stTip="previous item";
		document.writeln('<a onmouseover="MM_swapImage(');
		document.write  ("'"+stName+stNum+"','','images/btn_"+stName+"_f2.gif', 1); ");
		document.write  ('" onmouseout="MM_swapImgRestore();" href="'+stLink+'">');
		document.write  ('<img height="25" src="images/btn_'+stName+'.gif" width="50" border=0" '); 
		document.write  ('name="'+stName+stNum+'" alt="'+stTip+'"></a>');				
	}
	
	// Next Button
	if (stNext == ""){
		document.writeln('<img src="images/btn_next_d.gif" alt="" ');
		document.write('width="50" height="25" border="0" >');
	}
	else {		
		stName="next"; stLink=stNext; stTip="next item";
		document.writeln('<a onmouseover="MM_swapImage(');
		document.write  ("'"+stName+stNum+"','','images/btn_"+stName+"_f2.gif', 1); ");
		document.write  ('" onmouseout="MM_swapImgRestore();" href="'+stLink+'">');
		document.write  ('<img height="25" src="images/btn_'+stName+'.gif" width="50" border=0" '); 
		document.write  ('name="'+stName+stNum+'" alt="'+stTip+'"></a>');						
	}
	document.writeln('<img src="images/pic_spacer.gif" alt="" width="4" height="10" border="0">');
	document.write('<img src="images/pic_spacer.gif" alt="" width="165" height="10" border="0" align="top">');	
}


// ----------------------------------------------------------------------
// Begin_PageTabs)
// ----------------------------------------------------------------------
function Begin_PageTabs()
{
	// begin outer table
	document.writeln('<TABLE width="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0"><TR><TD>');
	
	// begin tabs table
	document.writeln('<span class="Tabs">');
	document.writeln('<TABLE align="left" BORDER="0" CELLSPACING="0" CELLPADDING="0"><TR>');
}


// ----------------------------------------------------------------------
// Add_PageTab()
// ----------------------------------------------------------------------
/*
function Add_PageTab(stItem, stLink)
{
	// write a tab 
    if(stLink==""){
		document.writeln('<TD><IMG SRC="images/tab_left_sel.gif" WIDTH="12" HEIGHT="21" BORDER=0></TD>'); 
    	document.writeln('<TD width="250" class="Sel" background="images/tab_ctr_sel.gif">'+stItem+'</TD>');
		document.writeln('<TD><IMG SRC="images/tab_right_sel.gif" WIDTH="16" HEIGHT="21" BORDER=0></TD>');
	}
	else{
		document.writeln('<TD><IMG SRC="images/tab_left_unsel.gif" WIDTH="12" HEIGHT="21" BORDER=0></TD>'); 
    	document.writeln('<td width="250" background="images/tab_ctr_unsel.gif" class="UnSel">');
		document.writeln('<a href="'+stLink+'">'+stItem+'</a></td>');
		document.writeln('<TD><IMG SRC="images/tab_right_unsel.gif" WIDTH="16" HEIGHT="21" BORDER=0></TD>');
	}	
}
*/

// ----------------------------------------------------------------------
// Add_PageTab()
// ----------------------------------------------------------------------
function Add_PageTab(stItem, stLink, stWidth)
{
	// write a tab 
    if(stLink==""){
		document.writeln('<TD><IMG SRC="images/tab_left_sel.gif" WIDTH="12" HEIGHT="21" BORDER=0></TD>'); 
    	document.writeln('<TD width="'+stWidth+'" class="Sel" background="images/tab_ctr_sel.gif"><IMG SRC="images/tab_link_'+stItem+'_sel.gif" WIDTH="116" HEIGHT="21" BORDER=0></TD>');
		document.writeln('<TD><IMG SRC="images/tab_right_sel.gif" WIDTH="16" HEIGHT="21" BORDER=0></TD>');
	}
	else{
		document.writeln('<TD><IMG SRC="images/tab_left_unsel.gif" WIDTH="12" HEIGHT="21" BORDER=0></TD>'); 
    	document.writeln('<TD width="'+stWidth+'" class="UnSel" background="images/tab_ctr_unsel.gif">');
		document.writeln('<a href="'+stLink+'"><IMG SRC="images/tab_link_'+stItem+'_unsel.gif" WIDTH="116" HEIGHT="21" BORDER=0></a></TD>');
		document.writeln('<TD><IMG SRC="images/tab_right_unsel.gif" WIDTH="16" HEIGHT="21" BORDER=0></TD>');
	}	
}

// ----------------------------------------------------------------------
// Begin_PageTabBody()
// ----------------------------------------------------------------------
function Begin_PageTabBody()
{
	// end tabs table 
    document.writeln('</TR></TABLE></span></TD>');
	
	// right spacer and end tabs row
	document.write('<td rowspan="2"><img src="images/pic_spacer.gif" alt="" width="14" height="10" border="0">');
	document.writeln('</td></TR>');
	
	// begin border row and table
	document.writeln('<TR valign="top"><TD>'); 
	document.writeln('<table width="100%" border="1" cellspacing="0" cellpadding="0" bordercolorlight="#0000B9" bordercolordark="#0000B9">');
	document.writeln('<TR valign="top"><TD height="300" >');

	// begin inner table and row
	document.writeln('<table width="95%" border="0" align="center"><tr><td>');	
	
}	

// ----------------------------------------------------------------------
// End_PageTabs()
// ----------------------------------------------------------------------
function End_PageTabs()
{
  	// end of inner table
  	document.writeln('</TD></TR></TABLE>');
	
  	// end of border table
  	document.writeln('</TD></TR></TABLE>');
	
  	// end of outer table
  	document.writeln('</TD></TR></TABLE>');
}

// ----------------------------------------------------------
// FUNCTION: New_Window
// ----------------------------------------------------------
function New_Window(stHRef, stSize)
{
	winNew= window.open(stHRef, 'newWin', stSize);
	//winNew= window.open(stHRef, 'newWin', '');
	winNew.moveTo(10,10);
	winNew.focus();
	//winNew.document.writeln('<br>test');
	//winNew.print();
}
