// JavaScript Document
<!--
function reshow(object) {
    abrev = object.options[object.selectedIndex].value;
	state = object.options[object.selectedIndex].text;
        for (var i = document.who.names.length;i > 0;i--)
            document.who.names.options[0] = null;
        reloading = true;
        showlinks();
        document.who.names.options[0].selected = true;

    return false;
}

function reshow2(object) {
    names = object.options[object.selectedIndex].text;
        for (var i = document.what.ask.length;i > 0;i--)
            document.what.ask.options[0] = null;
        reloading = true;
        showlinks2();
        document.what.ask.options[0].selected = true;

    return false;
}

function load(object) {
	var question = object.options[object.selectedIndex].text;
    //alert('Just testing: ' + object.options[object.selectedIndex].text);
	switch (question) {
	 case 'Request a quotation':
		window.open('quoteRequestUpdate.asp','_blank');
		//window.open('http://acidistribution.com/dev/forms/quote_request.pdf','_blank');
		//window.open(object.options[object.selectedIndex].value,'Default','scrollbars=no,width=440,height=450,left=400,top=100');
    	return false;
	case 'Product literature':
		window.open(object.options[object.selectedIndex].value,'Default','scrollbars=no,width=440,height=450,left=400,top=100');
    	return false;
	 case 'Meet a Sales Rep':
		window.open(object.options[object.selectedIndex].value,'Default','scrollbars=no,width=540,height=470,left=400,top=100');
    	return false;
	 case 'Find nearest location':
		window.open(object.options[object.selectedIndex].value,'Default','scrollbars=no,width=440,height=450,left=400,top=100');
    	return false;
	 case 'Share a complaint':
	 	window.open(object.options[object.selectedIndex].value,'Default','scrollbars=no,width=470,height=540,left=400,top=100');
    	return false;
	case 'Product samples':
	 	window.open(object.options[object.selectedIndex].value,'Default','scrollbars=no,width=440,height=450,left=400,top=100');
    	return false;
	 case 'Learn about AGRSS':
		window.open(object.options[object.selectedIndex].value);
    	return false;
	 case 'Other':
		window.open(object.options[object.selectedIndex].value,'Default','scrollbars=no,width=460,height=470,left=400,top=100');
    	return false;
	 default:
		window.location.href = object.options[object.selectedIndex].value;
    	return false;
	}
	
}

function showlinks() {
   switch (state) {
	case 'Select Location':
		opt('#','Select Business');
		sel('#','Enter Question');
		document.who.names.disabled=true;
		document.what.ask.disabled=true; 
		return false;
		break;
	case 'Alaska':
		opt('#','Select Business');
		sel('#','Enter Question');
		document.who.names.disabled=true;
		document.what.ask.disabled=true;
		var path = "noLocation.asp?state=" + state;
		window.open(path,'Default','scrollbars=no,width=440,height=480,left=400,top=100'); 
		return false;
		break;
	case 'Connecticut':
		opt('#','Select Business');
		sel('#','Enter Question');
		document.who.names.disabled=true;
		document.what.ask.disabled=true;
		var path = "noLocation.asp?state=" + state;
		window.open(path,'Default','scrollbars=no,width=440,height=480,left=400,top=100'); 
		return false;
		break;
	case 'Delaware':
		opt('#','Select Business');
		sel('#','Enter Question');
		document.who.names.disabled=true;
		document.what.ask.disabled=true;
		var path = "noLocation.asp?state=" + state;
		window.open(path,'Default','scrollbars=no,width=440,height=480,left=400,top=100'); 
		return false;
		break;
	case 'District of Columbia':
		opt('#','Select Business');
		sel('#','Enter Question');
		document.who.names.disabled=true;
		document.what.ask.disabled=true;
		var path = "noLocation.asp?state=" + state;
		window.open(path,'Default','scrollbars=no,width=440,height=480,left=400,top=100'); 
		return false;
		break;
	case 'Idaho':
		opt('#','Select Business');
		sel('#','Enter Question');
		document.who.names.disabled=true;
		document.what.ask.disabled=true;
		var path = "noLocation.asp?state=" + state;
		window.open(path,'Default','scrollbars=no,width=440,height=480,left=400,top=100'); 
		return false;
		break;
	case 'Illinois':
		opt('#','Select Business');
		sel('#','Enter Question');
		document.who.names.disabled=true;
		document.what.ask.disabled=true;
		var path = "noLocation.asp?state=" + state;
		window.open(path,'Default','scrollbars=no,width=440,height=480,left=400,top=100'); 
		return false;
		break;
	case 'Indiana':
		opt('#','Select Business');
		sel('#','Enter Question');
		document.who.names.disabled=true;
		document.what.ask.disabled=true;
		var path = "noLocation.asp?state=" + state;
		window.open(path,'Default','scrollbars=no,width=440,height=480,left=400,top=100'); 
		return false;
		break;
	case 'Iowa':
		opt('#','Select Business');
		sel('#','Enter Question');
		document.who.names.disabled=true;
		document.what.ask.disabled=true;
		var path = "noLocation.asp?state=" + state;
		window.open(path,'Default','scrollbars=no,width=440,height=480,left=400,top=100'); 
		return false;
		break;
	case 'Kansas':
		opt('#','Select Business');
		sel('#','Enter Question');
		document.who.names.disabled=true;
		document.what.ask.disabled=true;
		var path = "noLocation.asp?state=" + state;
		window.open(path,'Default','scrollbars=no,width=440,height=480,left=400,top=100'); 
		return false;
		break;
	case 'Kentucky':
		opt('#','Select Business');
		sel('#','Enter Question');
		document.who.names.disabled=true;
		document.what.ask.disabled=true;
		var path = "noLocation.asp?state=" + state;
		window.open(path,'Default','scrollbars=no,width=440,height=480,left=400,top=100'); 
		return false;
		break;
	case 'Maine':
		opt('#','Select Business');
		sel('#','Enter Question');
		document.who.names.disabled=true;
		document.what.ask.disabled=true;
		var path = "noLocation.asp?state=" + state;
		window.open(path,'Default','scrollbars=no,width=440,height=480,left=400,top=100'); 
		return false;
		break;
	case 'Maryland':
		opt('#','Select Business');
		sel('#','Enter Question');
		document.who.names.disabled=true;
		document.what.ask.disabled=true;
		var path = "noLocation.asp?state=" + state;
		window.open(path,'Default','scrollbars=no,width=440,height=480,left=400,top=100'); 
		return false;
		break;
	case 'Massachusetts':
		opt('#','Select Business');
		sel('#','Enter Question');
		document.who.names.disabled=true;
		document.what.ask.disabled=true;
		var path = "noLocation.asp?state=" + state;
		window.open(path,'Default','scrollbars=no,width=440,height=480,left=400,top=100'); 
		return false;
		break;
	case 'Michigan':
		opt('#','Select Business');
		sel('#','Enter Question');
		document.who.names.disabled=true;
		document.what.ask.disabled=true;
		var path = "noLocation.asp?state=" + state;
		window.open(path,'Default','scrollbars=no,width=440,height=480,left=400,top=100'); 
		return false;
		break;
	case 'Minnesota':
		opt('#','Select Business');
		sel('#','Enter Question');
		document.who.names.disabled=true;
		document.what.ask.disabled=true;
		var path = "noLocation.asp?state=" + state;
		window.open(path,'Default','scrollbars=no,width=440,height=480,left=400,top=100'); 
		return false;
		break;
	case 'Montana':
		opt('#','Select Business');
		sel('#','Enter Question');
		document.who.names.disabled=true;
		document.what.ask.disabled=true;
		var path = "noLocation.asp?state=" + state;
		window.open(path,'Default','scrollbars=no,width=440,height=480,left=400,top=100'); 
		return false;
		break;
	case 'Nebraska':
		opt('#','Select Business');
		sel('#','Enter Question');
		document.who.names.disabled=true;
		document.what.ask.disabled=true;
		var path = "noLocation.asp?state=" + state;
		window.open(path,'Default','scrollbars=no,width=440,height=480,left=400,top=100'); 
		return false;
		break;
	case 'New Hampshire':
		opt('#','Select Business');
		sel('#','Enter Question');
		document.who.names.disabled=true;
		document.what.ask.disabled=true;
		var path = "noLocation.asp?state=" + state;
		window.open(path,'Default','scrollbars=no,width=440,height=480,left=400,top=100'); 
		return false;
		break;
	case 'New Jersey':
		opt('#','Select Business');
		sel('#','Enter Question');
		document.who.names.disabled=true;
		document.what.ask.disabled=true;
		var path = "noLocation.asp?state=" + state;
		window.open(path,'Default','scrollbars=no,width=440,height=480,left=400,top=100'); 
		return false;
		break;
	case 'New Mexico':
		opt('#','Select Business');
		sel('#','Enter Question');
		document.who.names.disabled=true;
		document.what.ask.disabled=true;
		var path = "noLocation.asp?state=" + state;
		window.open(path,'Default','scrollbars=no,width=440,height=480,left=400,top=100'); 
		return false;
		break;
	case 'New York':
		opt('#','Select Business');
		sel('#','Enter Question');
		document.who.names.disabled=true;
		document.what.ask.disabled=true;
		var path = "noLocation.asp?state=" + state;
		window.open(path,'Default','scrollbars=no,width=440,height=480,left=400,top=100'); 
		return false;
		break;
	case 'North Dakota':
		opt('#','Select Business');
		sel('#','Enter Question');
		document.who.names.disabled=true;
		document.what.ask.disabled=true;
		var path = "noLocation.asp?state=" + state;
		window.open(path,'Default','scrollbars=no,width=440,height=480,left=400,top=100'); 
		return false;
		break;
	case 'Ohio':
		opt('#','Select Business');
		sel('#','Enter Question');
		document.who.names.disabled=true;
		document.what.ask.disabled=true;
		var path = "noLocation.asp?state=" + state;
		window.open(path,'Default','scrollbars=no,width=440,height=480,left=400,top=100'); 
		return false;
		break;
	case 'Oregon':
		opt('#','Select Business');
		sel('#','Enter Question');
		document.who.names.disabled=true;
		document.what.ask.disabled=true;
		var path = "noLocation.asp?state=" + state;
		window.open(path,'Default','scrollbars=no,width=440,height=480,left=400,top=100'); 
		return false;
		break;
	case 'Pennsylvania':
		opt('#','Select Business');
		sel('#','Enter Question');
		document.who.names.disabled=true;
		document.what.ask.disabled=true;
		var path = "noLocation.asp?state=" + state;
		window.open(path,'Default','scrollbars=no,width=440,height=480,left=400,top=100'); 
		return false;
		break;
	case 'Rhode Island':
		opt('#','Select Business');
		sel('#','Enter Question');
		document.who.names.disabled=true;
		document.what.ask.disabled=true;
		var path = "noLocation.asp?state=" + state;
		window.open(path,'Default','scrollbars=no,width=440,height=480,left=400,top=100'); 
		return false;
		break;
	case 'South Dakota':
		opt('#','Select Business');
		sel('#','Enter Question');
		document.who.names.disabled=true;
		document.what.ask.disabled=true;
		var path = "noLocation.asp?state=" + state;
		window.open(path,'Default','scrollbars=no,width=440,height=480,left=400,top=100'); 
		return false;
		break;
	case 'Vermont':
		opt('#','Select Business');
		sel('#','Enter Question');
		document.who.names.disabled=true;
		document.what.ask.disabled=true;
		var path = "noLocation.asp?state=" + state;
		window.open(path,'Default','scrollbars=no,width=440,height=480,left=400,top=100'); 
		return false;
		break;
	case 'Washington':
		opt('#','Select Business');
		sel('#','Enter Question');
		document.who.names.disabled=true;
		document.what.ask.disabled=true;
		var path = "noLocation.asp?state=" + state;
		window.open(path,'Default','scrollbars=no,width=440,height=480,left=400,top=100'); 
		return false;
		break;
	case 'West Virginia':
		opt('#','Select Business');
		sel('#','Enter Question');
		document.who.names.disabled=true;
		document.what.ask.disabled=true;
		var path = "noLocation.asp?state=" + state;
		window.open(path,'Default','scrollbars=no,width=440,height=480,left=400,top=100'); 
		return false;
		break;
	case 'Wisconsin':
		opt('#','Select Business');
		sel('#','Enter Question');
		document.who.names.disabled=true;
		document.what.ask.disabled=true;
		var path = "noLocation.asp?state=" + state;
		window.open(path,'Default','scrollbars=no,width=440,height=480,left=400,top=100'); 
		return false;
		break;
	case 'Wyoming':
		opt('#','Select Business');
		sel('#','Enter Question');
		document.who.names.disabled=true;
		document.what.ask.disabled=true;
		var path = "noLocation.asp?state=" + state;
		window.open(path,'Default','scrollbars=no,width=440,height=480,left=400,top=100'); 
		return false;
		break;
	default:
		document.who.names.disabled=false;
		document.what.ask.disabled=true;
		opt('#','Select Business');
		/*opt('#','Auto Body Shop');*/
        /*opt('#','Com Glazing Contractor');*/
		/*opt('#','Res Glazing Contractor');*/
		opt('#','Glazing Contractor');
		opt('#','Developer');
		opt('#','Architect');
		opt('#','Interior Designer');
		opt('#','General Contractor');
		opt('#','Retail Glass Shop');
		opt('#','Auto Glass Shop');
		opt('#','Glass Fabricator');
		opt('#','Window Manufacturer');
		opt('#','Custom Millwork');
		/*opt('#','Picture Frame Shop');*/		
		opt('#','Other');
		break;
    }
}
function showlinks2() {
   switch (names) {
	case 'Select Business':
		sel('#','Enter Question');
		document.what.ask.disabled=true;
		break;
   	case 'Auto Body Shop':
		sel('#','Enter Question');
		document.what.ask.disabled=true;
		var path = "wholesale.asp?state=" + state + "&amp;company=" + names;
		window.open(path,'Default','scrollbars=no,width=440,height=480,left=400,top=100'); 
		return false;
		break;
	case 'General Contractor':
		sel('#','Enter Question');
		document.what.ask.disabled=true;
		var path = "wholesale.asp?state=" + state + "&amp;company=" + names;
		window.open(path,'Default','scrollbars=no,width=440,height=450,left=400,top=100'); 
		return false;
		break;
	case 'Retail Glass Shop':
		document.what.ask.disabled=false;
		sel('#','Enter Question');
		var request = "quoteRequestUpdate.asp?state=" + state + "&amp;company=" + names;
		sel(request,'Request a quotation');
		var sample = "samples.asp?state=" + state + "&amp;company=" + names;
        sel(sample,'Product literature');
		var sale = "salesRep.asp?state=" + state + "&amp;abrev=" + abrev + "&amp;company=" + names;
		sel(sale,'Meet a Sales Rep');
		var path = "contact_list.asp#" + abrev;
		sel(path,'Find nearest location');
		sel('complaint.asp','Share a complaint');
		sel('http://www.vitroamerica.com/products/mirrors.asp','Learn about mirror');
		sel('http://www.vitroamerica.com/products/handrails.asp','Glass doors/handrails');
		sel('http://www.aciglasscentral.com','Place an order online');
		sel('resources_warranties.asp','Request a warranty');
		sel('http://www.agrss.com','Learn about AGRSS');
		sel(sample,'Product samples');
		sel('http://www.vitroamerica.com/productsnew.asp','Product offerings');
		var other = "other.asp?abrev=" + abrev + "&amp;state=" + state + "&amp;company=" + names;
		sel(other,'Other');
		break;
	default:
		document.what.ask.disabled=false;
		sel('#','Enter Question');
		var request = "quoteRequestUpdate.asp?state=" + state + "&amp;company=" + names;
		sel(request,'Request a quotation');
		var sample = "samples.asp?state=" + state + "&amp;company=" + names;
        sel(sample,'Product literature');
		var sale = "salesRep.asp?state=" + state + "&amp;abrev=" + abrev + "&amp;company=" + names;
		sel(sale,'Meet a Sales Rep');
		var path = "contact_list.asp#" + abrev;
		sel(path,'Find nearest location');
		sel('complaint.asp','Share a complaint');
		sel('http://www.vitroamerica.com/products/mirrors.asp','Learn about mirror');
		sel('http://www.vitroamerica.com/products/handrails.asp','Glass doors/handrails');
		sel('resources_warranties.asp','Request a warranty');
		sel('http://www.agrss.com','Learn about AGRSS');
		sel(sample,'Product samples');
		sel('http://www.vitroamerica.com/productsnew.asp','Product offerings');
		var other = "other.asp?state=" + state + "&abrev=" + abrev + "&amp;company=" + names;
		sel(other,'Other');
		break;
    }
}

function opt(href,text) {
    if (reloading)  {
        var optionName = new Option(text, href, false, false)
        var length = document.who.names.length;
        document.who.names.options[length] = optionName;
    }
    else
        document.write('<OPTION VALUE="',href,'">',text,'<\/OPTION>');
}

function sel(href,text) {
    if (reloading)  {
		var optionName = new Option(text, href, false, false)
        var length = document.what.ask.length;
        document.what.ask.options[length] = optionName;
    }
    else
        document.write('<OPTION VALUE="',href,'">',text,'<\/OPTION>');
}

//-->