
function textCounter(field, countfield, maxlimit) {
	if (field.value.length > maxlimit) {
		field.value = field.value.substring(0, maxlimit)
	} else {
		countfield.innerHTML = '<i>(' + (maxlimit - field.value.length) + ' characters remaining)</i>';
	}
}
	
if (document.images) {
    imag     = new Array()
    imag[0]  = "images/nav1.gif"
    imag[1]  = "images/nav1x.gif"
    imag[2]  = "images/nav2.gif"
    imag[3]  = "images/nav2x.gif"
    imag[4]  = "images/nav3.gif"
    imag[5]  = "images/nav3x.gif"
    imag[6]  = "images/nav4.gif"
    imag[7]  = "images/nav4x.gif"
    imag[8]  = "images/nav5.gif"
    imag[9]  = "images/nav5x.gif"
    imag[10]  = "images/nav6.gif"
    imag[11]  = "images/nav6x.gif"
    imag[12]  = "images/nav7.gif"
    imag[13]  = "images/nav7x.gif"
    imag[14]  = "images/nav8.gif"
    imag[15]  = "images/nav8x.gif"
    imag[16]  = "images/snav1c.gif"
    imag[17]  = "images/snav1cx.gif"
    imag[18]  = "images/snav2c.gif"
    imag[19]  = "images/snav2cx.gif"
    imag[20]  = "images/snav3c.gif"
    imag[21]  = "images/snav3cx.gif"
    imag[22]  = "images/snav1a.gif"
    imag[23]  = "images/snav1ax.gif"
    imag[24]  = "images/snav2a.gif"
    imag[25]  = "images/snav2ax.gif"
    imag[26]  = "images/snav3a.gif"
    imag[27]  = "images/snav3ax.gif"
    imag[28]  = "images/snav4a.gif"
    imag[29]  = "images/snav4ax.gif"
    imag[30]  = "images/snav5a.gif"
    imag[31]  = "images/snav5ax.gif"
    imag[32]  = "images/snav6a.gif"
    imag[33]  = "images/snav6ax.gif"   
    imag[34]  = "images/snav1b.gif"
    imag[35]  = "images/snav1bx.gif"
    imag[36]  = "images/snav2b.gif"
    imag[37]  = "images/snav2bx.gif"
    imag[38]  = "images/snav3b.gif"
    imag[39]  = "images/snav3bx.gif" 
    imag[40]  = "images/snav1d.gif"
    imag[41]  = "images/snav1dx.gif"
    imag[42]  = "images/snav2d.gif"
    imag[43]  = "images/snav2dx.gif"
    imag[44]  = "images/snav3d.gif"
    imag[45]  = "images/snav3dx.gif"    
    imag[46]  = "images/snav1e.gif"
    imag[47]  = "images/snav1ex.gif"
    imag[48]  = "images/snav2e.gif"
    imag[49]  = "images/snav2ex.gif"
    imag[50]  = "images/snav3e.gif"
    imag[51]  = "images/snav3ex.gif" 
    imag[52]  = "images/snav4e.gif"
    imag[53]  = "images/snav4ex.gif" 
    
    
im = new Array()
for (var i = 0; i < imag.length; i++){
       im[i] = new Image()
       im[i].src = imag[i]

}

}


function constructMenu(){
/*** 
This is the menu creation code - place it right after you body tag
Feel free to add this to a stand-alone js file and link it to your page.
**/

//Menu object creation
oCMenu=new makeCM("oCMenu") //Making the menu object. Argument: menuname

oCMenu.frames = 0

//Menu properties   
oCMenu.pxBetween=0
oCMenu.fromLeft=0 
oCMenu.fromTop=0   
oCMenu.rows=1 
oCMenu.menuPlacement="left"
                                                             
oCMenu.offlineRoot="file:///C|/Inetpub/wwwroot/dhtmlcentral/projects/coolmenus/examples/" 
oCMenu.onlineRoot="/coolmenus/" 
oCMenu.resizeCheck=1 
oCMenu.wait=1000 
oCMenu.fillImg="cm_fill.gif"
oCMenu.zIndex=0

//Background bar properties
oCMenu.useBar=1
oCMenu.barWidth="100%"
oCMenu.barHeight="menu" 
oCMenu.barClass="clBar"
oCMenu.barX=0 
oCMenu.barY=0
oCMenu.barBorderX=0
oCMenu.barBorderY=0
oCMenu.barBorderClass=""

//Level properties - ALL properties have to be spesified in level 0
oCMenu.level[0]=new cm_makeLevel() //Add this for each new level
oCMenu.level[0].width=110
oCMenu.level[0].height=20
oCMenu.level[0].regClass="clLevel0"
oCMenu.level[0].overClass="clLevel0over"
oCMenu.level[0].borderX=1
oCMenu.level[0].borderY=1
oCMenu.level[0].borderClass="clLevel0border"
oCMenu.level[0].offsetX=0
oCMenu.level[0].offsetY=0
oCMenu.level[0].rows=0
oCMenu.level[0].arrow=0
oCMenu.level[0].arrowWidth=0
oCMenu.level[0].arrowHeight=0
oCMenu.level[0].align="bottom"

//EXAMPLE SUB LEVEL[1] PROPERTIES - You have to specify the properties you want different from LEVEL[0] - If you want all items to look the same just remove this
oCMenu.level[1]=new cm_makeLevel() //Add this for each new level (adding one to the number)
oCMenu.level[1].width=oCMenu.level[0].width-2
oCMenu.level[1].height=18
oCMenu.level[1].regClass="clLevel1"
oCMenu.level[1].overClass="clLevel1over"
oCMenu.level[1].borderX=1
oCMenu.level[1].borderY=1
oCMenu.level[1].align="right" 
oCMenu.level[1].offsetX=-(oCMenu.level[0].width-2)/2+20
oCMenu.level[1].offsetY=0
oCMenu.level[1].borderClass="clLevel1border"


//EXAMPLE SUB LEVEL[2] PROPERTIES - You have to spesify the properties you want different from LEVEL[1] OR LEVEL[0] - If you want all items to look the same just remove this
oCMenu.level[2]=new cm_makeLevel() //Add this for each new level (adding one to the number)
oCMenu.level[2].width=150
oCMenu.level[2].height=18
oCMenu.level[2].offsetX=0
oCMenu.level[2].offsetY=0
oCMenu.level[2].regClass="clLevel2"
oCMenu.level[2].overClass="clLevel2over"
oCMenu.level[2].borderClass="clLevel2border"


/******************************************
Menu item creation:
myCoolMenu.makeMenu(name, parent_name, text, link, target, width, height, regImage, overImage, regClass, overClass , align, rows, nolink, onclick, onmouseover, onmouseout) 
*************************************/
oCMenu.makeMenu('top0','','&nbsp;SCHEDULE','schedule.html','','80')
  oCMenu.makeMenu('sub00','top0','2006 Overall Schedule','pdf/2006_OD_Overall_Schedule.pdf','','150')
  oCMenu.makeMenu('sub01','top0','Meeting Schedule','meetingschedule.html','','150')
  oCMenu.makeMenu('sub02','top0','Crew Sign-Up','crewsignup.html','','150')
  oCMenu.makeMenu('sub03','top0','Available Crew','availablecrew.html','','150')  
	
oCMenu.makeMenu('top1','','&nbsp;RACE RESULTS','raceresults.html')
	oCMenu.makeMenu('sub10','top1','2005','2005.html')
	oCMenu.makeMenu('sub11','top1','2006','2006.html')
	
oCMenu.makeMenu('top2','','&nbsp;FORMS','forms.html','','60')
	oCMenu.makeMenu('sub21','top2','International Etchells Sign-Up ','internationalsignup.html','','200')
	oCMenu.makeMenu('sub22','top2','Fleet By-Laws','fleetbylaws.html','','200')
	oCMenu.makeMenu('sub23','top2','2006 One Design Entry Form','pdf/2006_One_Design_Entry_Form.pdf','','200')
	

oCMenu.makeMenu('top3','','&nbsp;TUNING GUIDES','tuningguides.html')
	oCMenu.makeMenu('sub30','top3','Doyle','doyle.html')
	oCMenu.makeMenu('sub31','top3','North','north.html')
	oCMenu.makeMenu('sub32','top3','Shore','shore.html')

oCMenu.makeMenu('top5','','&nbsp;SAILING INSTRUCTIONS','sailinginstructions.html','','150')
	oCMenu.makeMenu('sub50','top5','2006 One Design Program','pdf/2006_One_Design_program.pdf','','170')
	oCMenu.makeMenu('sub51','top5','2006 One Design Combined','pdf/2006_One_Design_Combined_NOR.pdf','','170')
	
oCMenu.makeMenu('top6','','&nbsp;EVENT PHOTOS','eventphotos.html','','100')

oCMenu.makeMenu('top7','','&nbsp;DIRECTIONS','directions.html','','85')
	
oCMenu.makeMenu('top8','','&nbsp;CONTACT','CONTACT','','70')
	oCMenu.makeMenu('sub80','top8','Email Fleet Captain','emailfleetcaptain.html','','150')
	oCMenu.makeMenu('sub81','top8','Email First Officer','emailfirstofficer.html','','150')		
	oCMenu.makeMenu('sub82','top8','Email Fleet Treasurer','emailfleettreasurer.html','','150')	
	
//Leave this line - it constructs the menu
oCMenu.construct()		
}



function swtch(num,imgname){
if (document.images) {
     document[imgname].src = im[num].src;
  }

}

