// IDDAmenus copyright 2003 - Philip Tardif and IDDA - all rights reserved// IDDAmenus default valuesvar justification = "left";var margin_padding = 2;var exit_zone = 400;// var up_dir = (section == "") ? "" : "../";var transparent_img = "images/spacer.gif";doc_url = document.URL;var top_pad = 0;var bottom_pad = 0;var visible_divs = new Array();var IDDAmenus = new Array();var indent_continue = "<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";var indent_continue2 = "<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";var indent_sub_item = "&nbsp;&nbsp;&nbsp;&nbsp;";/* set menu values to the array as such:IDDAmenus[n] = [id_name, left_pos, top_pos, width, height, justification, border, bgcolor, position, visibility,txw, bxw, lxh, lxv, rxh, rxv, txh, bxh, lxw, rxw, css_class, bordercolor, bordercolorlight, bordercolordark,[link_name, link_text, pad_margin, pad_fill, sub_menu, sub_name, arrow_align],[...],[...]];*/var bgcoloralt = "#bb99bb";IDDAmenus[0] = ["p1", 176, 118, 90, , "left", 1, "#cccccc", "absolute", "hidden",, 94, 44, "top", 44, "top", , , , , "itemtext", , , ,["/purchase/ttp_order.php", "Direct", , 16, "no sub", , , "p1_1"],["/purchase/to_buy.php", "Retailers", , 11, "no sub", , , "p1_2"],["/purchase/to_buy_international.html", "International", , 4, "no sub", , , "p1_3"]];/*IDDAmenus[n] = [id_name, left_pos, top_pos, width, height, justification, border, bgcolor, position, visibility,txw, bxw, lxh, lxv, rxh, rxv, txh, bxh, lxw, rxw, css_class, bordercolor, bordercolorlight, bordercolordark,[link_name, link_text, pad_margin, pad_fill, sub_menu, sub_name, arrow_align],];" + indent_continue + "indent_sub_item + 	IDDAmenus[n] = [id_name, left_pos, top_pos, width, height, justification, border, bgcolor, position, visibility,	top_exit_width, bottom_exit_width, left_exit_height, left_exit_valign, right_exit_height, right_exit_valign, top_exit_height,		bottom_exit_height, left_exit_width, right_exit_width, css_class, bordercolor, bordercolorlight, bordercolordark,	[link_name, link_text, pad_margin, pad_fill, sub_menu, sub_name, arrow_align],	];*/function loadMenus() {	var this_doc = document.getElementById('pagebody');	var win_width = this_doc.offsetWidth;	var left_shift = 0;	if(win_width > page_width) {		var dbl_shift = (win_width - page_width);		var mod_dbl_shift = dbl_shift % 2;		if(mod_dbl_shift >= 0) {dbl_shift--;}		var mod_dbl_shift = dbl_shift % 2;		left_shift = dbl_shift/2;	}	var id_name, left_pos, top_pos, width, height, justification, border, position, visibility, txw, bxw, lxh,	lxv, rxh, rxv, txh, bxh, lxw,	rxw, css_class, bgcolor, bordercolor, bordercolorlight, bordercolordark,	link_name, link_text, pad_margin, pad_fill, sub_menu, sub_name, arrow_align, img_id;	var layer_tag = isNav4 ? "layer" : "div";	var close_layer = "";	var empty_layer_tag = "";	if(isNav4) {		empty_layer_tag = "<layer id='empty_layer'>\n";		close_layer = "</layer>\n";	} else {		empty_layer_tag = "<div id='empty_layer' style='position: absolute; left:0px; top:0px; width:1px; z-index:9; visibility: hidden'>\n";		close_layer = "</div>\n";	}	document.write(empty_layer_tag);	document.write("<img src='" + transparent_img + "' height=10 width=10 border='0'>\n");	document.write(close_layer);	if(isNav4) {		document.empty_layer.position = 'absolute'; document.empty_layer.left = 0; document.empty_layer.top = 0;		document.empty_layer.width = 1; document.empty_layer.visibility = 'hidden';	}		var next_menu, next_link, top_exit_bar, pad_right, pad_left;	var left_exit_bar = ""; var right_exit_bar = "";	var margin_string = ""; fill_string = "";	var over_action;	var this_menu = new Array(); var this_link = new Array();	var this_nav4_menu; var this_layer_tag;	var close_this_layer; var nav4_menus = new Array();show_link_cell = 1;	for(next_menu = 0; next_menu < IDDAmenus.length; next_menu++) {		this_menu = IDDAmenus[next_menu];		if(isNav4 && this_menu[0].indexOf("s") > -1) continue; // #####################################################################3		id_name = this_menu[0]; left_pos = this_menu[1]; top_pos = this_menu[2]; width = this_menu[3];		height = this_menu[4]; border = this_menu[6]; bgcolor = this_menu[7];		position = this_menu[8]; visibility = this_menu[9]; txw = this_menu[10]; bxw = this_menu[11];		lxh = this_menu[12]; lxv = this_menu[13]; rxh = this_menu[14];		rxv = this_menu[15]; txh = this_menu[16]; bxh = this_menu[17];		lxw = this_menu[18]; rxw = this_menu[19]; css_class = this_menu[20];		bordercolor = this_menu[21]; bordercolorlight = this_menu[22]; bordercolordark = this_menu[23];		if (this_menu[5]) {justification = this_menu[5];}		height = height ? " height: " + height + ";" : "";		lxw = lxw ? lxw : exit_zone;		rxw = rxw ? rxw : exit_zone;		txh = txh ? txh : exit_zone;		bxh = bxh ? bxh : exit_zone;		rxv = rxv ? " valign='" + rxv + "'" : "";		lxv = lxv ? " valign='" + lxv + "'" : "";		bordercolorlight = bordercolorlight ? " bordercolorlight='" + bordercolorlight + "'" : "";		bordercolordark = bordercolordark ? " bordercolordark='" + bordercolordark + "'" : "";		bordercolor = bordercolor ? " bordercolor='" + bordercolor + "'" : "";		left_exit_bar = ""; right_exit_bar = ""; top_exit_bar = "";//		left_pos += left_shift*1;		if(lxh > 0) {			left_pos -= lxw;			left_exit_bar = "<a href='javascript:' onmouseover='hideMenus(\"empty_layer\");'><img src='" + transparent_img + "' height=" + lxh + " width=" + lxw + " border='0'></a>";		}		if(rxh > 0) {			right_exit_bar = "<a href='javascript:' onmouseover='hideMenus(\"empty_layer\");'><img src='" + transparent_img + "' height=" + rxh + " width=" + rxw + " border='0'></a>";		}		if(txw > 0) {			top_pos -= txh;			top_exit_bar += "	<tr><td></td><td align='left' valign='top'>\n";			top_exit_bar += "		<a href='javascript:' onmouseover='hideMenus(\"empty_layer\");'><img src='" + transparent_img + "' height=" + txh + " width=" + txw + " border='0'></a><br>\n";			top_exit_bar += "	</td><td></td></tr>\n";		}		if(isNav4) {			this_layer_tag = "<layer id='" + id_name + "' class='" + css_class + "' position='absolute' visibility='hidden' left=" + left_pos + " top=" + top_pos + " width=" + width + ">\n";			close_this_layer = "</layer>\n";		} else {			this_layer_tag = "<div id='" + id_name + "' style='position:" + position + "; left:" + left_pos + "px; top:" + top_pos + "px; width:" + width + "px;" + height + " z-index:9; visibility:" + visibility + "' class='" + css_class + "'>\n";			close_this_layer = "</div>\n";		}		document.write(this_layer_tag);		// find out if any of the links here has a sub menu		this_link = new Array();//		this_link = this_menu[next_link];		document.write("<table border=0 cellspacing='0' cellpadding='0'>\n");		if(txw > 0) document.write(top_exit_bar);		document.write("	<tr>\n");		document.write("		<td align='left' " + lxv + ">" + left_exit_bar + "</td>\n");		document.write("		<td align='left' valign='top'>\n");		document.write("			<table bgcolor='#ffffff' cellspacing=0 cellpadding=0>\n");//		document.write("			<table border='" + border + "'" + bordercolor + bordercolorlight + bordercolordark + " cellspacing=0 cellpadding=0>\n");		document.write("				<tr><td align='left' valign='top'>\n");//		document.write("					<table border=0 cellspacing='0' cellpadding='1' bgcolor='" + bgcolor + "' width=" + width + ">\n");		document.write("					<table border=0 cellspacing='0' cellpadding='1' width=" + width + ">\n");//		document.write("						<tr><td align='left' valign='top' colspan=2>\n");//		document.write("							<img src='" + transparent_img + "' height=" + top_pad + " width=" + (width - 2) + " border='0'><br>\n");//		document.write("						</td></tr>\n");		for(next_link = 24; next_link < this_menu.length; next_link++) {			this_link = this_menu[next_link]; pad_margin = 0;			link_name = this_link[0]; link_text = this_link[1];			pad_fill = this_link[3] ? this_link[3] : 0; sub_menu = this_link[4]; sub_name = this_link[5];			pad_margin = this_link[2] ? this_link[2] : margin_padding;			link_id = this_link[7];// hideSecondary() would go here if needed			over_action = " onmouseOver=\"" + link_id + ".style.backgroundColor='" + bgcoloralt + "';\"";			margin_string = ""; fill_string = "";			for(mgnstg = 1; mgnstg <= pad_margin; mgnstg++) {				margin_string += "&nbsp;";			}			for(flstg = 1; flstg <= pad_fill; flstg++) {				fill_string += "&nbsp;";			}			if(justification == "right") {				pad_left = fill_string;				pad_right = margin_string;			} else {				pad_right = fill_string;				pad_left = margin_string;			}//			right_arrow_cell = "<td><img src='" + transparent_img + "' width=2 border=0></td>";			right_arrow_cell = "";link_cell = "							<td align='" + justification + "' valign='top'><div class='" + css_class + "' style='background-color: " + bgcolor + ";' id='" + link_id + "' " + over_action + " onMouseOut=\"" + link_id + ".style.backgroundColor='" + bgcolor + "';\"><nobr><a href='" + link_name + "'>" + pad_left + link_text + pad_right + "</a></nobr></div></td>\n";			document.write("						<tr>\n");			document.write(link_cell);			document.write("						" + right_arrow_cell + "</tr>\n");		}//		document.write("						<tr><td align='left' valign='top' colspan=2>\n");//		document.write("							<img src='" + transparent_img + "' height=" + bottom_pad + " width=" + (width - 2) + " border='0'><br>\n");//		document.write("						</td></tr>\n");		document.write("					</table>\n");		document.write("				</td></tr>\n");		document.write("			</table>\n");		document.write("		</td>\n");		document.write("		<td align='left' " + rxv + ">" + right_exit_bar + "</td>\n");		document.write("	</tr>\n");		document.write("	<tr><td></td><td align='left' valign='top'>\n");		document.write("		<a href='javascript:' onmouseover='hideMenus(\"empty_layer\");'><img src='" + transparent_img + "' height=" + bxh + " width=" + bxw + " border='0'></a><br>\n");		document.write("	</td><td></td></tr>\n");		document.write("</table>\n");//		document.write("</div>\n");		document.write(close_this_layer);	}}var	current_left = 0;var	current_top = 0;var	current_primary = "";var	current_secondary = "";function primaryMenu(div_name) {	var vis_length = visible_divs.length;	var old_primary, new_primary, old_secondary, old_obj, new_obj;	if(vis_length == 1) { // a primary menu is open		if(visible_divs[0] != div_name) {			// hide the previous primary menu			if(old_obj=getObject(visible_divs[0])) {				old_primary=(document.layers)?old_obj:old_obj.style;				 old_primary.visibility="hidden";			}			visible_divs = popOff(visible_divs);		} else {return;}	} else if(vis_length == 2) { // both a primary and a secondary menu are open		// hide the secondary menu		if(old_obj=getObject(visible_divs[1])) {			old_secondary=(document.layers)?old_obj:old_obj.style;			 old_secondary.visibility="hidden";		}		visible_divs = popOff(visible_divs);		if(visible_divs[0] != div_name) {			// hide the previous primary menu			if(old_obj=getObject(visible_divs[0])) {				old_primary=(document.layers)?old_obj:old_obj.style;				 old_primary.visibility="hidden";				visible_divs = popOff(visible_divs);			}		}	} else {} // either there are non or how did so many menus get opened?	if(visible_divs[0] != div_name) {		if(new_obj=getObject(div_name)) {			new_primary=(document.layers)?new_obj:new_obj.style;			 new_primary.visibility="visible";			 visible_divs[visible_divs.length] = div_name;		}	}}function secondaryMenu(div_name, arrow_name) {	var debug = '';	var vis_length = visible_divs.length;	var old_secondary, new_secondary, old_obj, new_obj;	if(vis_length == 1) { // the primary menu only is open		// just open the secondary menu	} else if(vis_length == 2) { // both the primary and a secondary menu are open		// hide the previous secondary menu		if(visible_divs[1] != div_name) {			if(old_obj=getObject(visible_divs[1])) {				old_secondary=(document.layers)?old_obj:old_obj.style;				 old_secondary.visibility="hidden";				 visible_divs = popOff(visible_divs);			}		} else {return true;}		// open the new secondary	} else {		} // either there are none or how did so many menus get opened?	if(new_obj=getObject(div_name)) {		if(document.layers) {			new_secondary = new_obj;		} else {			new_secondary = new_obj.style;		}//		new_secondary=(document.layers)?new_obj:new_obj.c;		if(isNav) {			if(div_name != 'empty_layer') {				current_left += new_secondary.left*1;				current_top += new_secondary.top*1;				current_secondary = div_name;			}		}//debug = "seconary visibility: " + new_secondary.visibility; // ###########################		 new_secondary.visibility="visible";		 visible_divs[visible_divs.length] = div_name;	}//if(debug.length > 0) {alert("debug: " + debug );} // ##########################################return true;}var current_rollover = "";function hideMenus(div_name) {	var vis_length = visible_divs.length;	var old_menu, old_obj, next_div, next_arrow;	var this_div = "";	if(div_name == 'empty_layer') {		current_left = 0;		current_top = 0;	}	for(next_div = vis_length - 1; next_div >= 0 ; next_div -= 1) {		this_div = visible_divs[next_div];		if(old_obj=getObject(this_div)) {			if(document.layers) {				old_menu=old_obj;			} else {old_menu=old_obj.style;}			 old_menu.visibility="hidden";		}		if(visible_divs.length > 0) {visible_divs = popOff(visible_divs);}	}	if(current_rollover.length > 0) {rollOut(current_rollover); current_rollover = "";}}function hideMenus2(div_name) {	var vis_length = visible_divs.length;	var old_menu, old_obj, next_div, next_arrow;	var this_div = "";	if(div_name == 'empty_layer') {		current_left = 0;		current_top = 0;	}	for(next_div = vis_length - 1; next_div >= 0 ; next_div -= 1) {		this_div = visible_divs[next_div];		if(old_obj=getObject(this_div)) {			if(document.layers) {				old_menu=old_obj;			} else {old_menu=old_obj.style;}			 old_menu.visibility="hidden";		}		if(visible_divs.length > 0) {visible_divs = popOff(visible_divs);}	}}function hideSecondary() {	var vis_length = visible_divs.length;	var old_secondary, old_obj, next_arrow, next_vis;	if(vis_length > 2) {		for(next_vis = vis_length - 1; next_vis > 1; next_vis -= 1) {			// hide the previous secondary menu			if(old_obj=getObject(visible_divs[next_vis])) {				old_secondary=(document.layers)?old_obj:old_obj.style;				 old_secondary.visibility="hidden";			}			visible_divs = popOff(visible_divs);		}	}	if(vis_length == 2) { // both the primary and a secondary menu are open		// hide the previous secondary menu		if(old_obj=getObject(visible_divs[1])) {			old_secondary=(document.layers)?old_obj:old_obj.style;			 old_secondary.visibility="hidden";			 visible_divs = popOff(visible_divs);		}	}}function showVisList() {	var vis_length = visible_divs.length;	var next_vis, next_arrow;	var vis_string = "";	for(next_vis = 0; next_vis < vis_length; next_vis++) {		vis_string += visible_divs[next_vis] + "\n";	}}function getObject(n, d) {   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(isNav) {		x = d[n];	} else {		x = d.all[n];	}  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=getObject(n,d.layers[i].document);  }  if(!x && d.getElementById) {	  x=d.getElementById(n);  }  return x;}function getObject2(n, d) {   var p,i,x, y;  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(isNav) {		x = d[n];	} else {		x = d.all[n];	}  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=getObject(n,d.layers[i].document);  }  if(!x && d.getElementById) {	  x=d.getElementById(n);  }  return x;}isNav = false;isNav4 = false;function set_nav() {   with (navigator) {	  if (appName == "Netscape") {		  isNav = true;		  if(appVersion.indexOf('4.') != -1) {			  isNav4 = true;		  }    		document.page_width=innerWidth; document.page_height=innerHeight; onresize=set_nav;		}	}}function popOff(in_array) {	var new_array = new Array();	var array_length = in_array.length;	for(next_el = 0; next_el < array_length-1; next_el++) {		new_array[next_el] = in_array[next_el];	}	in_array = new_array;	return new_array;}set_nav();
