<!--
// File:   styles.js
// Author: Graeme S. McAfee
// Email:  gmcafee@sympatico.ca
// Copyright 2006 Graeme S. McAfee. All rights reserved.
//
// Modification of this code is not permitted without the express permission
// from the author.

// ----------------------------------------------------------------------------
// Set common menu attributes, as desired
// ----------------------------------------------------------------------------
function getMenuStyles(type) {
	var attr = new Array();
	
	switch( type ) {
	case "mainmenu":
		attr["height"]         = 20;
		attr["align"]          = "center";
		attr["font"]           = "Verdana";
		attr["font_size"]      = 11;
		attr["font_weight"]    = "normal";
		attr["bg"]             = "";
		attr["bg_off"]         = "";
		attr["bg_on"]          = "";
		attr["fg_off"]         = "#ffffff"; 
		attr["fg_on"]          = "#c0c0c0";
		attr["border"]         = 0;
		attr["border_color"]   = "";
		attr["spacing"]        = 1;
		attr["z_index"]        = 12;
		attr["open"]           = false;
		break;
		
	case "submenu":
		attr["height"]         = 20;
		attr["align"]          = "left";
		attr["font"]           = "Verdana";
		attr["font_size"]      = 11;
		attr["font_weight"]    = "normal";
                attr["bg"]             = "";
		attr["bg_off"]         = "#eeeeee";
		attr["bg_on"]          = "#ffffff"; //"#566584";
		attr["fg_off"]         = "#000000"; 
		attr["fg_on"]          = "#006699";
		attr["border"]         = 0;
		attr["border_color"]   = "#566584";
	        attr["border_collapse"]= "collapse";
		attr["spacing"]	       = 0;
		attr["z_index"]        = 10;
		attr["open"]           = false;
		break;
	}
	
 
return attr;
}

// Get menu element sytles
function getStyleString(type) {
	var fp  = Math.ceil(((mStyle.height - mStyle.font_size) / 2) - 2);
	var fpe = (mStyle.height % 2 == 0) ? 1 : 0;
	var styleStr = "";
	
	switch( type ) {
	case "mainmenu":
		styleStr += "position:"         + "absolute; "
		styleStr += "border: "          + "solid" + mStyle.border + "px " + mStyle.border_color + "; "
		styleStr += "color:"            + mStyle.fg_off + "; "
		styleStr += "text-align:"       + mStyle.align + "; "
		styleStr += "font-family:"      + mStyle.font + "; "
		styleStr += "font-size:"        + mStyle.font_size + "px; "
		styleStr += "font-weight:"      + mStyle.font_weight + "; "
		styleStr += "white-space:"      + "nowrap; "
		styleStr += "padding:"          + fp + "px 12px " + (fp+fpe) + "px 13px; "
		styleStr += "background:"       + mStyle.bg + "; "
		styleStr += "z-index:"          + mStyle.z_index + "; "
		styleStr += "cursor:"           + "pointer;"
		break;
		
	case "submenu":
		styleStr += "position:"         + "absolute; "
		styleStr += "visibility:"       + "hidden; "
		styleStr += "border:"           + "solid 1px " + sStyle.border_color + "; "
		styleStr += "border-width:"     + sStyle.border + "1px 1px 1px 1px; "
		styleStr += "z-index:"          + sStyle.z_index + "; "
		styleStr += "cursor:"           + "pointer;"
		break;
		
	case "submenuItem":
		styleStr += "position:"         + "relative; "
		styleStr += "border-top-width:" + 0 + "px; "
		styleStr += "color:"            + sStyle.fg_off + "; "
		styleStr += "text-align:"       + sStyle.align + "; "
		styleStr += "font-family:"      + sStyle.font + "; "
		styleStr += "font-size:"        + sStyle.font_size + "px; "
		styleStr += "font-weight:"      + sStyle.font_weight + "; "
		styleStr += "white-space:"      + "wrap; "
		styleStr += "padding:"          + fp + "px 12px " + (fp+fpe) + "px 13px; "
		styleStr += "background:"       + sStyle.bg_off + "; "
		styleStr += "cursor:"           + "pointer;"
		break;
	}
	
	return styleStr;
}
//-->
