
document.write('<style type="text/css">');
document.write('body {');
document.write('margin-left: 0px;');
document.write('margin-top: 0px;');
document.write('margin-right: 0px;');
document.write('margin-bottom: 0px;');
document.write('}');
document.write('</style>');


document.write('<center>');



document.write('<div style="width:800px; height:33px;">');
document.write('<div style="width:800px; height:33px; float:left;">');
document.write('<span style="width:6px; height:29px; float:left;"><img  src="http://www.ofcard.com/include/search/images/home_search_left.gif"/></span>');
document.write('<span style="width:787px; height:29px; background-image:url(http://www.ofcard.com/include/search/images/home_search_bg.gif); background-repeat:repeat-x; float:left;padding-top:3px;">');
document.write('<form name="ofcard_product_list" method="post" action="">');
document.write('<input type="hidden" name="username" id="username" value="">');
document.write('<div style="width:628px;height:18px;float:left;">');
document.write('<select name="productkind" style="width:180px; height:18px;background-color:transparent;" onChange="selectKind(this.value)">');
document.write('<option value="0" selected>--请选择商品类型--</option>');
document.write('</select>');

document.write('<select name="vendor" style="width:275px; height:18px;background-color:transparent;" onChange="selectVendor(this.value)">');
document.write('<option value="0" selected>---请选择具体商品---</option>');
document.write('</select>');

document.write('<select name="product" style="width:150px; height:18px;background-color:transparent;">');
document.write('<option value="0" selected>---请选择面值---</option>');
document.write('</select>');
document.write('</div>');
document.write('<div style="width:90px;height:19px;float:left;"><img src="http://www.ofcard.com/include/search/images/quicksearch.gif" onclick="dopurchase()" style="cursor:hand"/></div>');
document.write('</form>');

var formobj;
formobj = document.forms["ofcard_product_list"];
initialize();

function initialize(){
	for (i=1; i<=kindArr.length;i++ ){
		formobj.productkind.options[i] = null;
		formobj.productkind.options[i] = new Option(""+kindArr[i-1][0], ""+kindArr[i-1][1]);
	}
}

function selectKind(arg){
	if (arg=="0"){
		alert("请选择需要购买的产品类型");
	}else {
		clearElement("vendor");
		for (i=0,n=1;i<vendorArr.length ;i++ ){
			if(vendorArr[i][2]==arg){
				formobj.vendor.options[n] = null;
				formobj.vendor.options[n] = new Option(vendorArr[i][0],vendorArr[i][1]);
				n++;
			}
		}
		if(i==0){
			formobj.vendor.options[0]=new Option("目前无该子类","0")
		}else{
			formobj.vendor.options[0].selected = true;
		}
	}
}

function selectVendor(arg){
	if (arg=="0"){
		alert("请选择需要购买的产品厂商");
	}else {
		clearElement("product");
		eval("var productArr=Arr"+arg+";");
		for (j=0;j<productArr.length ;j++ ){
			formobj.product.options[j+1] = null;
			var tcateid = productArr[j][1];
			var classtype = productArr[j][3];
			formobj.product.options[j+1] = new Option(productArr[j][0]+productArr[j][2], tcateid+","+classtype);
		}
		if(j==0){
			formobj.product.options[0]=new Option("目前无该类产品","0")
		}else{
			formobj.product.options[0].selected = true;
		}
	}
}

function clearElement(arg){
	eval("var list=formobj."+arg+";");
	for(i=list.options.length;i>0;i--){		
		list.options[i] = null;
	}
}

function dopurchase(){
	var value = formobj.product.value;
	var category = value.split(",");
	if(category[0]=="0"){
		alert("请选择您要购买的产品");
		return false;
	}
	var AgencyName=document.getElementById("AgencyName").innerHTML;
	if(AgencyName==""){
		alert("无法取到经销商登陆名,请根据要求嵌入相应！");
		return false;
	}
	document.getElementById("username").value=AgencyName;
	window.open("http://www.ofcard.com/temptx.jsp?cardid="+category[0]+"&classtype="+category[1]);
}

function println(arg){
	document.writeln(arg);
}
document.write('</span>');
document.write('<span style="width:6px; height:29px; float:left;"><img  src="http://www.ofcard.com/include/search/images/home_search_right.gif"/></span></div>');
document.write('</div>');
document.write('</center>');

