function button_on ( imgName ) {
	butOn = eval ( imgName + "_on.src" );
	document [imgName].src = butOn;
}

function button_off ( imgName ) {
	butOff = eval ( imgName + "_off.src" );
	document [imgName].src = butOff;
}

function cache_images(img_name_array){

  for(x=0;x<img_name_array.length;x++) {
    eval(img_name_array[x]+"_off=new Image();");
    eval(img_name_array[x]+"_off.src=\"images/"+img_name_array[x]+"_off.gif\";");
    eval(img_name_array[x]+"_on=new Image();");
    eval(img_name_array[x]+"_on.src=\"images/"+img_name_array[x]+"_on.gif\";");
  }


}

var quicklinks=new Array('quicklinks_showroom',
		     'quicklinks_workspaces',
		     'quicklinks_learnmore'
);

cache_images(quicklinks);


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

var myWindow;
function openCenteredWindow(url) {
    var width = 1000;
    var height = 700;
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
//    var windowFeatures = "width=" + width + ",height=" + height + 
//        ",status,resizable,menubar,location,scrollbars,toolbar,left=" + left + ",top=" + top + 
//        "screenX=" + left + ",screenY=" + top;

    var windowFeatures = "width=" + width + ",height=" + height + 
        ",scrollbars,resizable,left=" + left + ",top=" + top + 
        "screenX=" + left + ",screenY=" + top;
    myWindow = window.open(url, "subWind", windowFeatures);
}

if (!document.layers&&!document.all&&!document.getElementById)
event="test"
function showtip(current,e,text) {
if (document.all||document.getElementById) {
        thetitle = text.split('<br>')
        if (thetitle.length>1) {
                thetitles=''
                for (i=0;i<thetitle.length;i++)
                thetitles+=thetitle[i]
                current.title=thetitles
        }
        else
        current.title=text
}
else if (document.layers) {
        document.tooltip.document.write('<layer bgColor="white" style="border:1px solid black;font-size:12px;">'+text+'</layer>')
        document.tooltip.document.close()
        document.tooltip.left=e.pageX+5
        document.tooltip.top=e.pageY+5
        document.tooltip.visibility="show"
}
}
function hidetip() {
        if (document.layers)
        document.tooltip.visibility="hidden"
}

function removeTerm(term,TheForm) {
	re = new RegExp(term);
	// if the unchecked term is still in the box, find way to delete the term
	if (TheForm.terms.value.match(re))
		TheForm.terms.value=TheForm.terms.value.replace(re, "")
		//TheForm.terms.value="Success"
}

// tooltips functions

if (!document.layers&&!document.all&&!document.getElementById)
event="test"
function showtip(current,e,text) {
if (document.all||document.getElementById) {
	thetitle = text.split('<br>')
	if (thetitle.length>1) {
		thetitles=''
		for (i=0;i<thetitle.length;i++)
		thetitles+=thetitle[i]
		current.title=thetitles
	}
	else
	current.title=text
}
else if (document.layers) {
	document.tooltip.document.write('<layer bgColor="white" style="border:1px solid black;font-size:12px;">'+text+'</layer>')
	document.tooltip.document.close()
	document.tooltip.left=e.pageX+5
	document.tooltip.top=e.pageY+5
	document.tooltip.visibility="show"
}
}
function hidetip() {
	if (document.layers)
	document.tooltip.visibility="hidden"
}

