//first, get the window width to be used in the menu calcs
var myWidth = 0
var myHeight = 0;
var ie;

if (typeof(window.innerWidth) == 'number') {
	//Non-IE
	myWidth = window.innerWidth;
	myHeight = window.innerHeight;
	ie = false;
} else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
	//IE 6+ in 'standards compliant mode'
	myWidth = document.documentElement.clientWidth + 19;
	myHeight = document.documentElement.clientHeight;
	ie = true;
} else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
	//IE 4 compatible
	myWidth = document.body.clientWidth + 19;
	myHeight = document.body.clientHeight;
	ie = true;
}

//for debugging purposes
//window.alert( 'Width = ' + myWidth );
//window.alert( 'Height = ' + myHeight );


var designWidth = 790; // including body margins
var pixelsFromLeft;

if (myWidth > designWidth) {
	
	// change the larger number here; it is the number of pixels to the left from the center of the window... i think... if i remember correctly
	pixelsFromLeft = myWidth / 2 - 399;
	
	if (ie && (myWidth % 2 == 1)) {
		// for some reason when the width of the browser is odd in ie, the menu needs to be moved one
		pixelsFromLeft++;
	}
	/*
	if ((!ie && (myWidth % 2 == 1)) || (ie && (myWidth % 2 == 0))) {
		pixelsFromLeft--;
	}
	*/
}
else {
	// the design's width doesn't fit in the window, so it will appear as being left-aligned
	// so this is the absolute pixel number from the left of your design
	pixelsFromLeft = 56;
}

  
  
//Menu object creation
oCMenu=new makeCM("oCMenu") //Making the menu object. Argument: menuname

oCMenu.frames = 0

//Menu properties   
oCMenu.pxBetween=0
oCMenu.fromLeft=pixelsFromLeft;
oCMenu.fromTop=119
oCMenu.rows=1 
oCMenu.menuPlacement=""

if( navigator.appName == 'Netscape' ){
	oCMenu.fromLeft = pixelsFromLeft;
}


                                                             
oCMenu.offlineRoot="" 
oCMenu.onlineRoot="" 
oCMenu.resizeCheck=1
oCMenu.wait=500 
oCMenu.fillImg="cm_fill.gif"
oCMenu.zIndex=0

//Background bar properties
oCMenu.useBar=0
oCMenu.barWidth="603"
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=25 
oCMenu.level[0].regClass="clLevel0"
oCMenu.level[0].overClass="clLevel0over"
oCMenu.level[0].borderX=0
oCMenu.level[0].borderY=0
oCMenu.level[0].borderClass="clLevel0border"
oCMenu.level[0].offsetX=25
oCMenu.level[0].offsetY=-1
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"

oCMenu.level[1]=new cm_makeLevel() 
oCMenu.level[1].width=oCMenu.level[0].width-2
oCMenu.level[1].height=22
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+53
oCMenu.level[1].offsetY=-1
oCMenu.level[1].borderClass="clLevel1border"

oCMenu.level[2]=new cm_makeLevel() 
oCMenu.level[2].width=oCMenu.level[0].width-2
oCMenu.level[2].height=22
oCMenu.level[2].regClass="clLevel2"
oCMenu.level[2].overClass="clLevel2over"
oCMenu.level[2].borderX=1
oCMenu.level[2].borderY=1
oCMenu.level[2].align="right" 
oCMenu.level[2].offsetX=-(oCMenu.level[0].width-2)/2+53
oCMenu.level[2].offsetY=-1
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','','','/about.cfm','','107','17','/images/m_about.gif','/images/m_about_on.gif');
	oCMenu.makeMenu('sub0_1','top0','Products Available','/about_products.cfm','','130','17');
	//oCMenu.makeMenu('sub0_2','top0','Staff','/about_staff.cfm','','130','17');

oCMenu.makeMenu('top1','','','/encyclopedia/mode,top/class,rft/','','146','17','/images/m_rare.gif','/images/m_rare_on.gif');
	oCMenu.makeMenu('sub1_1','top1','FAQ','/rare_faq.cfm','','130','17');

oCMenu.makeMenu('top2','','','/encyclopedia/mode,top/class,cht/','','175','17','/images/m_cold.gif','/images/m_cold_on.gif');
	oCMenu.makeMenu('sub2_1','top2','FAQ','/cold_faq.cfm','','130','17');

oCMenu.makeMenu('top3','','','/features.cfm','','95','17','/images/m_features.gif','/images/m_features_on.gif');
	
oCMenu.makeMenu('top4','','','/Results.cfm','','79','17','/images/m_store.gif','/images/m_store_on.gif');

oCMenu.makeMenu('top5','','','/contact.cfm','','176','17','/images/m_contact.gif','/images/m_contact_on.gif');
	//oCMenu.makeMenu('sub5_1','top5','Contact Form','/contact_form.cfm','','130','17');
	oCMenu.makeMenu('sub5_2','top5','Guarantees &amp;<br>Return Policies','/policies.cfm','','130','29');
	oCMenu.makeMenu('sub5_3','top5','Wanted Items','/wanted.cfm','','130','17');

//Leave this line - it constructs the menu
oCMenu.construct()	