﻿sfHover = function() {
	var sfEls = document.getElementById("dropdown").getElementsByTagName("LI");
	if (sfEls) {
	    for (var i=0; i<sfEls.length; i++) {
		    sfEls[i].onmouseover=function() {
			    this.className=" sfhover";
		    }
		    sfEls[i].onmouseout=function() {
			    this.className=this.className="";
		    }
	    }
	}
}
if (window.attachEvent) {
  window.attachEvent("onload", sfHover);
}

function encode(str) {
	var result = "";
	
	for (i = 0; i < str.length; i++) {
		if (str.charAt(i) == " ") result += "+";
		else result += str.charAt(i);
	}	
	return escape(result);
}

function DoSelection(link,type){

  if (document.getElementById) {
    var v1 = document.getElementById('class');
    v1 = encode(v1.innerHTML);
    var v2 = document.getElementById('make');
    if (v2) {
      v2 = encode(v2.innerHTML);
    } else {
      v2="";
    }
    var v3 = document.getElementById('band');    
    if (v3) {
      v3 = encode(v3.value);    
    } else {
      v3="";
    }
    switch (type) {
      case 0:
        v1=encode(link.innerHTML);
        break;
      case 1:
        v2=encode(link.innerHTML);
        break;
      case 2:
        v3=encode(link.innerHTML);
        break;
    }
    window.location=window.location.pathname+'?class='+v1+'&make='+v2+'&band='+v3;
    return false;        
  }
}

function PriceSel(band) {

  if (document.getElementById) {
    var v1 = document.getElementById('class');
    v1 = encode(v1.innerHTML);
    var v2 = document.getElementById('make');
    if (v2) {
      v2 = encode(v2.innerHTML);
    } else {
      v2="";
    }
    //window.location.pathname
    window.location=window.location.pathname+'?class='+v1+'&make='+v2+'&band='+band;
    return false;        
  }
}
