function floatloc() {
	if (parseInt(navigator.appVersion)>3) {
		if (navigator.appName=="Netscape") {
  			var floatpos = 1010-385;
			var floatpos2 = - 77;
			var floatpos3 = 25;
			var floatvert3 = window.innerHeight - 40;
			var floatpos4 = (window.innerWidth/2)+100;
			var floatvert4 = 180;
 		}
 		if (navigator.appName.indexOf("Microsoft")!=-1) {
			var floatpos = 1010-385;
			var floatpos2 = - 77;
			var floatpos3 = 25;
			var floatvert3 = document.documentElement.clientHeight - 40;
			var floatpos4 = (document.documentElement.clientWidth/2) - 300;
			var floatvert4 = 180;
		}
		if (navigator.appVersion.indexOf("MSIE 6.")!=-1) {
			var floatpos = 1010-415;
			var floatpos2 = - 102;
			var floatpos3 = 0;
			var floatvert = 0;
			var floatvert3 = 150;
			var floatpos4 = 300;
			var floatvert4 = 180;
			document.getElementById('floatdiv').style.position="absolute";
			document.getElementById('floatdiv').style.marginLeft=(floatpos)+"px";
			document.getElementById('floatdiv').style.marginTop=(floatvert)+"px";
			document.getElementById('flowersdiv').style.position="absolute";
			document.getElementById('flowersdiv').style.marginLeft=(floatpos2)+"px";
			document.getElementById('floatadddiv').style.position="absolute";
			document.getElementById('floatadddiv').style.marginLeft=(floatpos3)+"px";
			document.getElementById('floatadddiv').style.marginTop=(floatvert3)+"px";
			document.getElementById('floatbusydiv').style.position="absolute";
			document.getElementById('floatbusydiv').style.marginLeft=(floatpos4)+"px";
			document.getElementById('floatbusydiv').style.marginTop=(floatvert4)+"px";
		}
		else if (navigator.appVersion.indexOf("MSIE 7.")!=-1) {
			var floatpos = 1010-410;
			var floatpos2 = - 102;
			var floatpos3 = 0;
			var floatvert3 = document.documentElement.clientHeight - 40;
			var floatpos4 = (document.documentElement.clientWidth/2) - 300;
			var floatvert4 = 180;
			document.getElementById('floatdiv').style.marginLeft=(floatpos)+"px";
			document.getElementById('flowersdiv').style.marginLeft=(floatpos2)+"px";
			document.getElementById('floatadddiv').style.marginLeft=(floatpos3)+"px";
			document.getElementById('floatadddiv').style.marginTop=(floatvert3)+"px";
			document.getElementById('floatbusydiv').style.marginLeft=(floatpos4)+"px";
			document.getElementById('floatbusydiv').style.marginTop=(floatvert4)+"px";
		}
		else if (navigator.userAgent.indexOf('iPhone')!=-1 || navigator.userAgent.indexOf('iPod')!=-1 || navigator.userAgent.indexOf('iPad')!=-1){
			document.getElementById('floatdiv').style.marginLeft=floatpos+"px";
			document.getElementById('flowersdiv').style.marginLeft=floatpos2+"px";
			document.getElementById('floatadddiv').style.marginLeft=floatpos3+"px";
			document.getElementById('floatadddiv').style.marginTop="160px";
			document.getElementById('floatbusydiv').style.marginLeft=floatpos4+"px";
			document.getElementById('floatbusydiv').style.marginTop=floatvert4+"px";
		}
		else {
			document.getElementById('floatdiv').style.marginLeft=floatpos+"px";
			document.getElementById('flowersdiv').style.marginLeft=floatpos2+"px";
			document.getElementById('floatadddiv').style.marginLeft=floatpos3+"px";
			document.getElementById('floatadddiv').style.marginTop=floatvert3+"px";
			document.getElementById('floatbusydiv').style.marginLeft=floatpos4+"px";
			document.getElementById('floatbusydiv').style.marginTop=floatvert4+"px";
		}
	}
}
// <!-- <![CDATA[

// Project: Dynamic Date Selector (DtTvB) - 2006-03-16
// Script featured on JavaScript Kit- http://www.javascriptkit.com
// Code begin...
// Set the initial date.
var ds_i_date = new Date();
ds_c_month = ds_i_date.getMonth() + 1;
ds_c_year = ds_i_date.getFullYear();

// Get Element By Id
function ds_getel(id) {
	return document.getElementById(id);
}

// Get the left and the top of the element.
function ds_getleft(el) {
	var tmp = el.offsetLeft;
	el = el.offsetParent
	while(el) {
		tmp += el.offsetLeft;
		el = el.offsetParent;
	}
	return tmp;
}

function ds_gettop(el) {
	var tmp = el.offsetTop;
	el = el.offsetParent
	while(el) {
		tmp += el.offsetTop;
		el = el.offsetParent;
	}
	return tmp;
}

// Output Element
var ds_oe = ds_getel('ds_calclass');
// Container
var ds_ce = ds_getel('ds_conclass');

// Output Buffering
var ds_ob = ''; 

function ds_ob_clean() {
	ds_ob = '';
}

function ds_ob_flush() {
	ds_oe.innerHTML = ds_ob;
	ds_ob_clean();
}

function ds_echo(t) {
	ds_ob += t;
}

var ds_element; // Text Element...

var ds_monthnames = [
'January', 'February', 'March', 'April', 'May', 'June',
'July', 'August', 'September', 'October', 'November', 'December'
]; // You can translate it for your language.

var ds_daynames = [
'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'
]; // You can translate it for your language.

// Calendar template
function ds_template_main_above(t) {
	return '<table cellpadding="3" cellspacing="1" class="ds_tbl">'
	     + '<tr>'
		 + '<td class="ds_head" style="cursor: pointer" onclick="ds_py();">&lt;&lt;</td>'
		 + '<td class="ds_head" style="cursor: pointer" onclick="ds_pm();">&lt;</td>'
		 + '<td class="ds_head" style="cursor: pointer" onclick="ds_hi();" colspan="3">Close</td>'
		 + '<td class="ds_head" style="cursor: pointer" onclick="ds_nm();">&gt;</td>'
		 + '<td class="ds_head" style="cursor: pointer" onclick="ds_ny();">&gt;&gt;</td>'
		 + '</tr>'
	     + '<tr>'
		 + '<td colspan="7" class="ds_head">' + t + '</td>'
		 + '</tr>'
		 + '<tr>';
}

function ds_template_day_row(t) {
	return '<td class="ds_subhead">' + t + '</td>';
	// Define width in CSS, XHTML 1.0 Strict doesn't have width property for it.
}

function ds_template_new_week() {
	return '</tr><tr>';
}

function ds_template_blank_cell(colspan) {
	return '<td colspan="' + colspan + '"></td>'
}

function ds_template_day(d, m, y) {
	return '<td class="ds_cell" onclick="ds_onclick(' + d + ',' + m + ',' + y + ')">' + d + '</td>';
	// Define width the day row.
}

function ds_template_main_below() {
	return '</tr>'
	     + '</table>';
}

// This one draws calendar...
function ds_draw_calendar(m, y) {
	// First clean the output buffer.
	ds_ob_clean();
	// Here we go, do the header
	ds_echo (ds_template_main_above(ds_monthnames[m - 1] + ' ' + y));
	for (i = 0; i < 7; i ++) {
		ds_echo (ds_template_day_row(ds_daynames[i]));
	}
	// Make a date object.
	var ds_dc_date = new Date();
	ds_dc_date.setDate(1);
	ds_dc_date.setMonth(m - 1);
	ds_dc_date.setFullYear(y);
	if (m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12) {
		days = 31;
	} 
	else if (m == 4 || m == 6 || m == 9 || m == 11) {
		days = 30;
	} 
	else {
		days = (y % 4 == 0) ? 29 : 28;
	}
	var first_day = ds_dc_date.getDay();
	var first_loop = 1;
	// Start the first week
	ds_echo (ds_template_new_week());
	// If monday is not the first day of the month, make a blank cell...
	if (first_day != 1) {
		ds_echo (ds_template_blank_cell(first_day-(1*(first_day!=0))+(6*(first_day==0))));
	}
	var j = first_day;
	for (i = 0; i < days; i ++) {
		// Today is monday, make a new week.
		// If this monday is the first day of the month,
		// we've made a new row for you already.
		if (j == 1 && !first_loop) {
			// New week!!
			ds_echo (ds_template_new_week());
		}
		// Make a row of that day!
		ds_echo (ds_template_day(i + 1, m, y));
		// This is not first loop anymore...
		first_loop = 0;
		// What is the next day?
		j ++;
		j %= 7;
	}
	// Do the footer
	ds_echo (ds_template_main_below());
	// And let's display..
	ds_ob_flush();
	// Scroll it into view.	
}

// A function to show the calendar.
// When user click on the date, it will set the content of t.
function ds_sh(t) {
	// Set the element to set...
	ds_element = t;
	// Make a new date, and set the current month and year.
	var ds_sh_date = new Date();
	ds_c_month = ds_sh_date.getMonth() + 1;
	ds_c_year = ds_sh_date.getFullYear();
	// Draw the calendar
	ds_draw_calendar(ds_c_month, ds_c_year);
	// To change the position properly, we must show it first.
	ds_ce.style.display = '';
	// Move the calendar container!
	the_left = ds_getleft(t);
	the_top = ds_gettop(t) + t.offsetHeight;
	ds_ce.style.left = the_left + 'px';
	ds_ce.style.top = the_top + 'px';
}

// Hide the calendar.
function ds_hi() {
	ds_ce.style.display = 'none';
}

// Moves to the next month...
function ds_nm() {
	// Increase the current month.
	ds_c_month ++;
	// We have passed December, let's go to the next year.
	// Increase the current year, and set the current month to January.
	if (ds_c_month > 12) {
		ds_c_month = 1; 
		ds_c_year++;
	}
	// Redraw the calendar.
	ds_draw_calendar(ds_c_month, ds_c_year);
}

// Moves to the previous month...
function ds_pm() {
	ds_c_month = ds_c_month - 1; // Can't use dash-dash here, it will make the page invalid.
	// We have passed January, let's go back to the previous year.
	// Decrease the current year, and set the current month to December.
	if (ds_c_month < 1) {
		ds_c_month = 12; 
		ds_c_year = ds_c_year - 1; // Can't use dash-dash here, it will make the page invalid.
	}
	// Redraw the calendar.
	ds_draw_calendar(ds_c_month, ds_c_year);
}

// Moves to the next year...
function ds_ny() {
	// Increase the current year.
	ds_c_year++;
	// Redraw the calendar.
	ds_draw_calendar(ds_c_month, ds_c_year);
}

// Moves to the previous year...
function ds_py() {
	// Decrease the current year.
	ds_c_year = ds_c_year - 1; // Can't use dash-dash here, it will make the page invalid.
	// Redraw the calendar.
	ds_draw_calendar(ds_c_month, ds_c_year);
}

// Format the date to output.
function ds_format_date(d, m, y) {
	// 3 chars month.
	if (m == 1) {
		m2 = 'JAN';
	} 
	else if (m == 2) {
		m2 = 'FEB';
	} 
	else if (m == 3) {
		m2 = 'MAR';
	} 
	else if (m == 4) {
		m2 = 'APR';
	} 
	else if (m == 5) {
		m2 = 'MAY';
	} 
	else if (m == 6) {
		m2 = 'JUN';
	} 
	else if (m == 7) {
		m2 = 'JUL';
	} 
	else if (m == 8) {
		m2 = 'AUG';
	} 
	else if (m == 9) {
		m2 = 'SEP';
	} 
	else if (m == 10) {
		m2 = 'OCT';
	} 
	else if (m == 11) {
		m2 = 'NOV';
	} 
	else if (m == 12) {
		m2 = 'DEC';
	}
	// 2 digits day.
	d2 = '00' + d;
	d2 = d2.substr(d2.length - 2);
	// YYYY-MM-DD
	return m2 + ' ' + d2 + ' ' + y;
}

// When the user clicks the day.
function ds_onclick(d, m, y) {
	// Hide the calendar.
	ds_hi();
	// Set the value of it, if we can.
	if (typeof(ds_element.value) != 'undefined') {
		ds_element.value = ds_format_date(d, m, y);
	// Maybe we want to set the HTML in it.
	} else if (typeof(ds_element.innerHTML) != 'undefined') {
		ds_element.innerHTML = ds_format_date(d, m, y);
	// I don't know how should we display it, just alert it to user.
	} else {
		alert (ds_format_date(d, m, y));
	}
	checkdate();
}

function mmLoadMenus() {
  if (window.mm_menu_0323154225_0) return;
        window.mm_menu_0323154225_0 = new Menu("root",154,15,"Verdana, Arial, Helvetica, sans-serif",9,"#C2D8E3","#FFFFFF","#61809F","#738EAB","left","middle",3,0,1000,-5,7,true,false,true,0,true,true);
  	mm_menu_0323154225_0.addMenuItem("New&nbsp;Products","location='/pages_spring/new_0106_enter.html'");
  	mm_menu_0323154225_0.addMenuItem("Tradeshows","location='pages_redesign/tradeshows_n.html'");
  	mm_menu_0323154225_0.addMenuItem("Prospective&nbsp;Retailers","location='pages_redesign/retailers_n.html'");
  	mm_menu_0323154225_0.fontWeight="bold";
  	mm_menu_0323154225_0.hideOnMouseOut=true;
   	mm_menu_0323154225_0.bgColor='#555555';
   	mm_menu_0323154225_0.menuBorder=1;
   	mm_menu_0323154225_0.menuLiteBgColor='#FFFFFF';
   	mm_menu_0323154225_0.menuBorderBgColor='#FFFFFF';
	mm_menu_0323154225_0.writeMenus();
} // mmLoadMenus()

function MM_findObj(n, d) { //v4.01
  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);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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 MM_swapImage() { //v3.0
  var i,j=0,x,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 Menu(label, mw, mh, fnt, fs, fclr, fhclr, bg, bgh, halgn, valgn, pad, space, to, sx, sy, srel, opq, vert, idt, aw, ah) {
	this.version = "020320 [Menu; mm_menu.js]";
	this.type = "Menu";
	this.menuWidth = mw;
	this.menuItemHeight = mh;
	this.fontSize = fs;
	this.fontWeight = "plain";
	this.fontFamily = fnt;
	this.fontColor = fclr;
	this.fontColorHilite = fhclr;
	this.bgColor = "#555555";
	this.menuBorder = 1;
	this.menuBgOpaque=opq;
	this.menuItemBorder = 1;
	this.menuItemIndent = idt;
	this.menuItemBgColor = bg;
	this.menuItemVAlign = valgn;
	this.menuItemHAlign = halgn;
	this.menuItemPadding = pad;
	this.menuItemSpacing = space;
	this.menuLiteBgColor = "#ffffff";
	this.menuBorderBgColor = "#777777";
	this.menuHiliteBgColor = bgh;
	this.menuContainerBgColor = "#cccccc";
	this.childMenuIcon = "arrows.gif";
	this.submenuXOffset = sx;
	this.submenuYOffset = sy;
	this.submenuRelativeToItem = srel;
	this.vertical = vert;
	this.items = new Array();
	this.actions = new Array();
	this.childMenus = new Array();
	this.hideOnMouseOut = true;
	this.hideTimeout = to;
	this.addMenuItem = addMenuItem;
	this.writeMenus = writeMenus;
	this.MM_showMenu = MM_showMenu;
	this.onMenuItemOver = onMenuItemOver;
	this.onMenuItemAction = onMenuItemAction;
	this.hideMenu = hideMenu;
	this.hideChildMenu = hideChildMenu;
	if (!window.menus) window.menus = new Array();
	this.label = " " + label;
	window.menus[this.label] = this;
	window.menus[window.menus.length] = this;
	if (!window.activeMenus) window.activeMenus = new Array();
}

function addMenuItem(label, action) {
	this.items[this.items.length] = label;
	this.actions[this.actions.length] = action;
}

function FIND(item) {
	if( window.mmIsOpera ) return(document.getElementById(item));
	if (document.all) return(document.all[item]);
	if (document.getElementById) return(document.getElementById(item));
	return(false);
}

function writeMenus(container) {
	if (window.triedToWriteMenus) return;
	var agt = navigator.userAgent.toLowerCase();
	window.mmIsOpera = agt.indexOf("opera") != -1;
	if (!container && document.layers) {
		window.delayWriteMenus = this.writeMenus;
		var timer = setTimeout('delayWriteMenus()', 500);
		container = new Layer(100);
		clearTimeout(timer);
	} else if (document.all || document.hasChildNodes || window.mmIsOpera) {
		document.writeln('<span id="menuContainer"></span>');
		container = FIND("menuContainer");
	}

	window.mmHideMenuTimer = null;
	if (!container) return;	
	window.triedToWriteMenus = true; 
	container.isContainer = true;
	container.menus = new Array();
	for (var i=0; i<window.menus.length; i++) 
		container.menus[i] = window.menus[i];
	window.menus.length = 0;
	var countMenus = 0;
	var countItems = 0;
	var top = 0;
	var content = '';
	var lrs = false;
	var theStat = "";
	var tsc = 0;
	if (document.layers) lrs = true;
	for (var i=0; i<container.menus.length; i++, countMenus++) {
		var menu = container.menus[i];
		if (menu.bgImageUp || !menu.menuBgOpaque) {
			menu.menuBorder = 0;
			menu.menuItemBorder = 0;
		}
		if (lrs) {
			var menuLayer = new Layer(100, container);
			var lite = new Layer(100, menuLayer);
			lite.top = menu.menuBorder;
			lite.left = menu.menuBorder;
			var body = new Layer(100, lite);
			body.top = menu.menuBorder;
			body.left = menu.menuBorder;
		} else {
			content += ''+
			'<div id="menuLayer'+ countMenus +'" style="position:absolute;z-index:1;left:10px;top:'+ (i * 100) +'px;visibility:hidden;color:' +  menu.menuBorderBgColor + ';">\n'+
			'  <div id="menuLite'+ countMenus +'" style="position:absolute;z-index:1;left:'+ menu.menuBorder +'px;top:'+ menu.menuBorder +'px;visibility:hide;" onmouseout="mouseoutMenu();">\n'+
			'	 <div id="menuFg'+ countMenus +'" style="position:absolute;left:'+ menu.menuBorder +'px;top:'+ menu.menuBorder +'px;visibility:hide;">\n'+
			'';
		}
		var x=i;
		for (var i=0; i<menu.items.length; i++) {
			var item = menu.items[i];
			var childMenu = false;
			var defaultHeight = menu.fontSize+2*menu.menuItemPadding;
			if (item.label) {
				item = item.label;
				childMenu = true;
			}
			menu.menuItemHeight = menu.menuItemHeight || defaultHeight;
			var itemProps = '';
			if( menu.fontFamily != '' ) itemProps += 'font-family:' + menu.fontFamily +';';
			itemProps += 'font-weight:' + menu.fontWeight + ';fontSize:' + menu.fontSize + 'px;';
			if (menu.fontStyle) itemProps += 'font-style:' + menu.fontStyle + ';';
			if (document.all || window.mmIsOpera) 
				itemProps += 'font-size:' + menu.fontSize + 'px;" onmouseover="onMenuItemOver(null,this);" onclick="onMenuItemAction(null,this);';
			else if (!document.layers) {
				itemProps += 'font-size:' + menu.fontSize + 'px;';
			}
			var l;
			if (lrs) {
				var lw = menu.menuWidth;
				if( menu.menuItemHAlign == 'right' ) lw -= menu.menuItemPadding;
				l = new Layer(lw,body);
			}
			var itemLeft = 0;
			var itemTop = i*menu.menuItemHeight;
			if( !menu.vertical ) {
				itemLeft = i*menu.menuWidth;
				itemTop = 0;
			}
			var dTag = '<div id="menuItem'+ countItems +'" style="position:absolute;left:' + itemLeft + 'px;top:'+ itemTop +'px;'+ itemProps +'">';
			var dClose = '</div>'
			if (menu.bgImageUp) dTag = '<div id="menuItem'+ countItems +'" style="background:url('+menu.bgImageUp+');position:absolute;left:' + itemLeft + 'px;top:'+ itemTop +'px;'+ itemProps +'">';

			var left = 0, top = 0, right = 0, bottom = 0;
			left = 1 + menu.menuItemPadding + menu.menuItemIndent;
			right = left + menu.menuWidth - 2*menu.menuItemPadding - menu.menuItemIndent;
			if( menu.menuItemVAlign == 'top' ) top = menu.menuItemPadding;
			if( menu.menuItemVAlign == 'bottom' ) top = menu.menuItemHeight-menu.fontSize-1-menu.menuItemPadding;
			if( menu.menuItemVAlign == 'middle' ) top = ((menu.menuItemHeight/2)-(menu.fontSize/2)-1);
			bottom = menu.menuItemHeight - 2*menu.menuItemPadding;
			var textProps = 'position:absolute;left:' + left + 'px;top:' + top + 'px;';
			if (lrs) {
				textProps +=itemProps + 'right:' + right + ';bottom:' + bottom + ';';
				dTag = "";
				dClose = "";
			}
			
			if(document.all && !window.mmIsOpera) {
				item = '<div align="' + menu.menuItemHAlign + '">' + item + '</div>';
			} else if (lrs) {
				item = '<div style="text-align:' + menu.menuItemHAlign + ';">' + item + '</div>';
			} else {
				var hitem = null;
				if( menu.menuItemHAlign != 'left' ) {
					if(window.mmIsOpera) {
						var operaWidth = menu.menuItemHAlign == 'center' ? -(menu.menuWidth-2*menu.menuItemPadding) : (menu.menuWidth-6*menu.menuItemPadding);
						hitem = '<div id="menuItemHilite' + countItems + 'Shim" style="position:absolute;top:1px;left:' + menu.menuItemPadding + 'px;width:' + operaWidth + 'px;text-align:' 
							+ menu.menuItemHAlign + ';visibility:visible;">' + item + '</div>';
						item = '<div id="menuItemText' + countItems + 'Shim" style="position:absolute;top:1px;left:' + menu.menuItemPadding + 'px;width:' + operaWidth + 'px;text-align:' 
							+ menu.menuItemHAlign + ';visibility:visible;">' + item + '</div>';
					} else {
						hitem = '<div id="menuItemHilite' + countItems + 'Shim" style="position:absolute;top:1px;left:1px;right:-' + (left+menu.menuWidth-3*menu.menuItemPadding) + 'px;text-align:' 
							+ menu.menuItemHAlign + ';visibility:visible;">' + item + '</div>';
						item = '<div id="menuItemText' + countItems + 'Shim" style="position:absolute;top:1px;left:1px;right:-' + (left+menu.menuWidth-3*menu.menuItemPadding) + 'px;text-align:' 
							+ menu.menuItemHAlign + ';visibility:visible;">' + item + '</div>';
					}
				} else hitem = null;
			}
			if(document.all && !window.mmIsOpera) item = '<div id="menuItemShim' + countItems + '" style="position:absolute;left:0px;top:0px;">' + item + '</div>';
			var dText	= '<div id="menuItemText'+ countItems +'" style="' + textProps + 'color:'+ menu.fontColor +';">'+ item +'&nbsp</div>\n'
						+ '<div id="menuItemHilite'+ countItems +'" style="' + textProps + 'color:'+ menu.fontColorHilite +';visibility:hidden;">' 
						+ (hitem||item) +'&nbsp</div>';
			if (childMenu) content += ( dTag + dText + '<div id="childMenu'+ countItems +'" style="position:absolute;left:0px;top:3px;"><img src="'+ menu.childMenuIcon +'"></div>\n' + dClose);
			else content += ( dTag + dText + dClose);
			if (lrs) {
				l.document.open("text/html");
				l.document.writeln(content);
				l.document.close();	
				content = '';
				theStat += "-";
				tsc++;
				if (tsc > 50) {
					tsc = 0;
					theStat = "";
				}
				status = theStat;
			}
			countItems++;  
		}
		if (lrs) {
			var focusItem = new Layer(100, body);
			focusItem.visiblity="hidden";
			focusItem.document.open("text/html");
			focusItem.document.writeln("&nbsp;");
			focusItem.document.close();	
		} else {
		  content += '	  <div id="focusItem'+ countMenus +'" style="position:absolute;left:0px;top:0px;visibility:hide;" onclick="onMenuItemAction(null,this);">&nbsp;</div>\n';
		  content += '   </div>\n  </div>\n</div>\n';
		}
		i=x;
	}
	if (document.layers) {		
		container.clip.width = window.innerWidth;
		container.clip.height = window.innerHeight;
		container.onmouseout = mouseoutMenu;
		container.menuContainerBgColor = this.menuContainerBgColor;
		for (var i=0; i<container.document.layers.length; i++) {
			proto = container.menus[i];
			var menu = container.document.layers[i];
			container.menus[i].menuLayer = menu;
			container.menus[i].menuLayer.Menu = container.menus[i];
			container.menus[i].menuLayer.Menu.container = container;
			var body = menu.document.layers[0].document.layers[0];
			body.clip.width = proto.menuWidth || body.clip.width;
			body.clip.height = proto.menuHeight || body.clip.height;
			for (var n=0; n<body.document.layers.length-1; n++) {
				var l = body.document.layers[n];
				l.Menu = container.menus[i];
				l.menuHiliteBgColor = proto.menuHiliteBgColor;
				l.document.bgColor = proto.menuItemBgColor;
				l.saveColor = proto.menuItemBgColor;
				l.onmouseover = proto.onMenuItemOver;
				l.onclick = proto.onMenuItemAction;
				l.mmaction = container.menus[i].actions[n];
				l.focusItem = body.document.layers[body.document.layers.length-1];
				l.clip.width = proto.menuWidth || body.clip.width;
				l.clip.height = proto.menuItemHeight || l.clip.height;
				if (n>0) {
					if( l.Menu.vertical ) l.top = body.document.layers[n-1].top + body.document.layers[n-1].clip.height + proto.menuItemBorder + proto.menuItemSpacing;
					else l.left = body.document.layers[n-1].left + body.document.layers[n-1].clip.width + proto.menuItemBorder + proto.menuItemSpacing;
				}
				l.hilite = l.document.layers[1];
				if (proto.bgImageUp) l.background.src = proto.bgImageUp;
				l.document.layers[1].isHilite = true;
				if (l.document.layers.length > 2) {
					l.childMenu = container.menus[i].items[n].menuLayer;
					l.document.layers[2].left = l.clip.width -13;
					l.document.layers[2].top = (l.clip.height / 2) -4;
					l.document.layers[2].clip.left += 3;
					l.Menu.childMenus[l.Menu.childMenus.length] = l.childMenu;
				}
			}
			if( proto.menuBgOpaque ) body.document.bgColor = proto.bgColor;
			if( proto.vertical ) {
				body.clip.width  = l.clip.width +proto.menuBorder;
				body.clip.height = l.top + l.clip.height +proto.menuBorder;
			} else {
				body.clip.height  = l.clip.height +proto.menuBorder;
				body.clip.width = l.left + l.clip.width  +proto.menuBorder;
				if( body.clip.width > window.innerWidth ) body.clip.width = window.innerWidth;
			}
			var focusItem = body.document.layers[n];
			focusItem.clip.width = body.clip.width;
			focusItem.Menu = l.Menu;
			focusItem.top = -30;
            focusItem.captureEvents(Event.MOUSEDOWN);
            focusItem.onmousedown = onMenuItemDown;
			if( proto.menuBgOpaque ) menu.document.bgColor = proto.menuBorderBgColor;
			var lite = menu.document.layers[0];
			if( proto.menuBgOpaque ) lite.document.bgColor = proto.menuLiteBgColor;
			lite.clip.width = body.clip.width +1;
			lite.clip.height = body.clip.height +1;
			menu.clip.width = body.clip.width + (proto.menuBorder * 3) ;
			menu.clip.height = body.clip.height + (proto.menuBorder * 3);
		}
	} else {
		if ((!document.all) && (container.hasChildNodes) && !window.mmIsOpera) {
			container.innerHTML=content;
		} else {
			container.document.open("text/html");
			container.document.writeln(content);
			container.document.close();	
		}
		if (!FIND("menuLayer0")) return;
		var menuCount = 0;
		for (var x=0; x<container.menus.length; x++) {
			var menuLayer = FIND("menuLayer" + x);
			container.menus[x].menuLayer = "menuLayer" + x;
			menuLayer.Menu = container.menus[x];
			menuLayer.Menu.container = "menuLayer" + x;
			menuLayer.style.zindex = 1;
		    var s = menuLayer.style;
			s.pixeltop = -300;
			s.pixelleft = -300;
			s.top = '-300px';
			s.left = '-300px';

			var menu = container.menus[x];
			menu.menuItemWidth = menu.menuWidth || menu.menuIEWidth || 140;
			if( menu.menuBgOpaque ) menuLayer.style.backgroundColor = menu.menuBorderBgColor;
			var top = 0;
			var left = 0;
			menu.menuItemLayers = new Array();
			for (var i=0; i<container.menus[x].items.length; i++) {
				var l = FIND("menuItem" + menuCount);
				l.Menu = container.menus[x];
				l.Menu.menuItemLayers[l.Menu.menuItemLayers.length] = l;
				if (l.addEventListener || window.mmIsOpera) {
					l.style.width = menu.menuItemWidth + 'px';
					l.style.height = menu.menuItemHeight + 'px';
					l.style.pixelWidth = menu.menuItemWidth;
					l.style.pixelHeight = menu.menuItemHeight;
					l.style.top = top + 'px';
					l.style.left = left + 'px';
					if(l.addEventListener) {
						l.addEventListener("mouseover", onMenuItemOver, false);
						l.addEventListener("click", onMenuItemAction, false);
						l.addEventListener("mouseout", mouseoutMenu, false);
					}
					if( menu.menuItemHAlign != 'left' ) {
						l.hiliteShim = FIND("menuItemHilite" + menuCount + "Shim");
						l.hiliteShim.style.visibility = "inherit";
						l.textShim = FIND("menuItemText" + menuCount + "Shim");
						l.hiliteShim.style.pixelWidth = menu.menuItemWidth - 2*menu.menuItemPadding - menu.menuItemIndent;
						l.hiliteShim.style.width = l.hiliteShim.style.pixelWidth;
						l.textShim.style.pixelWidth = menu.menuItemWidth - 2*menu.menuItemPadding - menu.menuItemIndent;
						l.textShim.style.width = l.textShim.style.pixelWidth;	
					}
				} else {
					l.style.pixelWidth = menu.menuItemWidth;
					l.style.pixelHeight = menu.menuItemHeight;
					l.style.pixelTop = top;
					l.style.pixelLeft = left;
					if( menu.menuItemHAlign != 'left' ) {
						var shim = FIND("menuItemShim" + menuCount);
						shim[0].style.pixelWidth = menu.menuItemWidth - 2*menu.menuItemPadding - menu.menuItemIndent;
						shim[1].style.pixelWidth = menu.menuItemWidth - 2*menu.menuItemPadding - menu.menuItemIndent;
						shim[0].style.width = shim[0].style.pixelWidth + 'px';
						shim[1].style.width = shim[1].style.pixelWidth + 'px';
					}
				}
				if( menu.vertical ) top = top + menu.menuItemHeight+menu.menuItemBorder+menu.menuItemSpacing;
				else left = left + menu.menuItemWidth+menu.menuItemBorder+menu.menuItemSpacing;
				l.style.fontSize = menu.fontSize + 'px';
				l.style.backgroundColor = menu.menuItemBgColor;
				l.style.visibility = "inherit";
				l.saveColor = menu.menuItemBgColor;
				l.menuHiliteBgColor = menu.menuHiliteBgColor;
				l.mmaction = container.menus[x].actions[i];
				l.hilite = FIND("menuItemHilite" + menuCount);
				l.focusItem = FIND("focusItem" + x);
				l.focusItem.style.pixelTop = -30;
				l.focusItem.style.top = '-30px';
				var childItem = FIND("childMenu" + menuCount);
				if (childItem) {
					l.childMenu = container.menus[x].items[i].menuLayer;
					childItem.style.pixelLeft = menu.menuItemWidth -11;
					childItem.style.left = childItem.style.pixelLeft + 'px';
					childItem.style.pixelTop = (menu.menuItemHeight /2) -4;
					childItem.style.top = childItem.style.pixelTop + 'px';
					l.Menu.childMenus[l.Menu.childMenus.length] = l.childMenu;
				}
				l.style.cursor = "hand";
				menuCount++;
			}
			if( menu.vertical ) {
				menu.menuHeight = top-1-menu.menuItemSpacing;
				menu.menuWidth = menu.menuItemWidth;
			} else {
				menu.menuHeight = menu.menuItemHeight;
				menu.menuWidth = left-1-menu.menuItemSpacing;
			}

			var lite = FIND("menuLite" + x);
			var s = lite.style;
			s.pixelHeight = menu.menuHeight +(menu.menuBorder * 2);
			s.height = s.pixelHeight + 'px';
			s.pixelWidth = menu.menuWidth + (menu.menuBorder * 2);
			s.width = s.pixelWidth + 'px';
			if( menu.menuBgOpaque ) s.backgroundColor = menu.menuLiteBgColor;

			var body = FIND("menuFg" + x);
			s = body.style;
			s.pixelHeight = menu.menuHeight + menu.menuBorder;
			s.height = s.pixelHeight + 'px';
			s.pixelWidth = menu.menuWidth + menu.menuBorder;
			s.width = s.pixelWidth + 'px';
			if( menu.menuBgOpaque ) s.backgroundColor = menu.bgColor;

			s = menuLayer.style;
			s.pixelWidth  = menu.menuWidth + (menu.menuBorder * 4);
			s.width = s.pixelWidth + 'px';
			s.pixelHeight  = menu.menuHeight+(menu.menuBorder*4);
			s.height = s.pixelHeight + 'px';
		}
	}
	if (document.captureEvents) document.captureEvents(Event.MOUSEUP);
	if (document.addEventListener) document.addEventListener("mouseup", onMenuItemOver, false);
	if (document.layers && window.innerWidth) {
		window.onresize = NS4resize;
		window.NS4sIW = window.innerWidth;
		window.NS4sIH = window.innerHeight;
		setTimeout("NS4resize()",500);
	}
	document.onmouseup = mouseupMenu;
	window.mmWroteMenu = true;
	status = "";
}

function NS4resize() {
	if (NS4sIW != window.innerWidth || NS4sIH != window.innerHeight) window.location.reload();
}

function onMenuItemOver(e, l) {
	MM_clearTimeout();
	l = l || this;
	var a = window.ActiveMenuItem;
	if (document.layers) {
		if (a) {
			a.document.bgColor = a.saveColor;
			if (a.hilite) a.hilite.visibility = "hidden";
			if (a.Menu.bgImageOver) a.background.src = a.Menu.bgImageUp;
			a.focusItem.top = -100;
			a.clicked = false;
		}
		if (l.hilite) {
			l.document.bgColor = l.menuHiliteBgColor;
			l.zIndex = 1;
			l.hilite.visibility = "inherit";
			l.hilite.zIndex = 2;
			l.document.layers[1].zIndex = 1;
			l.focusItem.zIndex = this.zIndex +2;
		}
		if (l.Menu.bgImageOver) l.background.src = l.Menu.bgImageOver;
		l.focusItem.top = this.top;
		l.focusItem.left = this.left;
		l.focusItem.clip.width = l.clip.width;
		l.focusItem.clip.height = l.clip.height;
		l.Menu.hideChildMenu(l);
	} else if (l.style && l.Menu) {
		if (a) {
			a.style.backgroundColor = a.saveColor;
			if (a.hilite) a.hilite.style.visibility = "hidden";
			if (a.hiliteShim) a.hiliteShim.style.visibility = "inherit";
			if (a.Menu.bgImageUp) a.style.background = "url(" + a.Menu.bgImageUp +")";;
		} 
		l.style.backgroundColor = l.menuHiliteBgColor;
		l.zIndex = 1;
		if (l.Menu.bgImageOver) l.style.background = "url(" + l.Menu.bgImageOver +")";
		if (l.hilite) {
			l.hilite.style.visibility = "inherit";
			if( l.hiliteShim ) l.hiliteShim.style.visibility = "visible";
		}
		l.focusItem.style.pixelTop = l.style.pixelTop;
		l.focusItem.style.top = l.focusItem.style.pixelTop + 'px';
		l.focusItem.style.pixelLeft = l.style.pixelLeft;
		l.focusItem.style.left = l.focusItem.style.pixelLeft + 'px';
		l.focusItem.style.zIndex = l.zIndex +1;
		l.Menu.hideChildMenu(l);
	} else return;
	window.ActiveMenuItem = l;
}

function onMenuItemAction(e, l) {
	l = window.ActiveMenuItem;
	if (!l) return;
	hideActiveMenus();
	if (l.mmaction) eval("" + l.mmaction);
	window.ActiveMenuItem = 0;
}

function MM_clearTimeout() {
	if (mmHideMenuTimer) clearTimeout(mmHideMenuTimer);
	mmHideMenuTimer = null;
	mmDHFlag = false;
}

function MM_startTimeout() {
	if( window.ActiveMenu ) {
		mmStart = new Date();
		mmDHFlag = true;
		mmHideMenuTimer = setTimeout("mmDoHide()", window.ActiveMenu.Menu.hideTimeout);
	}
}

function mmDoHide() {
	if (!mmDHFlag || !window.ActiveMenu) return;
	var elapsed = new Date() - mmStart;
	var timeout = window.ActiveMenu.Menu.hideTimeout;
	if (elapsed < timeout) {
		mmHideMenuTimer = setTimeout("mmDoHide()", timeout+100-elapsed);
		return;
	}
	mmDHFlag = false;
	hideActiveMenus();
	window.ActiveMenuItem = 0;
}

function MM_showMenu(menu, x, y, child, imgname) {
	if (!window.mmWroteMenu) return;
	MM_clearTimeout();
	if (menu) {
		var obj = FIND(imgname) || document.images[imgname] || document.links[imgname] || document.anchors[imgname];
		x = moveXbySlicePos (x, obj);
		y = moveYbySlicePos (y, obj);
	}
	if (document.layers) {
		if (menu) {
			var l = menu.menuLayer || menu;
			l.top = l.left = 1;
			hideActiveMenus();
			if (this.visibility) l = this;
			window.ActiveMenu = l;
		} else {
			var l = child;
		}
		if (!l) return;
		for (var i=0; i<l.layers.length; i++) { 			   
			if (!l.layers[i].isHilite) l.layers[i].visibility = "inherit";
			if (l.layers[i].document.layers.length > 0) MM_showMenu(null, "relative", "relative", l.layers[i]);
		}
		if (l.parentLayer) {
			if (x != "relative") l.parentLayer.left = x || window.pageX || 0;
			if (l.parentLayer.left + l.clip.width > window.innerWidth) l.parentLayer.left -= (l.parentLayer.left + l.clip.width - window.innerWidth);
			if (y != "relative") l.parentLayer.top = y || window.pageY || 0;
			if (l.parentLayer.isContainer) {
				l.Menu.xOffset = window.pageXOffset;
				l.Menu.yOffset = window.pageYOffset;
				l.parentLayer.clip.width = window.ActiveMenu.clip.width +2;
				l.parentLayer.clip.height = window.ActiveMenu.clip.height +2;
				if (l.parentLayer.menuContainerBgColor && l.Menu.menuBgOpaque ) l.parentLayer.document.bgColor = l.parentLayer.menuContainerBgColor;
			}
		}
		l.visibility = "inherit";
		if (l.Menu) l.Menu.container.visibility = "inherit";
	} else if (FIND("menuItem0")) {
		var l = menu.menuLayer || menu;	
		hideActiveMenus();
		if (typeof(l) == "string") l = FIND(l);
		window.ActiveMenu = l;
		var s = l.style;
		s.visibility = "inherit";
		if (x != "relative") {
			s.pixelLeft = x || (window.pageX + document.body.scrollLeft) || 0;
			s.left = s.pixelLeft + 'px';
		}
		if (y != "relative") {
			s.pixelTop = y || (window.pageY + document.body.scrollTop) || 0;
			s.top = s.pixelTop + 'px';
		}
		l.Menu.xOffset = document.body.scrollLeft;
		l.Menu.yOffset = document.body.scrollTop;
	}
	if (menu) window.activeMenus[window.activeMenus.length] = l;
	MM_clearTimeout();
}

function onMenuItemDown(e, l) {
	var a = window.ActiveMenuItem;
	if (document.layers && a) {
		a.eX = e.pageX;
		a.eY = e.pageY;
		a.clicked = true;
    }
}

function mouseupMenu(e) {
	hideMenu(true, e);
	hideActiveMenus();
	return true;
}

function getExplorerVersion() {
	var ieVers = parseFloat(navigator.appVersion);
	if( navigator.appName != 'Microsoft Internet Explorer' ) return ieVers;
	var tempVers = navigator.appVersion;
	var i = tempVers.indexOf( 'MSIE ' );
	if( i >= 0 ) {
		tempVers = tempVers.substring( i+5 );
		ieVers = parseFloat( tempVers ); 
	}
	return ieVers;
}

function mouseoutMenu() {
	if ((navigator.appName == "Microsoft Internet Explorer") && (getExplorerVersion() < 4.5))
		return true;
	hideMenu(false, false);
	return true;
}

function hideMenu(mouseup, e) {
	var a = window.ActiveMenuItem;
	if (a && document.layers) {
		a.document.bgColor = a.saveColor;
		a.focusItem.top = -30;
		if (a.hilite) a.hilite.visibility = "hidden";
		if (mouseup && a.mmaction && a.clicked && window.ActiveMenu) {
 			if (a.eX <= e.pageX+15 && a.eX >= e.pageX-15 && a.eY <= e.pageY+10 && a.eY >= e.pageY-10) {
				setTimeout('window.ActiveMenu.Menu.onMenuItemAction();', 500);
			}
		}
		a.clicked = false;
		if (a.Menu.bgImageOver) a.background.src = a.Menu.bgImageUp;
	} else if (window.ActiveMenu && FIND("menuItem0")) {
		if (a) {
			a.style.backgroundColor = a.saveColor;
			if (a.hilite) a.hilite.style.visibility = "hidden";
			if (a.hiliteShim) a.hiliteShim.style.visibility = "inherit";
			if (a.Menu.bgImageUp) a.style.background = "url(" + a.Menu.bgImageUp +")";
		}
	}
	if (!mouseup && window.ActiveMenu) {
		if (window.ActiveMenu.Menu) {
			if (window.ActiveMenu.Menu.hideOnMouseOut) MM_startTimeout();
			return(true);
		}
	}
	return(true);
}

function hideChildMenu(hcmLayer) {
	MM_clearTimeout();
	var l = hcmLayer;
	for (var i=0; i < l.Menu.childMenus.length; i++) {
		var theLayer = l.Menu.childMenus[i];
		if (document.layers) theLayer.visibility = "hidden";
		else {
			theLayer = FIND(theLayer);
			theLayer.style.visibility = "hidden";
			if( theLayer.Menu.menuItemHAlign != 'left' ) {
				for(var j = 0; j < theLayer.Menu.menuItemLayers.length; j++) {
					var itemLayer = theLayer.Menu.menuItemLayers[j];
					if(itemLayer.textShim) itemLayer.textShim.style.visibility = "inherit";
				}
			}
		}
		theLayer.Menu.hideChildMenu(theLayer);
	}
	if (l.childMenu) {
		var childMenu = l.childMenu;
		if (document.layers) {
			l.Menu.MM_showMenu(null,null,null,childMenu.layers[0]);
			childMenu.zIndex = l.parentLayer.zIndex +1;
			childMenu.top = l.Menu.menuLayer.top + l.Menu.submenuYOffset;
			if( l.Menu.vertical ) {
				if( l.Menu.submenuRelativeToItem ) childMenu.top += l.top + l.parentLayer.top;
				childMenu.left = l.parentLayer.left + l.parentLayer.clip.width - (2*l.Menu.menuBorder) + l.Menu.menuLayer.left + l.Menu.submenuXOffset;
			} else {
				childMenu.top += l.top + l.parentLayer.top;	
				if( l.Menu.submenuRelativeToItem ) childMenu.left = l.Menu.menuLayer.left + l.left + l.clip.width + (2*l.Menu.menuBorder) + l.Menu.submenuXOffset;
				else childMenu.left = l.parentLayer.left + l.parentLayer.clip.width - (2*l.Menu.menuBorder) + l.Menu.menuLayer.left + l.Menu.submenuXOffset;
			}
			if( childMenu.left < l.Menu.container.clip.left ) l.Menu.container.clip.left = childMenu.left;
			var w = childMenu.clip.width+childMenu.left-l.Menu.container.clip.left;
			if (w > l.Menu.container.clip.width)  l.Menu.container.clip.width = w;
			var h = childMenu.clip.height+childMenu.top-l.Menu.container.clip.top;
			if (h > l.Menu.container.clip.height) l.Menu.container.clip.height = h;
			l.document.layers[1].zIndex = 0;
			childMenu.visibility = "inherit";
		} else if (FIND("menuItem0")) {
			childMenu = FIND(l.childMenu);
			var menuLayer = FIND(l.Menu.menuLayer);
			var s = childMenu.style;
			s.zIndex = menuLayer.style.zIndex+1;
			if (document.all || window.mmIsOpera) {
				s.pixelTop = menuLayer.style.pixelTop + l.Menu.submenuYOffset;
				if( l.Menu.vertical ) {
					if( l.Menu.submenuRelativeToItem ) s.pixelTop += l.style.pixelTop;
					s.pixelLeft = l.style.pixelWidth + menuLayer.style.pixelLeft + l.Menu.submenuXOffset;
					s.left = s.pixelLeft + 'px';
				} else {
					s.pixelTop += l.style.pixelTop;
					if( l.Menu.submenuRelativeToItem ) s.pixelLeft = menuLayer.style.pixelLeft + l.style.pixelLeft + l.style.pixelWidth + (2*l.Menu.menuBorder) + l.Menu.submenuXOffset;
					else s.pixelLeft = (menuLayer.style.pixelWidth-4*l.Menu.menuBorder) + menuLayer.style.pixelLeft + l.Menu.submenuXOffset;
					s.left = s.pixelLeft + 'px';
				}
			} else {
				var top = parseInt(menuLayer.style.top) + l.Menu.submenuYOffset;
				var left = 0;
				if( l.Menu.vertical ) {
					if( l.Menu.submenuRelativeToItem ) top += parseInt(l.style.top);
					left = (parseInt(menuLayer.style.width)-4*l.Menu.menuBorder) + parseInt(menuLayer.style.left) + l.Menu.submenuXOffset;
				} else {
					top += parseInt(l.style.top);
					if( l.Menu.submenuRelativeToItem ) left = parseInt(menuLayer.style.left) + parseInt(l.style.left) + parseInt(l.style.width) + (2*l.Menu.menuBorder) + l.Menu.submenuXOffset;
					else left = (parseInt(menuLayer.style.width)-4*l.Menu.menuBorder) + parseInt(menuLayer.style.left) + l.Menu.submenuXOffset;
				}
				s.top = top + 'px';
				s.left = left + 'px';
			}
			childMenu.style.visibility = "inherit";
		} else return;
		window.activeMenus[window.activeMenus.length] = childMenu;
	}
}

function hideActiveMenus() {
	if (!window.activeMenus) return;
	for (var i=0; i < window.activeMenus.length; i++) {
		if (!activeMenus[i]) continue;
		if (activeMenus[i].visibility && activeMenus[i].Menu && !window.mmIsOpera) {
			activeMenus[i].visibility = "hidden";
			activeMenus[i].Menu.container.visibility = "hidden";
			activeMenus[i].Menu.container.clip.left = 0;
		} else if (activeMenus[i].style) {
			var s = activeMenus[i].style;
			s.visibility = "hidden";
			s.left = '-200px';
			s.top = '-200px';
		}
	}
	if (window.ActiveMenuItem) hideMenu(false, false);
	window.activeMenus.length = 0;
}

function moveXbySlicePos (x, img) {
	if (!document.layers) {
		var onWindows = navigator.platform ? navigator.platform == "Win32" : false;
		var macIE45 = document.all && !onWindows && getExplorerVersion() == 4.5;
		var par = img;
		var lastOffset = 0;
		while(par){
			if( par.leftMargin && ! onWindows ) x += parseInt(par.leftMargin);
			if( (par.offsetLeft != lastOffset) && par.offsetLeft ) x += parseInt(par.offsetLeft);
			if( par.offsetLeft != 0 ) lastOffset = par.offsetLeft;
			par = macIE45 ? par.parentElement : par.offsetParent;
		}
	} else if (img.x) x += img.x;
	return x;
}

function moveYbySlicePos (y, img) {
	if(!document.layers) {
		var onWindows = navigator.platform ? navigator.platform == "Win32" : false;
		var macIE45 = document.all && !onWindows && getExplorerVersion() == 4.5;
		var par = img;
		var lastOffset = 0;
		while(par){
			if( par.topMargin && !onWindows ) y += parseInt(par.topMargin);
			if( (par.offsetTop != lastOffset) && par.offsetTop ) y += parseInt(par.offsetTop);
			if( par.offsetTop != 0 ) lastOffset = par.offsetTop;
			par = macIE45 ? par.parentElement : par.offsetParent;
		}		
	} else if (img.y >= 0) y += img.y;
	return y;
}

function m_search(code,number) {
	if (document.getElementById('Stop').value!="11") {
		document.getElementById('Stop').value="11";
		if (document.getElementById('QtyCheck').value=="1"&&document.getElementById('CartBag').value=="1") {
			if (confirm("Do you want to update your cart before proceeding?")) {
				window.alert("Click the Add to Cart button");
			}
			else {
				document.getElementById('floatbusydiv').style.display="block";
				document.getElementById('OmnisClass').value="RTSEARCH";
				document.getElementById('Code').value=code;
				document.getElementById('Group').value=number;
				document.getElementById('QtyCheck').value="0";
				document.forms["vsform"].submit();
			}
		}
		else if (document.getElementById('QtyCheck').value=="1") {
			if (confirm("Do you want to update your bag before proceeding?")) {
				window.alert("Click the Add to Bag button");
			}
			else {
				document.getElementById('floatbusydiv').style.display="block";
				document.getElementById('OmnisClass').value="RTSEARCH";
				document.getElementById('Code').value=code;
				document.getElementById('Group').value=number;
				document.getElementById('QtyCheck').value="0";
				document.forms["vsform"].submit();
			}
		}
		else {
			if (code=="0"&&number=="0"&&document.getElementById('SearchField').value=="Search for a product, code or keyword") {
				window.alert("Search value is missing.");
				document.getElementById('SearchField').focus();
			}
			else {
				document.getElementById('floatbusydiv').style.display="block";
				document.getElementById('OmnisClass').value="RTSEARCH";
				document.getElementById('Code').value=code;
				document.getElementById('Group').value=number;
				document.getElementById('QtyCheck').value="0";
				document.forms["vsform"].submit();
			}
		}
	}
	else {
		document.getElementById('Stop').value="0";
	}
}

function aboutus() {
	document.getElementById('OmnisClass').value="RTABOUTUS";
	document.forms["vsform"].submit();
}

function busy() {
	document.getElementById('floatbusydiv').style.display="none";
}

function account() {
	document.getElementById('OmnisClass').value="RTACCOUNT";
	document.forms["vsform"].submit();
}

function addtocart() {
	var product = document.getElementById('Product').value
	var delimiter = document.getElementById('Product').value.indexOf("/");
	if (delimiter!=-1) {
		product = product.slice(0,delimiter);
	}
	if (document.getElementById("Z_"+product).value==0) {
		window.alert("Quantity missing.");
	}
	else {
		document.getElementById('OmnisClass').value="RTADDTOCART";
		document.forms["vsform"].submit();
	}
}

function allgroups() {
	document.getElementById('OmnisClass').value="RTALLGROUPS";
	document.forms["vsform"].submit();
}

function cart() {
	if (document.getElementById('QtyCheck').value=="1"&&document.getElementById('Cart').value=="1") {
		if (confirm("Do you want to update your cart before proceeding?")) {
			window.alert("Click the Add to Cart link.");
		}
		else {
			document.getElementById('OmnisClass').value="RTCART";
			document.getElementById('QtyCheck').value="0";
			document.forms["vsform"].submit();
		}
	}
	else if (document.getElementById('QtyCheck').value=="1") {
		if (confirm("Do you want to update your bag before proceeding?")) {
			window.alert("Click the Add to Bag link.");
		}
		else {
			document.getElementById('OmnisClass').value="RTCART";
			document.getElementById('QtyCheck').value="0";
			document.forms["vsform"].submit();
		}
	}
	else {
		document.getElementById('OmnisClass').value="RTCART";
		document.forms["vsform"].submit();
	}
}

function checkdate(code) {
	if (document.getElementById('shipdate').value&&Date.parse(document.getElementById('shipdate').value)<Date.parse(document.getElementById('today').value)+(2*86400000)) {
		window.alert("Ship Before date cannot be less than 2 days after ordered date!");
		document.getElementById('shipdate').value="";
		document.getElementById('shipdate').focus();
	}
	else if (document.getElementById('canceldate').value&&Date.parse(document.getElementById('canceldate').value)<Date.parse(document.getElementById('shipdate').value)+(86400000)) {
		window.alert("Cancel After date cannot be less than a day after Ship Before date!");
		document.getElementById('canceldate').value="";
		document.getElementById('canceldate').focus();
	}
	else if (document.getElementById('canceldate').value&&Date.parse(document.getElementById('canceldate').value)<Date.parse(document.getElementById('today').value)+(7*86400000)) {
		window.alert("Cancel After date cannot be less than 7 days after ordered date!");
		document.getElementById('canceldate').value="";
		document.getElementById('canceldate').focus();
	}
}

function checkout() {
	if (document.getElementById('Stop').value!="21") {
		document.getElementById('Stop').value="21";
		document.getElementById('OmnisClass').value="RTCHECKOUT";
		document.forms["vsform"].submit();
	}
	else if (document.getElementById('Stop').value=="21") {
		document.getElementById('Stop').value="22";
		return false;
	}
	else {
		document.getElementById('Stop').value="0";
	}
}

function contact() {
	document.getElementById('OmnisClass').value="RTCONTACT";
	document.forms["vsform"].submit();
}

function continue_checkout() {
	document.getElementById('OmnisClass').value="RTHOME";
	document.forms["vsform"].submit();
}

function coupon() {
	if (document.getElementById('coupon').value=="") {
		return;
	}
	var code = document.getElementById('coupon').value;
	var i = 1;
	var coupon_ok = 0;
	var promo = 0;
	var lines = document.getElementById('NbPc').value;
	for (i=1;i<=lines;i++) {
		var part1 = code.slice(0,3);
		var part2 = code.slice(3,6);
		var part3 = code.slice(6,9);
		var part4 = code.slice(9);
		part1 = part1.toUpperCase();
		part2 = part2.toUpperCase();
		part3 = part3.toUpperCase();
		if (document.getElementById('PcC_'+i).value==part4+"|"+part2+"|"+part3+"|"+part1) {
			coupon_ok = 1;
			promo = i;
		}
	}
	if (coupon_ok==0) {
		window.alert(code+" coupon not found");
		document.getElementById('coupondesc').value = code+" coupon not found";
		document.getElementById('coupon').value = "";
		document.getElementById('coupon').focus();
	}
	else {
		if (parseFloat(document.getElementById('SubTotal').value)>=parseFloat(document.getElementById('PcM_'+promo).value)) {
			if (document.getElementById('PcD_'+promo).value=="") {
				if (document.getElementById('PcV_'+promo).value>0) {
					if (document.getElementById('PcT_'+promo).value=="0") {
						document.getElementById('coupondesc').value = "$" + document.getElementById('PcV_'+promo).value + " off";
					}
					else if (document.getElementById('PcT_'+promo).value=="1") {
						document.getElementById('coupondesc').value = document.getElementById('PcV_'+promo).value + "% off";
					}
					if (document.getElementById('PcF_'+promo).value=="YES") {
					document.getElementById('coupondesc').value = document.getElementById('coupondesc').value + " and Free Shipping";
					}
				}
				else if (document.getElementById('PcF_'+promo).value=="YES") {
					document.getElementById('coupondesc').value = "Free Shipping";
				}
			}
			else {
				document.getElementById('coupondesc').value = document.getElementById('PcD_'+promo).value;
			}
		}
		else {
			window.alert("Minimum Purchase of $"+ document.getElementById('PcM_'+promo).value +" is required for coupon "+code);
			document.getElementById('coupondesc').value = "Minimum Purchase of $"+ document.getElementById('PcM_'+promo).value +" is required for coupon "+code;
			document.getElementById('coupon').value = "";
			coupon_ok=0;
			document.getElementById('coupon').focus();
		}
	}
}

function custsearch() {
	if (document.getElementById('option0').checked) {
		document.getElementById('cust1').style.display="none";
		document.getElementById('cust0').style.display="block";
	}
	else if (document.getElementById('option1').checked) {
		document.getElementById('cust0').style.display="none";
		document.getElementById('cust1').style.display="block";
	}
	else if (document.getElementById('option2').checked) {
		document.getElementById('cust1').style.display="none";
		document.getElementById('cust0').style.display="block";
	}
}

function custsearch_continue() {
	if (document.getElementById('Stop').value!="31") {
		document.getElementById('Stop').value="31";
		if (document.getElementById('option0').checked) {
		document.getElementById('Group').value="0";
		}
		else if (document.getElementById('option1').checked) {
		document.getElementById('Group').value="1";
		}
		else if (document.getElementById('option2').checked) {
		document.getElementById('Group').value="2";
		}
		if (((document.getElementById('Group').value=="0"||document.getElementById('Group').value=="2")&&document.getElementById('textfield').value!=""&&document.getElementById('textfield').value!=null)||(document.getElementById('Group').value=="1"&&document.getElementById('listfield').value!=""&&document.getElementById('listfield').value!=null)) {
			document.getElementById('Code').value=document.getElementById('textfield').value;
			document.getElementById('OldCode').value=document.getElementById('listfield').value;
			document.getElementById('OmnisClass').value="RTCUSTACCT";
			document.forms["vsform"].submit();
		}
	}
	else {
		document.getElementById('Stop').value="0";
	}
}

function custsearch_return() {
	document.getElementById('OmnisClass').value="RTCUSTSEARCH";
	document.forms["vsform"].submit();
}

function custsearch_account() {
	document.getElementById('OmnisClass').value="RTCUSTSEARCH";
	document.forms["vsform"].submit();
}

function deleteitem(code) {
	if (confirm("Remove item from bag?")) {
		document.getElementById("Product").value=code.id;
		document.getElementById('OmnisClass').value="RTCARTDELETE";
		document.forms["vsform"].submit();
	}
}

function duplicate(number) {
	if (confirm("Duplicate Order "+number+"?")) {
		document.getElementById('OmnisClass').value="RTDUPLICATE";
		document.forms["vsform"].submit();
	}
}

function empty() {
	if (document.getElementById('CartBag').value=="1") {
		if (confirm("Empty Bag, are you sure ?")) {
			document.getElementById('OmnisClass').value="RTEMPTYCART";
			document.forms["vsform"].submit();
		}
	}
	else if (document.getElementById('CartBag').value=="0") {
		if (confirm("Empty Cart, are you sure ?")) {
			document.getElementById('OmnisClass').value="RTEMPTYCART";
			document.forms["vsform"].submit();
		}
	}
}

function feedback() {
	document.getElementById('OmnisClass').value="RTFEEDBACK";
	document.forms["vsform"].submit();
}

function feedbacksend() {
	if (document.getElementById('feedback').value=='') {
		window.alert("Feedback text is missing");
		document.getElementById('feedback').focus();
	}
	else {
		document.getElementById('OmnisClass').value="RTFEEDBACKSEND";
		document.forms["vsform"].submit();
	}
}

function group(elem) {
	document.getElementById('OmnisClass').value="RTGROUP";
	document.getElementById('Group').value=elem.name;
}

function homepage() {
	if (document.getElementById('QtyCheck').value=="1"&&document.getElementById('CartBag').value=="1") {
		if (confirm("Do you want to update your cart before proceeding?")) {
			window.alert("Click the Add to Cart button");
		}
		else {
			document.getElementById('QtyCheck').value="0";
			document.getElementById('OmnisClass').value="RTHOME";
			document.forms["vsform"].submit();
		}
	}
	else if (document.getElementById('QtyCheck').value=="1") {
		if (confirm("Do you want to update your bag before proceeding?")) {
			window.alert("Click the Add to Bag button");
		}
		else {
			document.getElementById('QtyCheck').value="0";
			document.getElementById('OmnisClass').value="RTHOME";
			document.forms["vsform"].submit();
		}
	}
	else {
		if (document.getElementById('UserName').value==document.getElementById('Rep').value) {
			document.getElementById('OmnisClass').value="RTREPACCT";
		}
		else {
			document.getElementById('OmnisClass').value="RTHOME";
		}
		document.forms["vsform"].submit();
	}
}

function invnb(elem) {
	document.getElementById('OmnisClass').value="RTINVNB";
	document.getElementById('Group').value=elem;
	document.forms["vsform"].submit();
}

function menu(elem) {
	document.getElementById('floatbusydiv').style.display="block";
	document.getElementById('OmnisClass').value="RTGROUP";
	document.getElementById('Group').value=elem;
	document.forms["vsform"].submit();
}

function newsletter() {
	document.getElementById('OmnisClass').value="RTNEWS";
	document.forms["vsform"].submit();
}

function noprice() {
	if (document.getElementById('NoPrice').value=="0") {
		document.getElementById('NoPrice').value="1";
		document.getElementById('noprice_hide').style.display="none";
		document.getElementById('noprice_show').style.display="block";
	}
	else {
		document.getElementById('NoPrice').value="0";
		document.getElementById('noprice_hide').style.display="block";
		document.getElementById('noprice_show').style.display="none";
	}
	document.getElementById('OmnisClass').value="RTHOMEFFI";
	document.forms["vsform"].submit();
}

function ordernb(elem) {
	document.getElementById('OmnisClass').value="RTORDERNB";
	document.getElementById('Group').value=elem;
	document.forms["vsform"].submit();
}

function pass() {
	document.getElementById('OmnisClass').value="RTPASS";
	document.forms["vsform"].submit();
}

function passsave() {
	if (document.getElementById('Password3').value==document.getElementById('Password2').value) {
		document.getElementById('OmnisClass').value="RTPASS2";
		document.forms["vsform"].submit();
	}
	else {
		window.alert("The New Password fields do not match!");
		document.getElementById('Password2').focus();
	}
}

function placeorder() {
	if (document.getElementById('Stop').value!="41") {
		document.getElementById('Stop').value="41";
		if (document.getElementById('email').value==''&&document.getElementById('email2').value==''&&document.getElementById('Rep').value!='') {
			window.alert("Enter your e-mail address");
			document.getElementById('Stop').value="0";
			document.getElementById('email2').focus();
		}
		else if (document.getElementById('shipvia').value==0) {
			window.alert("Enter the Shipping method");
			document.getElementById('Stop').value="0";
			document.getElementById('shipvia').focus();
		}
		else if (document.getElementById('po').value=='') {
			window.alert("Enter your Purchase Order number");
			document.getElementById('Stop').value="0";
			document.getElementById('po').focus();
		}
		else {
			if (document.getElementById('coupon').value!="") {
				var code = document.getElementById('coupon').value;
				var i = 1;
				var coupon_ok = 0;
				var promo = 0;
				var lines = document.getElementById('NbPc').value;
				for (i=1;i<=lines;i++) {
					var part1 = code.slice(0,3);
					var part2 = code.slice(3,6);
					var part3 = code.slice(6,9);
					var part4 = code.slice(9);
					part1 = part1.toUpperCase();
					part2 = part2.toUpperCase();
					part3 = part3.toUpperCase();
					if (document.getElementById('PcC_'+i).value==part4+"|"+part2+"|"+part3+"|"+part1) {
						coupon_ok = 1;
						promo = i;
					}
				}
				if (coupon_ok==0) {
					window.alert(code+" coupon not found");
					document.getElementById('coupondesc').value = code+" coupon not found";
					document.getElementById('coupon').value = "";
					document.getElementById('Stop').value="0";
					document.getElementById('coupon').focus();
				}
				else {
					if (parseFloat(document.getElementById('SubTotal').value)>=parseFloat(document.getElementById('PcM_'+promo).value)) {
						if (document.getElementById('PcV_'+promo).value>0) {
							if (document.getElementById('PcT_'+promo).value=="0") {
								document.getElementById('coupondesc').value = "$" + document.getElementById('PcV_'+promo).value + " off";
							}
							else if (document.getElementById('PcT_'+promo).value=="1") {
								document.getElementById('coupondesc').value = document.getElementById('PcV_'+promo).value + "% off";
							}
							if (document.getElementById('PcF_'+promo).value=="YES") {
								document.getElementById('coupondesc').value = document.getElementById('coupondesc').value + " and Free Shipping";
							}
						}
						else if (document.getElementById('PcF_'+promo).value=="YES") {
							document.getElementById('coupondesc').value = "Free Shipping";
						}
					}
					else {
						window.alert("Minimum Purchase of $"+ document.getElementById('PcM_'+promo).value +" is required for coupon "+code);
						document.getElementById('coupondesc').value = "Minimum Purchase of $"+ document.getElementById('PcM_'+promo).value +" is required for coupon "+code;
						document.getElementById('coupon').value = "";
						coupon_ok=0;
						document.getElementById('Stop').value="0";
						document.getElementById('coupon').focus();
					}
				}
			}
			else {
				coupon_ok = 1;
			}
			if (coupon_ok==1) {
				document.getElementById('OmnisClass').value="RTORDER";
				document.forms["vsform"].submit();
			}
		}
	}
	else {
		return false;
	}
}

function pricelist() {
	document.getElementById('OmnisClass').value="RTPRICELIST";
	document.forms["vsform"].submit();
}

function prid(elem) {
	document.getElementById('OmnisClass').value="RTPRODUCT";
	document.getElementById('Product').value=elem;
	document.forms["vsform"].submit();
}

function printorder() {
	document.getElementById('OmnisClass').value="RTORDERPRINT";
	document.forms["vsform"].submit();
}

function product(elem) {
	document.getElementById('OmnisClass').value="RTPRODUCT";
	document.getElementById('Product').value=elem.name;
	document.forms["vsform"].submit();
}

function product2(elem) {
	if (document.getElementById('QtyCheck').value=="1"&&document.getElementById('Cart').value=="1") {
		if (confirm("Do you want to update your cart before proceeding?")) {
			window.alert("Click the Add to Cart link.");
		}
		else {
			document.getElementById('OmnisClass').value="RTPRODUCT";
			document.getElementById('Product').value=elem;
			document.getElementById('QtyCheck').value="0";
			document.forms["vsform"].submit();
		}
	}
	else if (document.getElementById('QtyCheck').value=="1") {
		if (confirm("Do you want to update your bag before proceeding?")) {
			window.alert("Click the Add to Bag link.");
		}
		else {
			document.getElementById('OmnisClass').value="RTPRODUCT";
			document.getElementById('Product').value=elem;
			document.getElementById('QtyCheck').value="0";
			document.forms["vsform"].submit();
		}
	}
	else {
		document.getElementById('OmnisClass').value="RTPRODUCT";
		document.getElementById('Product').value=elem;
		document.forms["vsform"].submit();
	}
}

function productbuy(elem) {
	if (document.getElementById('Stop').value=="0") {
		document.getElementById('Stop').value="1";
		document.getElementById('floatbusydiv').style.display="block";
		document.getElementById('OmnisClass').value="RTPRODUCTBUY";
		document.getElementById('Product').value=elem.name;
		document.forms["vsform"].submit();
	}
	else if (document.getElementById('Stop').value=="1") {
		document.getElementById('Stop').value="2";
		return false;
	}
	else {
		document.getElementById('Stop').value="0";
	}
}

function productsize(elem) {
	var product = elem.value;
	var price = "";
	var msrp = "";
	var delimiter = product.indexOf("@");
	var delimiter2 = product.indexOf("#");
	if (delimiter2) {
		price = product.slice(delimiter+1,delimiter2);
		msrp = product.slice(delimiter2+1);
	}
	else {
		price = product.slice(delimiter+1);
	}
	product = product.slice(0,delimiter);
	delimiter = product.indexOf("/");
	if (delimiter!=-1) {
		var product2 = product.slice(0,delimiter);
		document.getElementById("Z_"+product2).name = "Z_"+product;
		document.getElementById("P_"+product2).value= "$ "+price;
		document.getElementById("MSRP_"+product2).value="$ "+msrp;
		if (msrp=="") {
			document.getElementById("MSRPDIV"+product2).style.display="none";
			document.getElementById("PDIV"+product2).style.color="#333";
		}
		else {
			document.getElementById("MSRPDIV"+product2).style.display="block";
			document.getElementById("PDIV"+product2).style.color="#F00";
		}
	}
	else {
		document.getElementById("Z_"+product).name = "Z_"+product;
		document.getElementById("P_"+product).value= "$ "+price;
		document.getElementById("MSRP_"+product).value= "$ "+msrp;
		if (msrp=="") {
			document.getElementById("MSRPDIV"+product).style.display="none";
			document.getElementById("PDIV"+product).style.color="#333";
		}
		else {
			document.getElementById("MSRPDIV"+product).style.display="block";
			document.getElementById("PDIV"+product).style.color="#F00";
		}
	}
}

function productsize_old(elem) {
	document.getElementById("Add_"+elem.name).name="Add_"+elem.value;
}

function product_toshop() {
	document.getElementById('OmnisClass').value="RTPRODUCTRET";
	document.forms["vsform"].submit();
}

function profile() {
	document.getElementById('OmnisClass').value="RTPROFILEPASS";
	document.forms["vsform"].submit();
}

function profilepass() {
	document.getElementById('OmnisClass').value="RTPROFILE";
	document.forms["vsform"].submit();
}

function profilesave() {
	if (document.getElementById('userid').value=='') {
		window.alert("Enter your username");
		document.getElementById('userid').focus();
	}
	else if (document.getElementById('email').value=='') {
		window.alert("Enter your e-mail address");
		document.getElementById('email').focus();
	}
	else if (document.getElementById('email2').value!=document.getElementById('email').value) {
		window.alert("The two e-mail addresses do not match");
		document.getElementById('email').focus();
	}
	else {
		if (document.getElementById('news').checked) {
			document.getElementById('news').value="1";
		}
		else {
			document.getElementById('news').value="0";
		}
		document.getElementById('first').disabled=false;
		document.getElementById('last').disabled=false;
		document.getElementById('address').disabled=false;
		document.getElementById('address2').disabled=false;
		document.getElementById('city').disabled=false;
		document.getElementById('state').disabled=false;
		document.getElementById('zip').disabled=false;
		document.getElementById('country').disabled=false;
		document.getElementById('phone').disabled=false;
		document.getElementById('mobile').disabled=false;
		document.getElementById('fax').disabled=false;
		document.getElementById('OmnisClass').value="RTPROFILESAVE";
		document.forms["vsform"].submit();
	}
}

function qtycheck(id) {
	if (document.getElementById(id).value>=0) {
		if (document.getElementById('QtyCheck').value=="0") {
			document.getElementById('QtyCheck').value = "1";
		}
		var product = document.getElementById(id).name;
		product = product.slice(2);
		var delimiter = product.indexOf("/");
		if (delimiter!=-1) {
			product = product.slice(0,delimiter);
			var Selected = document.getElementById("S_"+product).selectedIndex;
			var SelectedOption = document.getElementById("S_"+product).options[Selected].value;
			delimiter = SelectedOption.indexOf("@");
			product = SelectedOption.slice(0,delimiter);
			delimiter = SelectedOption.indexOf("/");
			var product2 = SelectedOption.slice(0,delimiter);
			document.getElementById("Z_"+product2).name = "Z_"+product;
			document.getElementById("Z_"+product2).value = document.getElementById(id).value;
		}
		else {
			document.getElementById("Z_"+product).value = document.getElementById(id).value;
		}
	}
}

function qtycheck2(id) {
	if (document.getElementById(id).value!=document.getElementById(id).alt) {
		if (document.getElementById('QtyCheck').value=="0") {
			document.getElementById('QtyCheck').value = "1";
		}
	}
}

function quickorder() {
	document.getElementById('OmnisClass').value="RTQUICKORDER";
	document.forms["vsform"].submit();
}

function quickorderqty(code) {
	if (document.getElementById(code).value!="") {
		var code2 = code.slice(4);
		if (document.getElementById('qty'+code2).value==""||document.getElementById('qty'+code2).value=="0") {
			document.getElementById('qty'+code2).value="1";
		}
	}
}

function quickordersave() {
	if (document.getElementById('Stop').value!="51") {
		document.getElementById('Stop').value="51";
		document.getElementById('floatbusydiv').style.display="block";
		document.getElementById('OmnisClass').value="RTQUICKTOCART";
		document.forms["vsform"].submit();
	}
	else if (document.getElementById('Stop').value=="1") {
		document.getElementById('Stop').value="2";
		return false;
	}
	else {
		document.getElementById('Stop').value="0";
	}
}

function rep_account() {
	document.getElementById('OmnisClass').value="RTLOGINREP";
	document.forms["vsform"].submit();
}

function rep_editaccount() {
	document.getElementById('OmnisClass').value="RTREPEDITACCT";
	document.forms["vsform"].submit();
}

function rep_editaccountsave() {
	if (document.getElementById('userid').value=='') {
		window.alert("Enter your username");
		document.getElementById('userid').focus();
	}
	else if (document.getElementById('userpass').value=='') {
		window.alert("Enter your password");
		document.getElementById('userpass').focus();
	}
	else if (document.getElementById('userpass2').value!=document.getElementById('userpass').value) {
		window.alert("The two passwords do not match");
		document.getElementById('userpass').focus();
	}
	else if (document.getElementById('email').value==''&&document.getElementById('Rep').value!='') {
		window.alert("Enter your e-mail address");
		document.getElementById('email').focus();
	}
	else if (document.getElementById('email2').value!=document.getElementById('email').value) {
		window.alert("The two e-mail addresses do not match");
		document.getElementById('email').focus();
	}
	else if (document.getElementById('company').value=='') {
		window.alert("Enter your business name");
		document.getElementById('company').focus();
	}
	else if (document.getElementById('first').value==''||document.getElementById('last').value=='') {
		window.alert("Enter your first and last names");
		document.getElementById('first').focus();
	}
	else if (document.getElementById('address').value==''||document.getElementById('city').value==''||document.getElementById('state').value==''||document.getElementById('zip').value=='') {
		window.alert("Enter your full address");
		document.getElementById('address').focus();
	}
	else if (document.getElementById('phone').value=='') {
		window.alert("Enter your phone number");
		document.getElementById('phone').focus();
	}
	else if (document.getElementById('news').checked&&document.getElementById('newsemail').value=='') {
		window.alert("Enter your newsletter email address");
		document.getElementById('newsemail').focus();
	}
	else {
		if (document.getElementById('news').checked) {
			document.getElementById('news').value="1";
		}
		else {
			document.getElementById('news').value="0";
		}
		document.getElementById('OmnisClass').value="RTREPEDITACCTSAVE";
		document.forms["vsform"].submit();
	}
}

function rep_newaccount() {
	document.getElementById('OmnisClass').value="RTREPNEWACCT";
	document.forms["vsform"].submit();
}

function rep_newaccountsave() {
	if (document.getElementById('userid').value=='') {
		window.alert("Enter your username");
		document.getElementById('userid').focus();
	}
	else if (document.getElementById('userpass').value=='') {
		window.alert("Enter your password");
		document.getElementById('userpass').focus();
	}
	else if (document.getElementById('userpass2').value!=document.getElementById('userpass').value) {
		window.alert("The two passwords do not match");
		document.getElementById('userpass').focus();
	}
	else if (document.getElementById('email').value==''&&document.getElementById('Rep').value!='') {
		window.alert("Enter your e-mail address");
		document.getElementById('email').focus();
	}
	else if (document.getElementById('email2').value!=document.getElementById('email').value) {
		window.alert("The two e-mail addresses do not match");
		document.getElementById('email').focus();
	}
	else if (document.getElementById('company').value=='') {
		window.alert("Enter your business name");
		document.getElementById('company').focus();
	}
	else if (document.getElementById('first').value==''||document.getElementById('last').value=='') {
		window.alert("Enter your first and last names");
		document.getElementById('first').focus();
	}
	else if (document.getElementById('address').value==''||document.getElementById('city').value==''||document.getElementById('state').value==''||document.getElementById('zip').value=='') {
		window.alert("Enter your full address");
		document.getElementById('address').focus();
	}
	else if (document.getElementById('phone').value=='') {
		window.alert("Enter your phone number");
		document.getElementById('phone').focus();
	}
	else if (document.getElementById('news').checked&&document.getElementById('newsemail').value=='') {
		window.alert("Enter your newsletter email address");
		document.getElementById('newsemail').focus();
	}
	else {
		if (document.getElementById('news').checked) {
			document.getElementById('news').value="1";
		}
		else {
			document.getElementById('news').value="0";
		}
		document.getElementById('OmnisClass').value="RTREPNEWACCTSAVE";
		document.forms["vsform"].submit();
	}
}

function rep_return() {
	if (document.getElementById('Mstr').value=="2") {
		document.getElementById('OmnisClass').value="RTCUSTSEARCH";
	}
	else if (document.getElementById('Mstr').value=="1") {
		document.getElementById('OmnisClass').value="RTCUSTACCT";
	}
	else {
		document.getElementById('OmnisClass').value="RTREPACCT";
	}
	document.forms["vsform"].submit();
}

function repacct(elem) {
	document.getElementById('Group').value=elem.value;
	var lead=elem.value;
	if (lead.slice(0,1)=='@') {
		document.getElementById('updatelead').style.display="block";
		document.getElementById('updatelead2').style.display="block";
	}
	else {
		document.getElementById('updatelead').style.display="none";
		document.getElementById('updatelead2').style.display="none";
	}
}

function resetqty(elem) {
	document.getElementById('OmnisClass').value="RTGROUP";
	document.forms["vsform"].submit();
}

function shipto(elem) {
	document.getElementById('ShipAddress').value=elem.value;
}

function stores(elem) {
	document.getElementById('OmnisClass').value="RTSTORES";
	document.forms["vsform"].submit();
}

function terms() {
	document.getElementById('OmnisClass').value="RTTERMS";
	document.forms["vsform"].submit();
}

function update() {
	if (document.getElementById('Stop').value=="0") {
		document.getElementById('Stop').value="1";
		document.getElementById('OmnisClass').value="RTCARTUPDATE";
		document.forms["vsform"].submit();
	}
	else if (document.getElementById('Stop').value=="1") {
		document.getElementById('Stop').value="2";
		return false;
	}
	else {
		document.getElementById('Stop').value="0";
	}
}

function update2() {
	if (document.getElementById('Stop').value!="61") {
		document.getElementById('Stop').value="61";
		document.getElementById('OmnisClass').value="RTCARTUPDATE2";
		document.forms["vsform"].submit();
	}
	else if (document.getElementById('Stop').value=="61") {
		document.getElementById('Stop').value="62";
		return false;
	}
	else {
		document.getElementById('Stop').value="0";
	}
}

function validate_field(field,alerttxt)
{
var currentField='';
var currentAlert='';
var currentPass='';
var currentEmail='';
var complete=true;
var target='';
var temp1='';
var temp2='';
if (currentField!=''&&currentField!=field)
	{
	if (currentField.value==null||currentField.value=='')
		{
		target=currentField;
		window.alert(currentAlert);
		currentField='';
		currentAlert='';
		target.focus();
		}
	else if (currentField.name=='email')
		{
		apos=currentField.value.indexOf("@");
		dotpos=currentField.value.lastIndexOf(".");
		if (apos<1||dotpos-apos<2)
			{
			target=currentField;
			window.alert("Invalid e-mail address!");
			currentField='';
			currentAlert='';
			target.focus();
			}
		else
			{
			currentEmail=currentField.value;
			if (alerttxt!='')
				{
				currentField=field;
				currentAlert=alerttxt;
				}
			}
		}
	else if (alerttxt!='')
		{
		currentField=field;
		currentAlert=alerttxt;
		}
	}
else if (alerttxt!='')
	{
	currentField=field;
	currentAlert=alerttxt;
	}
}

function checkEnter(e){
	var characterCode;
	if(e && e.which){
		e = e;
		characterCode = e.which;
	}
	else{
		e = event;
	characterCode = e.keyCode;
	}
	if(characterCode == 13){
		document.forms[0].submit();
		return false;
	}
	else{
		return true ;
	}
}

function SDMenu(id) {
	if (!document.getElementById || !document.getElementsByTagName)
		return false;
	this.menu = document.getElementById(id);
	this.submenus = this.menu.getElementsByTagName("div");
	this.remember = true;
	this.speed = 3;
	this.markCurrent = true;
	this.oneSmOnly = false;
}
SDMenu.prototype.init = function() {
	var mainInstance = this;
	for (var i = 0; i < this.submenus.length; i++)
		this.submenus[i].getElementsByTagName("span")[0].onclick = function() {
			mainInstance.toggleMenu(this.parentNode);
		};
	if (this.markCurrent) {
		var links = this.menu.getElementsByTagName("a");
		for (var i = 0; i < links.length; i++)
			if (links[i].href == document.location.href) {
				links[i].className = "current";
				break;
			}
	}
	if (this.remember) {
		var regex = new RegExp("sdmenu_" + encodeURIComponent(this.menu.id) + "=([01]+)");
		var match = regex.exec(document.cookie);
		if (match) {
			var states = match[1].split("");
			for (var i = 0; i < states.length; i++)
				this.submenus[i].className = (states[i] == 0 ? "collapsed" : "");
		}
	}
};
SDMenu.prototype.toggleMenu = function(submenu) {
	if (submenu.className == "collapsed")
		this.expandMenu(submenu);
	else
		this.collapseMenu(submenu);
};
SDMenu.prototype.expandMenu = function(submenu) {
	var fullHeight = submenu.getElementsByTagName("span")[0].offsetHeight;
	var links = submenu.getElementsByTagName("a");
	for (var i = 0; i < links.length; i++)
		fullHeight += links[i].offsetHeight;
	var moveBy = Math.round(this.speed * links.length);
	
	var mainInstance = this;
	var intId = setInterval(function() {
		var curHeight = submenu.offsetHeight;
		var newHeight = curHeight + moveBy;
		if (newHeight < fullHeight)
			submenu.style.height = newHeight + "px";
		else {
			clearInterval(intId);
			submenu.style.height = "";
			submenu.className = "";
			mainInstance.memorize();
		}
	}, 30);
	this.collapseOthers(submenu);
};
SDMenu.prototype.collapseMenu = function(submenu) {
	var minHeight = submenu.getElementsByTagName("span")[0].offsetHeight;
	var moveBy = Math.round(this.speed * submenu.getElementsByTagName("a").length);
	var mainInstance = this;
	var intId = setInterval(function() {
		var curHeight = submenu.offsetHeight;
		var newHeight = curHeight - moveBy;
		if (newHeight > minHeight)
			submenu.style.height = newHeight + "px";
		else {
			clearInterval(intId);
			submenu.style.height = "";
			submenu.className = "collapsed";
			mainInstance.memorize();
		}
	}, 30);
};
SDMenu.prototype.collapseOthers = function(submenu) {
	if (this.oneSmOnly) {
		for (var i = 0; i < this.submenus.length; i++)
			if (this.submenus[i] != submenu && this.submenus[i].className != "collapsed")
				this.collapseMenu(this.submenus[i]);
	}
};
SDMenu.prototype.expandAll = function() {
	var oldOneSmOnly = this.oneSmOnly;
	this.oneSmOnly = false;
	for (var i = 0; i < this.submenus.length; i++)
		if (this.submenus[i].className == "collapsed")
			this.expandMenu(this.submenus[i]);
	this.oneSmOnly = oldOneSmOnly;
};
SDMenu.prototype.collapseAll = function() {
	for (var i = 0; i < this.submenus.length; i++)
		if (this.submenus[i].className != "collapsed")
			this.collapseMenu(this.submenus[i]);
};
SDMenu.prototype.memorize = function() {
	if (this.remember) {
		var states = new Array();
		for (var i = 0; i < this.submenus.length; i++)
			states.push(this.submenus[i].className == "collapsed" ? 0 : 1);
		var d = new Date();
		d.setTime(d.getTime() + (30 * 24 * 60 * 60 * 1000));
		document.cookie = "sdmenu_" + encodeURIComponent(this.menu.id) + "=" + states.join("") + "; expires=" + d.toGMTString() + "; path=/";
	}
};

function disableEnterKey() {
	if (window.event.keyCode == 13) {
		window.event.keyCode = 0;
	}
}

