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 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];}}
}

/****** QUERYSTRING JAVASCRIPT ***********/
function Querystring(qs) { // optionally pass a querystring to parse
	this.params = new Object()
	this.get=Querystring_get

	if (qs == null)
		qs=location.search.substring(1,location.search.length)

	if (qs.length == 0) return

// Turn <plus> back to <space>
// See: http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13.4.1
	qs = qs.replace(/\+/g, ' ')
	var args = qs.split('&') // parse out name/value pairs separated via &

// split out each name=value pair
	for (var i=0;i<args.length;i++) {
		var value;
		var pair = args[i].split('=')
		var name = unescape(pair[0])

		if (pair.length == 2)
			value = unescape(pair[1])
		else
			value = name

		this.params[name] = value
	}
}

function Querystring_get(key, default_) {
	// This silly looking line changes UNDEFINED to NULL
	if (default_ == null) default_ = null;

	var value=this.params[key]
	if (value==null) value=default_;

	return value
}

//dhtml popup functions
var ns4=document.layers;
var ie4=document.all;
var ns6=document.getElementById&&!document.all;

function hidePop(){
	var adPop=ns6? document.getElementById("popDiv") : document.all.popDiv
	if (ie4||ns6){
		adPop.style.visibility="hidden"
	}
	else if (ns4){
		document.popDiv.visibility="hide"
	}
}

function showPop(){
    scroll(0,0);

    var adPop=ns6? document.getElementById("popDiv") : document.all.popDiv
	if (ie4||ns6){
		adPop.style.visibility="visible"
	}
	else if (ns4){
		document.popDiv.visibility="show"
	}

    sendLinkEvent('','Decorating Assistant Mktg:Popup');
}


//tooltip functions
// ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
//
// Coded by Travis Beckham
// http://www.squidfingers.com | http://www.podlob.com
// If want to use this code, feel free to do so, but please leave this message intact.
//
// ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// --- version date: 06/13/04 ---------------------------------------------------------

tooltip = {
	name : "tooltipDiv",
	offsetX : 40,
	offsetY : -10,
	tip : null
};
tooltip.init = function () {
	if (!document.getElementById) return;

	// It would be nice to be able to generate the tooltip div,
	// but when using document.createElement Explorer5/MacOS9,
	// the tooltip div becomes 100% of the window height.
	// Therefore, we have to use document.getElementById to access
	// a div that is already in the body.

	// this.tip = document.createElement ("div");
	// this.tip.setAttribute ("id", this.name);
	// document.body.appendChild (this.tip);

	this.tip = document.getElementById (this.name);
	if (this.tip) document.onmousemove = function (evt) {tooltip.move (evt)};

	var a;
	var anchors = document.getElementsByTagName ("a");
	for (var i = 0; i < anchors.length; i ++) {
		a = anchors[i];
		if (a.className == "tooltip") {
			a.onmouseover = function () {
                tooltip.show (this.title)
            };
			a.onmouseout = function () {tooltip.hide ()};
		}
	}
};
tooltip.move = function (evt) {
	var x=0, y=0;
	if (document.all) {// Explorer

		// Explorer5 contains the documentElement object but it's empty,
		// so we must check if the scrollLeft property is available.

		// If Explorer6 is in Quirks mode, the documentElement properties
		// will still be defined, but they will contain the number 0.

		// If Explorer6 is in Standards compliant mode, the document.body
		// properties will still be defined, but they will contain the number 0.

		x = (document.documentElement && document.documentElement.scrollLeft) ? document.documentElement.scrollLeft : document.body.scrollLeft;
		y = (document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop;
		x += (window.event.clientX-15);
		y += window.event.clientY-82;

	} else {// Mozilla
		x = evt.pageX-15;
		y = evt.pageY-82;
	}
	// If the style property value is not a string containing the unit measurement,
	// browsers in standard compliant mode will not set the property.
	this.tip.style.left = (x + this.offsetX-15) + "px";
	this.tip.style.top = (y + this.offsetY-82) + "px";
};
tooltip.show = function (text) {
	if (!this.tip) return;
	this.tip.innerHTML = text;
	// Without the next line, Explorer5/Mac has a redraw problem.
	this.tip.style.visibility = "visible";
	this.tip.style.display = "block";
};
tooltip.hide = function () {
	if (!this.tip) return;
	// Without the next line, Explorer5/Mac has a redraw problem.
	this.tip.style.visibility = "hidden";
	this.tip.style.display = "none";
	this.tip.innerHTML = "";
};