function winopenn(popup)
{
	window.open(popup, 'NewWindow2', 'toolbar=no,location=yes,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=no,copyhistory=no,width=210,height=270')
}
function newwindow()
{
	window.open("armrests.html", "newwindow1", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=550,height=500")
}
function closewindo()
{
	window.close('newwindow1')
}
function popUp(url) {
    sealWin = window.open(url, "win", 'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=450');
    self.name = "mainWin";
}

//<!--
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_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]; }
	}
}

MM_preloadImages('/App_Themes/us/images/main_nav_on_background.gif', '/App_Themes/us/images/menu_left_curve_on.jpg', '/App_Themes/us/images/menu_brown_on.jpg', '/App_Themes/us/images/menu_green_on.jpg')

function liveHelp(){
    window.open('https://server.iad.liveperson.net/hc/87853283/?cmd=file&file=visitorWantsToChat&offlineURL=http://www.1800wheelchair.com/asp/contact.aspx&site=87853283&referrer=' + document.location, 'chat87853283', 'width=472,height=320');
}

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_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 tglVisibility(section, a) {
    var o = getElemRef(section);
    os = o.style;
    if (os.display == 'none') {
        os.display = 'block';
        if (a) { tglLinkText(a) }
    }
    else {
        os.display = 'none';
        if (a) { tglLinkText(a) }
    }
}

function getElemRef(id) {
    var el = (document.getElementById) ? document.getElementById(id) : (document.all) ? document.all[id] : (document.layers) ? document.layers[id] : null;
    return el;
}
function tglLinkText(a) {
    if (typeof a == "string") { a = getElemRef(a) }
    var s = a.innerHTML
    if (s.toLowerCase().indexOf("all") >= 0) {
        s = s.replace(/all/i, "Less").replace('+', '-');
    }
    else if (s.toLowerCase().indexOf("less") >= 0) {
        s = s.replace(/less/i, "All").replace('-', '+');
    }
    a.innerHTML = s;
}
/**
* DHTML dropdown menu script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
*/

var bName = navigator.appName;
var bVer = parseInt(navigator.appVersion);
var NS6 = (bName == "Netscape" && bVer >= 5);
var NS4 = (bName == "Netscape" && bVer >= 4 && bVer < 5);
var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);
var NS3 = (bName == "Netscape" && bVer < 4);
var IE3 = (bName == "Microsoft Internet Explorer" && bVer < 4);
window.onerror = null;
var menuActive = 0
var menuOn = 0
var onLayer
var timeOn = null // LAYER SWITCHING CODE
if (NS4 || IE4 || NS6)
{
	if (navigator.appName == "Netscape" && !document.getElementById)
	{
		layerStyleRef = "layer.";
		layerRef = "document.layers";
		styleSwitch = "";
		layerVis = "show";
		layerHid = "hide";
	}
	else if (!document.all && document.getElementById)
	{
		layerStyleRef = "layer.style.";
		layerRef = "document.getElementById";
		styleSwitch = ".style";
		layerVis = "visible";
		layerHid = "hidden";
	}
	else
	{
		layerStyleRef = "layer.style.";
		layerRef = "document.all";
		styleSwitch = ".style";
		layerVis = "visible";
		layerHid = "hidden";
	}
}

function getImage(name)
{
	if (NS4 || NS6)
	{
		return findImage(name, document);
	}
	if (IE4 || NS6)
		return eval('document.all.' + name);
	return null;
}

function findImage(name, doc)
{
	var i, img;
	for (i = 0; i < doc.images.length; i++)
		if (doc.images[i].name == name)
		return doc.images[i];
	for (i = 0; i < doc.layers.length; i++)
		if ((img = findImage(name, doc.layers[i].document)) != null)
	{
		img.container = doc.layers[i];
		return img;
	}
	return null;
}

var previousElement; //element is placed here so when new popup it hides the previous.
function descbox(msg, i)
{
	if (i == "visible")
	{
		if (previousElement) descbox(previousElement, "hidden");
		previousElement = msg;
	}
	else
	{
		if (msg == previousElement) previousElement = null;
	}

	isNS4 = (document.layers);
	isIE4 = (document.all && !document.getElementById);
	isIE5 = (document.all && document.getElementById);
	isNS6 = (!document.all && document.getElementById);

	if (isNS4)
	{
		lbox = document.layers[msg];
		movelayer(lbox);
		NS4_boxtoggle(lbox, i);

	}
	else if (isIE4)
	{
		lbox = document.all[msg];
		movelayer(lbox);
		DOM_boxtoggle(lbox, i);

	}
	else if (isIE5 || isNS6)
	{
		lbox = document.getElementById(msg);
		movelayer(lbox);
		DOM_boxtoggle(lbox, i);

	}
}

// -->

//<!--
function val()
{
	var s = true
	for (var i = 0; i < document.forms.item.length; i++)
	{
		if (document.addcart.elements[i].type == "select-one")
		{
			if (document.addcart.elements[i].value == "1")
			{
				alert("Please choose one.");
				document.addcart.elements[i].focus();
				s = false;
				break;
			}

		}

	}
	return s;
}



function DOM_boxtoggle(lbox, i)
{
	if (lbox.style)
	{
		boxstyle = lbox.style;
		boxstyle.visibility = i;
	}
}


function NS4_boxtoggle(lbox, i)
{
	lbox.visibility = i;
}


function getStyleObject(objectId)
{
	// cross-browser function to get an object's style object given its id
	if (document.getElementById && document.getElementById(objectId))
	{
		// W3C DOM
		return document.getElementById(objectId).style;
	} else if (document.all && document.all(objectId))
	{
		// MSIE 4 DOM
		return document.all(objectId).style;
	} else if (document.layers && document.layers[objectId])
	{
		// NN 4 DOM.. note: this won't find nested layers
		return document.layers[objectId];
	} else
	{
		return false;
	}
} // getStyleObject


function changeObjectVisibility(objectId, newVisibility)
{
	// get a reference to the cross-browser style object and make sure the object exists
	var styleObject = getStyleObject(objectId);
	if (styleObject)
	{
		styleObject.visibility = newVisibility;
		return true;
	} else
	{
		// we couldn't find the object, so we can't change its visibility
		return false;
	}
} // changeObjectVisibility


function moveObject(objectId, newXCoordinate, newYCoordinate)
{
	// get a reference to the cross-browser style object and make sure the object exists
	var styleObject = getStyleObject(objectId);
	if (styleObject)
	{
		styleObject.left = newXCoordinate;
		styleObject.top = newYCoordinate;
		return true;
	} else
	{
		// we couldn't find the object, so we can't very well move it
		return false;
	}
} // moveObject


function movelayer(obj)
{
	var y, x
	if (document.documentElement && document.documentElement.scrollTop)
	{
		x = document.documentElement.scrollLeft;
		y = document.documentElement.scrollTop;
	}
	else if (document.body)
	{
		x = document.body.scrollLeft;
		y = document.body.scrollTop;
	}
	y += 20;
	x += 20;
	// x = -100 + document.body.clientWidth / 2;
	// alert("X: " + x + " Y: " + y + " Layer: " + obj.id);
	// moveObject(obj, x, y);
	obj.style.left = x + 'px';
	obj.style.top = y + 'px';
	return false;
}

// this function shows the pop-up when user moves the mouse over the link
function ShowPopup(e, msg)
{
	obj = getElemRef(msg)
//	x = e.clientX + document.body.scrollLeft; // get the mouse left position
//	y = e.clientY + document.body.scrollTop; //  + 35 get the mouse top position
	if (!e) var e = window.event;
	if (e.pageX || e.pageY) {
	    posx = e.pageX;
	    posy = e.pageY;
	}
	else if (e.clientX || e.clientY) {
	    posx = e.clientX + document.body.scrollLeft
			+ document.documentElement.scrollLeft;
	    posy = e.clientY + document.body.scrollTop
			+ document.documentElement.scrollTop;
	}
	obj.style.display = "block"; // display the pop-up
	obj.style.left = posx + "px"; // set the pop-up's left
	obj.style.top = posy + "px"; // set the pop-up's top
}

//function PopupStartTimeout(msg) {
//    t = setTimeout(function() { HidePopup(msg); msg = null }, 1000);	
//}
// this function hides the pop-up when user moves the mouse out of the link
function HidePopup(msg)
{
	obj = getElemRef(msg)
	obj.style.display = "none"; // hide the pop-up
}

function InitDrag(CustID, Pref)
{
	var r = getElemRef(Pref + CustID);
	//	var h = getElemRef('topbar_' + CustID);
	//	Drag.init(h,r);
	Drag.init(r);
}

// change element's visibility by boolean value
function visibilityChange(elementID, visible)
{
	var display = visible ? "block" : "none";
	try
	{
		document.getElementById(elementID).style.display = display;
	} catch (e)
	{
		foo = e;
	}
}

//-->

