var category=new Array();
var catid=new Array();
var pu = 'http://forbes.directorym.com/';
var lbnbreak = 'True';
var predial = 0;
var column = 'False';
category[0]=new Option("Business Services", "catsub0");
catid[0] = 9425;
var catsub0=new Array()
catsub0[0]=new Option("Call Centers", "1782");
catsub0[1]=new Option("Construction", "1558");
catsub0[2]=new Option("Copiers / Printers /", "9252");
catsub0[3]=new Option(" Scanners", "9252");
catsub0[4]=new Option("Franchising", "9222");
catsub0[5]=new Option("Health Benefits: HMO /", "9253");
catsub0[6]=new Option(" PPO", "9253");
catsub0[7]=new Option("Malpractice", "3078");
catsub0[8]=new Option(" Insurance", "3078");
catsub0[9]=new Option("Merchant Services", "9263");
category[1]=new Option("Consumer Services", "catsub1");
catid[1] = 9426;
var catsub1=new Array()
catsub1[0]=new Option("Continuing", "7914");
catsub1[1]=new Option(" Education", "7914");
catsub1[2]=new Option("Farm & Ranch Real", "9227");
catsub1[3]=new Option(" Estate", "9227");
catsub1[4]=new Option("Life Insurance", "2633");
catsub1[5]=new Option("Luxury Autos", "9203");
catsub1[6]=new Option("Luxury Home", "3061");
catsub1[7]=new Option(" Theaters", "3061");
catsub1[8]=new Option("Luxury Yachts", "9201");
catsub1[9]=new Option("Residential Real", "2198");
catsub1[10]=new Option(" Estate", "2198");
catsub1[11]=new Option("Retirement", "2643");
catsub1[12]=new Option(" Communities", "2643");
category[2]=new Option("Corporate Services", "catsub2");
catid[2] = 9427;
var catsub2=new Array()
catsub2[0]=new Option("Business Insurance", "1933");
catsub2[1]=new Option("Commercial Real", "2200");
catsub2[2]=new Option(" Estate", "2200");
catsub2[3]=new Option("Executive Coaching", "3490");
catsub2[4]=new Option("Executive Search", "3204");
catsub2[5]=new Option("HR Services", "9228");
catsub2[6]=new Option("Legal Services", "2136");
catsub2[7]=new Option("Project Management", "3749");
category[3]=new Option("Finance", "catsub3");
catid[3] = 9429;
var catsub3=new Array()
catsub3[0]=new Option("3% APY Savings", "9264");
catsub3[1]=new Option(" Account", "9264");
catsub3[2]=new Option("Accounting", "2111");
catsub3[3]=new Option("Accounting Project", "9233");
catsub3[4]=new Option(" Resources", "9233");
catsub3[5]=new Option("Automobile Financing /", "9232");
catsub3[6]=new Option(" Leasing", "9232");
catsub3[7]=new Option("Bankruptcy / Debt", "9220");
catsub3[8]=new Option(" Settlement", "9220");
catsub3[9]=new Option("Bridge Loans", "9236");
catsub3[10]=new Option("Commercial Debt", "3913");
catsub3[11]=new Option(" Collections", "3913");
catsub3[12]=new Option("Commodities", "9237");
catsub3[13]=new Option(" Brokers", "9237");
catsub3[14]=new Option("Currency Trading", "9215");
catsub3[15]=new Option("ERP / Accounting", "3130");
catsub3[16]=new Option(" Software", "3130");
catsub3[17]=new Option("Factoring", "3512");
catsub3[18]=new Option("Mergers &", "3004");
catsub3[19]=new Option(" Acquisitions", "3004");
catsub3[20]=new Option("Mortgages", "3183");
catsub3[21]=new Option("Online Trading", "3148");
catsub3[22]=new Option("Wealth Management", "4112");
category[4]=new Option("Luxury Services", "catsub4");
catid[4] = 9430;
var catsub4=new Array()
catsub4[0]=new Option("Luxury Autos", "9203");
catsub4[1]=new Option("Luxury Home", "3061");
catsub4[2]=new Option(" Theaters", "3061");
catsub4[3]=new Option("Luxury Hotels", "2352");
catsub4[4]=new Option("Luxury Yachts", "9201");
category[5]=new Option("Marketing Services", "catsub5");
catid[5] = 9431;
var catsub5=new Array()
catsub5[0]=new Option("Advertising &", "3988");
catsub5[1]=new Option(" Marketing", "3988");
catsub5[2]=new Option("Direct Marketing", "2721");
catsub5[3]=new Option("Event Planners", "4070");
catsub5[4]=new Option("Graphic Design", "1636");
catsub5[5]=new Option("Market Research", "2139");
catsub5[6]=new Option("Marketing", "3301");
catsub5[7]=new Option(" Consultants", "3301");
catsub5[8]=new Option("Public Relations", "2153");
catsub5[9]=new Option("Search Engine", "9152");
catsub5[10]=new Option(" Marketing", "9152");
catsub5[11]=new Option("Web Design", "9141");
catsub5[12]=new Option("Web Marketing", "2691");
category[6]=new Option("Technology", "catsub6");
catid[6] = 9432;
var catsub6=new Array()
catsub6[0]=new Option("CRM Solutions", "2688");
catsub6[1]=new Option("Email Compliance", "9229");
catsub6[2]=new Option(" Solutions", "9229");
catsub6[3]=new Option("ERP / Accounting", "3130");
catsub6[4]=new Option(" Software", "3130");
catsub6[5]=new Option("IT Solutions", "3300");
catsub6[6]=new Option("Network Security", "8355");
catsub6[7]=new Option("Online Data Backup", "9214");
catsub6[8]=new Option("Sales Force", "1812");
catsub6[9]=new Option(" Automation", "1812");
catsub6[10]=new Option("Search Engine", "9152");
catsub6[11]=new Option(" Marketing", "9152");
catsub6[12]=new Option("Software Solutions", "1619");
catsub6[13]=new Option("VoIP", "9194");
catsub6[14]=new Option("Web Conferencing", "9199");
catsub6[15]=new Option("Web Design", "9141");
catsub6[16]=new Option("Web Hosting", "3711");
category[7]=new Option("Travel & Leisure", "catsub7");
catid[7] = 9428;
var catsub7=new Array()
catsub7[0]=new Option("Air Charter", "9196");
catsub7[1]=new Option("Extended Stay", "9241");
catsub7[2]=new Option(" Housing", "9241");
catsub7[3]=new Option("Golf Courses", "1891");
catsub7[4]=new Option("Health & Fitness", "9208");
catsub7[5]=new Option(" Spas", "9208");
catsub7[6]=new Option("Limousines", "1694");


var lintcurr=1
var larrLast = 0
var lobjOptionset=document.littlebox.baselist
		
fillOptions(catsub0, category[0].text);
createRadio(category, catid);

for (i=0; i<(category.length); i++) {
	if (predial == catid[i]) {
		fillOptions(category[i].value, category[i].text);
	}
}

function fillOptions(x, y){
	larrCurrent=eval(x)	
	larrLast=0
	var p = 0;
	document.getElementById('baseheader').innerHTML = y
	main_loop: for (q=0; q<(larrCurrent.length); q++) {
		
		if (q==0) {
		for (m=lobjOptionset.options.length-1;m>0;m--)
			lobjOptionset.options[m]=null
		}
		
		lobjOptionset.options[q]=new Option(larrCurrent[q].text,larrCurrent[q].value)

		if (lbnbreak == 'True') {
			if (larrCurrent[q].value != larrLast && isEven(p)) {
				lobjOptionset.options[q].style.backgroundColor = '#eeeeee';
			}
			if (larrCurrent[q].value == larrLast && isEven(p-1) && p > 0) {
				lobjOptionset.options[q].style.backgroundColor = '#eeeeee';
				lobjOptionset.options[q-1].style.backgroundColor = '#eeeeee';
			}
		}
		
		if (larrCurrent[q].value != larrLast){
		p = p + 1
		}
		
		lobjOptionset.options[0].selected=false;
		larrLast=larrCurrent[q].value

	}
}

function createRadio(x, y){
larrCurrent=eval(x);
larrcatid=eval(y);
if (column == 'True') {
	var splitNum = Math.round((larrCurrent.length)/2);
	document.write('<div id="radiobox" style="position: absolute;">');
	document.getElementById('radiocontainer').style.height = "0px" ;
	var lastheight;
	var lastLength;
	lastheight = 0;
	for (r=0; r<(splitNum); r++) {
		lastLength = larrCurrent[r].text.length;
		if (lastLength > 25) {
			larrCurrent_array=larrCurrent[r].text.split(" ");
			larrCurrent[r].text = larrCurrent_array[0] + " " + larrCurrent_array[1] + "..."
		}
		if (r==0 && predial == 0) {
			document.write('<input checked type="radio" tabindex="1" name="frmIndustry" value="' + y[r] + '" id="rad' + r + '" class="radio" onclick="fillOptions(' + larrCurrent[r].value + ',\'' + larrCurrent[r].text + '\')"/><label for="rad' + r + '" class="radiolabel" id="radlab' + r + '">' + larrCurrent[r].text + '</label><br />');
		} else if (predial == y[r]) {
			document.write('<input checked type="radio" tabindex="1" name="frmIndustry" value="' + y[r] + '" id="rad' + r + '" class="radio" onclick="fillOptions(' + larrCurrent[r].value + ',\'' + larrCurrent[r].text + '\')"/><label for="rad' + r + '" class="radiolabel" id="radlab' + r + '">' + larrCurrent[r].text + '</label><br />');
		} else {
			document.write('<input type="radio" tabindex="1" name="frmIndustry" value="' + y[r] + '" id="rad' + r + '" class="radio" onclick="fillOptions(' + larrCurrent[r].value + ',\'' + larrCurrent[r].text + '\')"/><label for="rad' + r + '" class="radiolabel" id="radlab' + r + '">' + larrCurrent[r].text + '</label><br />');
		}
		lastheight = lastheight + 20
		if (larrCurrent[r].text.length > 25) {
			document.getElementById('radlab' + r).style.fontFamily = "Arial Narrow" ;
		}
		}
	document.write('</div>')
	document.getElementById('radiocontainer').style.height = lastheight + "px"
	document.write('<div id="radiobox2">');
	document.getElementById('radiocontainer2').style.height = "0px" ;
	lastheight = 0;
	for (k=splitNum; k<(larrCurrent.length); k++) {
		lastLength = larrCurrent[k].text.length;
		if (lastLength > 25) {
			larrCurrent_array=larrCurrent[k].text.split(" ");
			larrCurrent[k].text = larrCurrent_array[0] + " " + larrCurrent_array[1] + "..."
		}
		if (predial == y[k]) {
			document.write('<input checked type="radio" tabindex="1" name="frmIndustry" value="' + y[k] + '" id="rad' + k + '" class="radio" onclick="fillOptions(' + larrCurrent[k].value + ',\'' + larrCurrent[k].text + '\')"/><label for="rad' + k + '" class="radiolabel" id="radlab' + k + '">' + larrCurrent[k].text + '</label><br />');
		} else {
			document.write('<input type="radio" tabindex="1" name="frmIndustry" value="' + y[k] + '" id="rad' + k + '" class="radio" onclick="fillOptions(' + larrCurrent[k].value + ',\'' + larrCurrent[k].text + '\')"/><label for="rad' + k + '" class="radiolabel" id="radlab' + k + '">' + larrCurrent[k].text + '</label><br />');
		}
		lastheight = lastheight + 20
		if (larrCurrent[k].text.length > 25) {
			document.getElementById('radlab' + k).style.fontFamily = "Arial Narrow" ;
		}
		}
	document.write('</div>')
	document.getElementById('radiocontainer2').style.height = lastheight + "px"		

} else {
	document.write('<div id="radiobox" style="position: absolute;">');
	document.getElementById('radiocontainer').style.height = "0px" ;
	var lastheight;
	var larrCurrent_array;
	var lastLength;
	lastheight = 0;
	main_loop: for (r=0; r<(larrCurrent.length); r++) {
		lastLength = larrCurrent[r].text.length;
		if (lastLength > 25) {
			larrCurrent_array=larrCurrent[r].text.split(" ");
			larrCurrent[r].text = larrCurrent_array[0] + " " + larrCurrent_array[1] + "..."
		}
		if (r==0 && predial == 0) {
			document.write('<input checked type="radio" tabindex="1" name="frmIndustry" value="' + y[r] + '" id="rad' + r + '" class="radio" onclick="fillOptions(' + larrCurrent[r].value + ',\'' + larrCurrent[r].text + '\')"/><label for="rad' + r + '" class="radiolabel" id="radlab' + r + '">' + larrCurrent[r].text + '</label><br />');
		} else if (predial == y[r]) {
			document.write('<input checked type="radio" tabindex="1" name="frmIndustry" value="' + y[r] + '" id="rad' + r + '" class="radio" onclick="fillOptions(' + larrCurrent[r].value + ',\'' + larrCurrent[r].text + '\')"/><label for="rad' + r + '" class="radiolabel" id="radlab' + r + '">' + larrCurrent[r].text + '</label><br />');
		} else {
			document.write('<input type="radio" tabindex="1" name="frmIndustry" value="' + y[r] + '" id="rad' + r + '" class="radio" onclick="fillOptions(' + larrCurrent[r].value + ',\'' + larrCurrent[r].text + '\')"/><label for="rad' + r + '" class="radiolabel" id="radlab' + r + '">' + larrCurrent[r].text + '</label><br />');
		}
		lastheight = lastheight + 20
		if (larrCurrent[r].text.length > 25) {
			document.getElementById('radlab' + r).style.fontFamily = "Arial Narrow" ;
		}
		}
	document.write('</div>')
	document.getElementById('radiocontainer').style.height = lastheight + "px"	
	}
}

function isEven(value) {
	var binary = value.toString(2);
	if (binary.charAt(binary.length - 1) == "0") {
	return false;
	}
	else {
	return true;
	}
}

