var gStateProvince = new Array("Alabama","Alaska","Alberta","American Samoa","Arizona","Arkansas","British Columbia","California","Colorado","Connecticut","Delaware","District of Columbia","Florida","Georgia","Guam","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Manitoba","Maryland","Massachusetts","Michigan","Micronesia","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Brunswick","New Hampshire","New Jersey","New Mexico","New York","Newfoundland","North Carolina","North Dakota","Northern Marianas","Northwest Territories","Nova Scotia","Nunavut","Ohio","Oklahoma","Ontario","Oregon","Pennsylvania","Prince Edward Island","Puerto Rico","Quebec","Rhode Island","Saskatchewan","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virgin Islands","Virginia","Washington","West Virginia","Wisconsin","Wyoming","Yukon");
var gStateProvinceID = new Array("1","2","51","65","3","4","52","5","6","7","8","62","9","10","67","11","12","13","14","15","16","17","18","19","53","20","21","22","66","23","24","25","26","27","28","54","29","30","31","32","55","33","34","68","56","57","64","35","36","58","37","38","59","69","60","39","61","40","41","42","43","44","45","70","46","47","48","49","50","63");
var gStateProvinceCountryID = new Array("108","108","21","108","108","108","21","108","108","108","108","108","108","108","108","108","108","108","108","108","108","108","108","108","21","108","108","108","108","108","108","108","108","108","108","21","108","108","108","108","21","108","108","108","21","21","21","108","108","21","108","108","21","108","21","108","21","108","108","108","108","108","108","108","108","108","108","108","108","21");

var gResourceCategory = new Array("Advertising Agencies", "Commercial Artists", "Database & Mailing Lists", 
"Direct Mail", "Fundraising", "Internet Marketing", "Market Research", "Promotional & Premium Items", 
"Public Relations Firms", "Telemarketing", "Duplication Services", "Equipment Rentals", "Lighting Design", 
"Lighting Equipment - Rental", "Lighting Equipment - Sales", "Production Crews / Services", 
"Recording Services", "Sound Companies", "Stereo Equipment Retail", "Car Care & Accessories", 
"Business Services", "Vehicle Manufacturers", "Trucks, SUVs & Off-Road", "Restyling & Accessories", 
"Racing & Performances", "Mobile Electronics & Technology", "Restoration, Hot Rods & Custom Cars", 
"Tools & Equipment", "Tires & Wheels", "Chassis, Suspension, & Brakes", "Engine & Transmission", 
"Antiques & Art Dealers", "Collectible Items", "Games & Toys", "Hobby Shops", "Cell Phone & Pager Rentals", 
"Equipment Rentals", "Equipment Retail", "Equipment Wholesale", "Video & Web Conferencing", 
"Wireless Mobile Products", "Computer Rentals", "Computer Storage", "Database Design", "E-Commerce", 
"Enterprise Systems / Manufacturers", "Fibre Optics", "Computer Hardware - Retail", 
"Computer Hardware - Wholesale", "Internet Service Providers - ISP", "Networking Specialists", 
"Point of Sale Systems - POS", "Programmers", "Software Products", "Training & Education", 
"Carpentry / Woodworking", "Electrical Services", "Engineering", "Exhibit Construction", 
"General Service Contractors", "Heating & Air Conditioning", "Plumbing Services", 
"Welding & Metal Working", "Education & Training Consultants", "Exhibit Design Consultants", 
"Foreign Trade Consultants", "Immigration Services", "Marketing Consultants", "Travel Consultants", 
"Amusement Places", "Animal / Pet Services", "Athletic / Sporting Goods", "Beauty Supplies / Hair Care", 
"Bridal & Marriage Services", "Child Care Facilities", "Clothing - Children", "Clothing - Men", 
"Clothing - Women", "Dinner Theatre", "Dry Cleaning Services", "Footwear - Men & Women", "Giftware Items", 
"Health Clubs", "Home Electronics", "Home Entertainment", "Jewellery & Accessories", "Religious Goods", 
"Uniforms", "Amusement & Carnival Equipment", "Awnings & Canopies", "Bags, Boxes, & Labels", "Barricades", 
"Buildings - Portable", "Cable Display Systems", "Carpet & Flooring", "Construction - Exhibits", 
"Costume Rentals", "Custom Exhibit Designers", "Electronic Displays", "Exhibits - Rental", "Exhibits - Used", 
"Fabrics - Retail / Rental", "Fasteners - Hook & Loop", "Fireworks Sales", "Fixtures - Sales & Rental", 
"Floats - Mechanical & Parade", "Furniture / Décor / Accessories", "Inflatables", 
"Installation & Dismantle Exhibits", "Modular Exhibits / Displays", "Outdoor Exhibits / Displays", 
"Packaging Products & Services", "Party Supplies", "Portable Exhibits / Displays", 
"Props - Rental & Sales", "Pyrotechnic Services", "Stage & Seating Rentals", "Storage / Warehouse Facilities", 
"Tents & Temporary Structures", "Toilets Portable - Rentals", "Tools & Equipment - Rentals", 
"Tools & Equipment - Sales", "Truss Products", "Water Walls & Columns", "Wire & Cable - Industrial", 
"Balloon Displays", "Flowers & Plants - Rental", "Flowers & Plants - Retail", "Airbrush / Commercial Artists", 
"Desktop Publishing", "Graphic Designers", "Printing Products & Services", "Reprographic Products & Services", 
"Signs & Banners", "Silk Screening Products & Services", "Dental Services", "Eyewear - Retail", 
"Fitness Equipment", "Medical Equipment", "Optometrists", "Orthodontic Services", 
"Physicians - General Practitioners", "Plastic Surgeons", "Pediatric Dental", "Arts & Craft Supplies", 
"Bath & Kitchen", "Ceramics & Glass", "Flooring & Carpet Sales", "Gardening Products & Services", 
"Hardware & Tools", "Home Furnishings & Design", "Home Improvement Centres", "Home Security Systems", 
"Housewares & Appliances", "Landscaping Service", "Lumber Supply", "Agricultural", "Aircraft Manufacturing", 
"Aviation & Aerospace", "Biotechnology", "Chemicals / Process Technology", "Defence", 
"Electronics", "Embassies & Consulates", "Energy & Power", "Environmental", "Fishing - Commercial", 
"Food Distributors", "Food Manufacturers", "Forestry", "Fossil Fuels", "Gas, Oil & Petroleum", 
"Government", "Horticulture", "Jewellery, Gems & Minerals", "Livestock", "Manufacturing Technology", 
"Medical", "Military", "Mining", "Natural Gas", "Natural Resources", "Pharmaceuticals", "Plastic & Rubber", 
"Robotics & Automation", "Science", "Textiles", "Tobacco", "Water & Water Treatment", 
"Watercraft Manufacturing", "Casino and Gaming Supplies", "Animation / Multimedia", 
"Broadcasting - Internet", "Broadcasting - Television", "Magazines - Trade", "Newspapers", 
"Printing Products & Services", "Publishing Products & Services", "Radio Stations", "Television Stations", 
"Video & DVD Production", "Video Interactive Displays", "Video Walls", "Virtual Reality", 
"Web / New Media", "Website Design & Publishing", "Distributors", "Instruments - Retail / Rental", 
"Manufacturing - Instruments", "Producers & Composers", "Production Services", "Retailers - CD's / DVD's", 
"Used Music / Trade In Shops", "Courier Services", "Duplication Services", "Fax Services", 
"Mailing & Collating Products & Services", "Office Equipment - Rental", "Office Equipment - Retail", 
"Office Equipment - Wholesale", "Office Space - Rental", "Office Supplies - Retail", "Paper Products", 
"Transcription Services", "Virtual Office Assistants", "Accounting", "Arbitration & Mediation Service", 
"Architects", "Auctioneers", "Banking & Financial Services", "Call Centers", "Chambers of Commerce", 
"Customs Brokers", "Dry Cleaning Services", "Insurance Agents & Brokers", "Interior Decorators", 
"Janitorial & Cleaning Services", "Lawyers / Legal Services", "Logistics Support Services", 
"Material Handling & Storage", "Party Planning Services", "Passport & Visa Services", "Photographers", 
"Postal Service", "Real Estate", "Registration & Lead Management Services", "Sanitation & Waste Management", 
"Sign Language Interpreter", "Survey (Land) Organizations", "Talent Agencies", "Ticket Brokers / Sellers", 
"Translators & Interpreters", "Utility Services", "Model Agencies", "Aboriginal", "American & Canadian", 
"Asian", "Bagels", "Bakery", "Barvarian", "Café", "Californian", "Cantonese", "Caribbean", 
"Caterers - All Types", "Chicken", "Chinese", "Confectionary Supplies", "Continental", "Deli, Sandwiches, Subs", 
"Donuts", "East Indian", "English", "European", "Family Dining", "Fast Food / Hamburgers", "Fondue", 
"French", "German", "Greek", "Ice Cream Parlors", "Israeli", "Japanese", "Jewish", "Korean", "Kosher", 
"Mennonite", "Mexican", "Mongolian", "Pakistani", "Pasta House", "Philippine", "Pizza Places", "Portuguese", 
"Rib Shacks", "Salvadorian", "Seafood", "Steak House", "Swiss", "Szechwan", "Tea Rooms", "Thailand", 
"Ukranian", "Vegetarian", "Vietnamese", "West Indian", "Wines / Spirits", "Irish", "Cajun", "Middle Eastern", 
"Spanish", "Cuban", "Argentinean", "Austrian", "Barbecue", "Colombian", "Czech", "Ecuadoran", "Ethiopian", 
"Filipino", "Lebanese", "Malaysian", "Moroccan", "Persian", "Peruvian", "Polish", "Polynesian", "Romanian", 
"Russian", "Scottish", "Thai", "Italian", "Armoured Car Service", "Camera (Security) Rentals & Sales", 
"Police Services", "Security Guard Services", "Security Companies", "Booth Staffing Service", 
"Event & Project Management", "Floor Management", "Hosts / Hostesses", "Hotel Management", 
"Human Resource Firms", "Lead Management / Retrieval Services", "Medical Staffing", "Personnel Agencies", 
"Secretary & Administrative Services", "Show Registration Services", "Automobile - Manufacturing", 
"Automobile - Rental & Leasing", "Buses - Charter & Rental", "Exhibit Transport", "Limousines & Chauffeurs", 
"Recreation Vehicles - Rental", "Recreation Vehicles - Sales", "Shipping & Container Services", 
"Truck / Semi Rentals", "Airline Charters", "Airlines", "Amusement Places", "Casinos", "Entertainment Spots", 
"Hotels & Resorts", "Indoor Recreation", "Outdoor Recreation", "Tourism Offices / Information", "Travel Agencies");

var gResourceCategoryID = new Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", 
"15", "16", "17", "18", "19", "466", "467", "468", "469", "470", "471", "472", "473", "474", "475", "476", "477", 
"20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "190", "191", "192", "193", 
"194", "195", "196", "197", "198", "199", "59", "60", "61", "62", "63", "64", "65", "66", "34", "35", "36", "37", 
"38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", 
"57", "58", "67", "68", "69", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "80", "81", "82", "83", 
"84", "85", "86", "87", "88", "89", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "100", "101", 
"102", "103", "104", "105", "106", "107", "108", "109", "110", "111", "112", "113", "114", "115", "116", "117", 
"118", "119", "120", "121", "479", "122", "123", "124", "125", "126", "127", "128", "129", "130", "131", "132", 
"133", "134", "135", "136", "137", "138", "139", "140", "141", "142", "143", "144", "145", "146", "147", "148", 
"149", "150", "151", "152", "153", "154", "155", "156", "157", "158", "159", "160", "161", "162", "163", "164", 
"165", "166", "167", "463", "168", "169", "170", "171", "172", "173", "174", "175", "176", "177", "178", "179", 
"180", "181", "182", "183", "184", "185", "186", "187", "188", "189", "200", "201", "202", "203", "204", "205", 
"206", "207", "208", "209", "210", "211", "212", "213", "214", "215", "216", "217", "218", "219", "220", "221", 
"222", "223", "224", "225", "226", "227", "228", "229", "230", "231", "232", "233", "234", "235", "236", "237", 
"238", "239", "465", "274", "275", "276", "277", "278", "279", "280", "281", "282", "283", "284", "285", "286", 
"287", "288", "289", "290", "291", "292", "293", "294", "295", "296", "297", "298", "299", "300", "301", "302", 
"303", "304", "305", "306", "307", "308", "309", "310", "311", "312", "313", "314", "315", "316", "317", "318", 
"319", "320", "321", "322", "323", "324", "325", "326", "395", "396", "397", "398", "399", "442", "443", "444", 
"445", "446", "447", "448", "449", "450", "451", "452", "453", "454", "455", "456", "457", "458", "459", "460", 
"478", "240", "241", "242", "243", "462", "244", "245", "246", "247", "248", "249", "250", "251", "252", "253", 
"254", "255", "256", "257", "258", "259", "260", "261", "262", "263", "264", "265", "266", "267", "268", "269", 
"270", "271", "272", "273");

var gResourceCategoryMainID = new Array("1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "2", "2", "2", "2", "2", 
"2", "2", "2", "2", "44", "44", "44", "44", "44", "44", "44", "44", "44", "44", "44", "44", "3", "3", "3", "3", 
"4", "4", "4", "4", "4", "4", "5", "5", "5", "5", "5", "5", "5", "5", "5", "5", "5", "5", "5", "5", "8", "8", 
"8", "8", "8", "8", "8", "8", "6", "6", "6", "6", "6", "6", "7", "7", "7", "7", "7", "7", "7", "7", "7", "7", 
"7", "7", "7", "7", "7", "7", "7", "7", "7", "9", "9", "9", "9", "9", "9", "9", "9", "9", "9", "9", "9", "9", 
"9", "9", "9", "9", "9", "9", "9", "9", "9", "9", "9", "9", "9", "9", "9", "9", "9", "9", "9", "9", "9", "9", 
"9", "9", "10", "10", "10", "11", "11", "11", "11", "11", "11", "11", "12", "12", "12", "12", "12", "12", "12", 
"12", "12", "13", "13", "13", "13", "13", "13", "13", "13", "13", "13", "13", "13", "14", "14", "14", "14", 
"14", "14", "14", "14", "14", "14", "14", "14", "14", "14", "14", "14", "14", "14", "14", "14", "14", "14", 
"14", "14", "14", "14", "14", "14", "14", "14", "14", "14", "14", "14", "14", "15", "15", "15", "15", "15", 
"15", "15", "15", "15", "15", "15", "15", "15", "15", "15", "16", "16", "16", "16", "16", "16", "16", "17", 
"17", "17", "17", "17", "17", "17", "17", "17", "17", "17", "17", "18", "18", "18", "18", "18", "18", "18", 
"18", "18", "18", "18", "18", "18", "18", "18", "18", "18", "18", "18", "18", "18", "18", "18", "18", "18", 
"18", "18", "18", "18", "23", "23", "23", "23", "23", "23", "23", "23", "23", "23", "23", "23", "23", "23", 
"23", "23", "23", "23", "23", "23", "23", "23", "23", "23", "23", "23", "23", "23", "23", "23", "23", "23", 
"23", "23", "23", "23", "23", "23", "23", "23", "23", "23", "23", "23", "23", "23", "23", "23", "23", "23", 
"23", "23", "23", "23", "23", "23", "23", "23", "23", "23", "23", "23", "23", "23", "23", "23", "23", "23", 
"23", "23", "23", "23", "23", "23", "23", "23", "23", "23", "19", "19", "19", "19", "19", "20", "20", "20", 
"20", "20", "20", "20", "20", "20", "20", "20", "21", "21", "21", "21", "21", "21", "21", "21", "21", "22", 
"22", "22", "22", "22", "22", "22", "22", "22", "22");

var gResourceMainCategory = new Array("Advertising & Marketing", "Audio & Visual", "Automobiles", "Automotive", 
"Books", "Business Opportunities", "Clothing & Footwear", "Collectibles, Antiques & Art", "Commercial Art", 
"Communications", "Computers & Internet", "Construction & Trades", "Consultants & Professional Services", 
"Consumer Products & Services", "Current News", "Electronics", "Engineering & Architecture", 
"Entertainment & Social Scene", "Exhibits Products & Services", "Fashion & Design", "Finance & Investment", 
"Flowers, Plants & Balloons", "Food & Beverage", "Gaming & Casinos", "Gardening & Landscaping", 
"Graphic Services", "Health & Medicine", "House & Home", "Industry & Business", "Media & Publishing", 
"Movies", "Music", "Office Products & Services", "Other / Miscellaneous", "Professional Services", 
"Real Estate", "Restaurants / Food Services", "Retail", "Security Products & Services", "Sports & Recreation", 
"Staff & Personnel", "Tradeshow Support Services", "Transportation", "Travel");
var gResourceMainCategoryID = new Array("1", "2", "24", "44", "25", "26", "40", "3", "27", "4", "5", "8", "6", 
"7", "28", "29", "30", "43", "9", "31", "39", "10", "32", "42", "33", "11", "12", "13", "14", "15", "34", 
"16", "17", "35", "18", "36", "23", "41", "19", "37", "20", "38", "21", "22");

function StateProvinceOptions(stateprov,country,selstateid)
{
	var i = 0;
	var selInd;
	var CountryID = 0;
	var Count = 0;

	selInd = 0;

	while (stateprov.options.length)
	{
		stateprov.options[0] = null;
	}

  //CountryID = country.options[country.selectedIndex].value;
  CountryID = country.value;

	var oOption = new Option("               ",0);

	AddOption(stateprov,oOption);

	for ( i = 0; i < gStateProvince.length; i++ )
	{
		if ( gStateProvinceCountryID[i] == CountryID )
		{
			Count++;
			var oOption = new Option(gStateProvince[i],gStateProvinceID[i]);
			if ( selstateid == gStateProvinceID[i] )
			{
				selInd = Count;
			}
			AddOption(stateprov,oOption); //Compatibility 5.0+
		}

	}

	if ( selstateid != 0 )
	{
		stateprov.selectedIndex = selInd;
	}
	stateprov.style.width = 125;
}

function CountryOptions(country,selcountryid)
{
	var i = 0;
	var selInd;

	selInd = 0;
		
	while (country.options.length)
	{
		country.options[0] = null;
	}

	for ( i = 0; i < gCountry.length; i++ )
	{
		var oOption = new Option(gCountry[i],gCountryID[i]);

		if ( selcountryid == gCountryID[i] )
		{
			selInd = i;
		}
		AddOption(country,oOption); //Compatibility 5.0+
	}

	if ( selcountryid != 0 )
	{
		country.selectedIndex = selInd;
	}
	else
	{
		country.selectedIndex = 0;
	}
	country.style.width = 125;
}



function CreditCardOptions(card,selcardid)
{
	var i = 0;
	var selInd = 0;

	var CardArray = new Array("Visa", "MasterCard");
	var CardArrayID = new Array("1", "2");

	while (card.options.length)
	{
		card.options[0] = null;
	}

	for ( i = 0; i < CardArray.length; i++ )
	{
		var oOption = new Option(CardArray[i],CardArrayID[i]);

		if ( selcardid == CardArrayID[i] )
		{
			selInd = i;
		}
		AddOption(card,oOption); //Compatibility 5.0+
	}

	if ( selcardid != 0 )
	{
		card.selectedIndex = selInd;
	}

	delete CardArray;

}

function PRCategoryOptions(prcategory,selcategoryid)
{
	var i = 0;
	var selInd = 0;

	var CategoryArray = new Array("Advertising & Marketing","Audio & Visual","Automobiles","Books","Business Opportunities","Clothing & Footwear","Collectibles, Antiques & Art","Commercial Art","Communications","Computers & Internet","Construction & Trades","Consultants & Professional Services","Consumer Products & Services","Current News","Electronics","Engineering & Architecture","Exhibits Products & Services","Fashion & Design","Finance & Investment","Food & Beverage","Gardening & Landscaping","Health & Medicine","House & Home","Industry & Business","Media & Publishing","Movies","Music","Office Products & Services","Other / Miscellaneous","Real Estate","Security Products & Services","Sports & Recreation","Tradeshow Support Services","Transportation","Travel");
	var CategoryArrayID = new Array("361","362","363","364","365","441","366","367","368","369","370","371","372","373","374","375","376","377","378","379","380","381","382","383","384","385","386","387","388","389","390","391","392","393","394");

	while (prcategory.options.length)
	{
		prcategory.options[0] = null;
	}

	for ( i = 0; i < CategoryArray.length; i++ )
	{
		var oOption = new Option(CategoryArray[i],CategoryArrayID[i]);
		if ( selcategoryid == CategoryArrayID[i] )
		{
			selInd = i;
		}
		AddOption(prcategory,oOption); //Compatibility 5.0+
	}

	if ( selcategoryid != 0 )
	{
		prcategory.selectedIndex = selInd;
	}

	delete CategoryArray;

}

function PRSearchCategoryOptions(dicategory,selcategoryid)
{
	var i = 0;
	var selInd = 0;

	var CategoryArray = new Array("Advertising & Marketing","Audio & Visual","Automobiles","Books","Business Opportunities","Clothing & Footwear","Collectibles, Antiques & Art","Commercial Art","Communications","Computers & Internet","Construction & Trades","Consultants & Professional Services","Consumer Products & Services","Current News","Electronics","Engineering & Architecture","Exhibits Products & Services","Fashion & Design","Finance & Investment","Food & Beverage","Gardening & Landscaping","Health & Medicine","House & Home","Industry & Business","Media & Publishing","Movies","Music","Office Products & Services","Other / Miscellaneous","Real Estate","Security Products & Services","Sports & Recreation","Tradeshow Support Services","Transportation","Travel");
	var CategoryArrayID = new Array("361","362","363","364","365","441","366","367","368","369","370","371","372","373","374","375","376","377","378","379","380","381","382","383","384","385","386","387","388","389","390","391","392","393","394");

	while (dicategory.options.length)
	{
		dicategory.options[0] = null;
	}

	var oOption = new Option("All Categories",0);

	AddOption(dicategory,oOption); //Compatibility 5.0+

	for ( i = 0; i < CategoryArray.length; i++ )
	{
		var oOption = new Option(CategoryArray[i],CategoryArrayID[i]);

		if ( selcategoryid == CategoryArrayID[i] )
		{
			selInd = i+1;
		}
		AddOption(dicategory,oOption); //Compatibility 5.0+
	}

	if ( selcategoryid != 0 )
	{
		dicategory.selectedIndex = selInd;
	}

	delete CategoryArray;

}

function DiscountCategoryOptions(dicategory,selcategoryid)
{
	var i = 0;
	var selInd = 0;

	var CategoryArray = new Array("Advertising & Marketing","Audio & Visual","Automobiles","Books","Business Opportunities","Clothing & Footwear","Collectibles, Antiques & Art","Commercial Art","Communications","Computers & Internet","Construction & Trades","Consultants & Professional Services","Consumer Products & Services","Current News","Electronics","Engineering & Architecture","Exhibits Products & Services","Fashion & Design","Finance & Investment","Food & Beverage","Gardening & Landscaping","Health & Medicine","House & Home","Industry & Business","Media & Publishing","Movies","Music","Office Products & Services","Other / Miscellaneous","Real Estate","Restaurants / Food Services","Security Products & Services","Sports & Recreation","Tradeshow Support Services","Transportation","Travel");
	var CategoryArrayID = new Array("327","328","329","330","331","440","332","333","334","335","336","337","338","339","340","341","342","343","344","345","346","347","348","349","350","351","352","353","354","355","461","356","357","358","359","360");
	while (dicategory.options.length)
	{
		dicategory.options[0] = null;
	}

	for ( i = 0; i < CategoryArray.length; i++ )
	{
		var oOption = new Option(CategoryArray[i],CategoryArrayID[i]);

		if ( selcategoryid == CategoryArrayID[i] )
		{
			selInd = i;
		}
		AddOption(dicategory,oOption); //Compatibility 5.0+
	}

	if ( selcategoryid != 0 )
	{
		dicategory.selectedIndex = selInd;
	}

	delete CategoryArray;

}

function DiscountSearchCategoryOptions(dicategory,selcategoryid)
{
	var i = 0;
	var selInd = 0;

	var CategoryArray = new Array("Advertising & Marketing","Audio & Visual","Automobiles","Books","Business Opportunities","Clothing & Footwear","Collectibles, Antiques & Art","Commercial Art","Communications","Computers & Internet","Construction & Trades","Consultants & Professional Services","Consumer Products & Services","Current News","Electronics","Engineering & Architecture","Exhibits Products & Services","Fashion & Design","Finance & Investment","Food & Beverage","Gardening & Landscaping","Health & Medicine","House & Home","Industry & Business","Media & Publishing","Movies","Music","Office Products & Services","Other / Miscellaneous","Real Estate","Restaurants / Food Services","Security Products & Services","Sports & Recreation","Tradeshow Support Services","Transportation","Travel");
	var CategoryArrayID = new Array("327","328","329","330","331","440","332","333","334","335","336","337","338","339","340","341","342","343","344","345","346","347","348","349","350","351","352","353","354","355","461","356","357","358","359","360");

	while (dicategory.options.length)
	{
		dicategory.options[0] = null;
	}

	var oOption = new Option("All Categories",0);

	AddOption(dicategory,oOption); //Compatibility 5.0+

	for ( i = 0; i < CategoryArray.length; i++ )
	{
		var oOption = new Option(CategoryArray[i],CategoryArrayID[i]);

		if ( selcategoryid == CategoryArrayID[i] )
		{
			selInd = i+1;
		}
		AddOption(dicategory,oOption); //Compatibility 5.0+
	}

	if ( selcategoryid != 0 )
	{
		dicategory.selectedIndex = selInd;
	}

	delete CategoryArray;

}

function ContactTypeOptions(contacttype,seltypeid)
{
	var i = 0;
	var selInd = 0;

	var TypeArray = new Array("Administrative Assistant","Administrator","Association Manager","Chief Executive Officer (CEO)","Communications Manager","Corporate Sales Director","Director","Executive Chef","Executive Director","Executive Vice President","Exhibit Sales Manager","General Manager","Human Resource Manager","IT Manager","Manager","Managing Director","Marketing Manager","Meeting Coordinator","Meeting Manager","Meeting Planner","Officer of Corporation","Organizer","Other","Owner","President","Project Manager","Promoter","Public Relations Coordinator","Restaurant Manager","Sales Manager","Show Director","Show Manager","Vice President","Vice President of Sales");
	var TypeArrayID = new Array("1","2","3","4","5","6","7","33","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","34","28","29","30","31","32");

	while (contacttype.options.length)
	{
		country.options[0] = null;
	}

	var oOption = new Option("               ",0);
	AddOption(contacttype,oOption); //Compatibility 5.0+

	for ( i = 0; i < TypeArray.length; i++ )
	{
		var oOption = new Option(TypeArray[i],TypeArrayID[i]);

		if ( seltypeid == TypeArrayID[i] )
		{
			selInd = i+1;
		}
		AddOption(contacttype,oOption); //Compatibility 5.0+
	}

	if ( seltypeid != 0 )
	{
		contacttype.selectedIndex = selInd;
	}

	delete TypeArray;
	contacttype.style.width = 150;
}

function UserTypeOptions(ustype,seltypeid)
{
	var i = 0;
	var selInd = 0;

	var TypeArray = new Array("Associate","Developer","Administrator","Data Entry","Account Executive","Tester","Customer Service","In House Associate","Accounting");
	var TypeArrayID = new Array("1","2","3","4","5","6","7","8","9");

	while (ustype.options.length)
	{
		ustype.options[0] = null;
	}

	var oOption = new Option("               ",0);
	AddOption(ustype,oOption); //Compatibility 5.0+

	for ( i = 0; i < TypeArray.length; i++ )
	{
		var oOption = new Option(TypeArray[i],TypeArrayID[i]);

		if ( seltypeid == TypeArrayID[i] )
		{
			selInd = i+1;
		}
		AddOption(ustype,oOption); //Compatibility 5.0+
	}

	if ( seltypeid != 0 )
	{
		ustype.selectedIndex = selInd;
	}

	delete TypeArray;

}

function ProfanityLevelOptions(profanitytype,seltypeid)
{
	var i = 0;
	var selInd = 0;

	var TypeArray = new Array("No Post","Review Before Post");
	var TypeArrayID = new Array("1","2");

	while (profanitytype.options.length)
	{
		profanitytype.options[0] = null;
	}

	var oOption = new Option("               ",0);
	AddOption(profanitytype,oOption); //Compatibility 5.0+

	for ( i = 0; i < TypeArray.length; i++ )
	{
		var oOption = new Option(TypeArray[i],TypeArrayID[i]);

		if ( seltypeid == TypeArrayID[i] )
		{
			selInd = i+1;
		}
		AddOption(profanitytype,oOption); //Compatibility 5.0+
	}

	if ( seltypeid != 0 )
	{
		profanitytype.selectedIndex = selInd;
	}

	delete TypeArray;

}

function ListingTypeOptions(listtype,seltypeid)
{
	var i = 0;
	var selInd = 0;

	var TypeArray = new Array("Facilities","Events","Resources","Discounts","Press Releases");
	var TypeArrayID = new Array("1","2","3","4","5");

	while (listtype.options.length)
	{
		listtype.options[0] = null;
	}

	var oOption = new Option("               ",0);
	AddOption(listtype,oOption); //Compatibility 5.0+

	for ( i = 0; i < TypeArray.length; i++ )
	{
		var oOption = new Option(TypeArray[i],TypeArrayID[i]);

		if ( seltypeid == TypeArrayID[i] )
		{
			selInd = i+1;
		}
		AddOption(listtype,oOption); //Compatibility 5.0+
	}

	if ( seltypeid != 0 )
	{
		listtype.selectedIndex = selInd;
	}

	delete TypeArray;

}

function ListingReviewMsgOptions(listtype,seltypeid)
{
	var i = 0;
	var selInd = 0;

	var TypeArray = new Array("Profanity","Pornography","Explicit Content","Racial / Religious Descrimination","Other");
	var TypeArrayID = new Array("R001","R002","R003","R004","R005");

	while (listtype.options.length)
	{
		listtype.options[0] = null;
	}

	var oOption = new Option("               ",0);
	AddOption(listtype,oOption); //Compatibility 5.0+

	for ( i = 0; i < TypeArray.length; i++ )
	{
		var oOption = new Option(TypeArray[i],TypeArrayID[i]);

		if ( seltypeid == TypeArrayID[i] )
		{
			selInd = i+1;
		}
		AddOption(listtype,oOption); //Compatibility 5.0+
	}

	if ( seltypeid != 0 )
	{
		listtype.selectedIndex = selInd;
	}

	delete TypeArray;

}

function CuisineOptions(cuisine,selcuisineid)
{
	var i = 0;
	var selInd = 0;

	var CuisineArray = new Array("Aborginal","American & Canadian","Asian","Bagels","Bakery","Barvarian","Café","Californian","Cantonese","Caribbean","Caterers - All Types","Chicken","Chinese","Confectionary Supplies","Continental","Deli, Sandwiches, Subs","Donuts","East Indian","English","European","Family Dining","Fast Food / Hamburgers","Fondue","French","German","Greek","Ice Cream Parlors","Israeli","Japanese","Jewish","Korean","Kosher","Mennonite","Mexican","Mongolian","Pakistani","Pasta House","Philippine","Pizza Places","Portuguese","Rib Shacks","Salvadorian","Seafood","Steak House","Swiss","Szechwan","Tea Rooms","Thailand","Ukranian","Vegetarian","Vietnamese","West Indian","Wines / Spirits","Irish","Cajun","Middle Eastern","Spanish","Cuban","Argentinean","Austrian","Barbecue","Colombian","Czech","Ecuadoran","Ethiopian","Filipino","Lebanese","Malaysian","Moroccan","Persian","Peruvian","Polish","Polynesian","Romanian","Russian","Scottish","Thai");
	var CuisineArrayID = new Array("274","275","276","277","278","279","280","281","282","283","284","285","286","287","288","289","290","291","292","293","294","295","296","297","298","299","300","301","302","303","304","305","306","307","308","309","310","311","312","313","314","315","316","317","318","319","320","321","322","323","324","325","326","395","396","397","398","399","442","443","444","445","446","447","448","449","450","451","452","453","454","455","456","457","458","459","460");

	while (cuisine.options.length)
	{
		cuisine.options[0] = null;
	}

	var oOption = new Option("All types", 0);
	AddOption(cuisine,oOption); //Compatibility 5.0+

	for ( i = 0; i < CuisineArray.length; i++ )
	{
		var oOption = new Option(CuisineArray[i],CuisineArrayID[i]);

		if ( selcuisineid == CuisineArrayID[i] )
		{
			selInd = i + 1;
		}
		AddOption(cuisine,oOption); //Compatibility 5.0+
	}

	if ( selcuisineid != 0 )
	{
		cuisine.selectedIndex = selInd;
	}

	delete CuisineArray;

}

//Event Functions
function SearchEventTypeOptions(eventtype,seleventtypeid)
{
	var i = 0;
	var selInd = 0;
	var EventTypeArray = new Array("Concert","Conference","Congress","Convention","Exhibition","Exposition","Fair/Festival","Meeting","Performance","Play","Seminar","Show","Symposium","Tradeshow");
	var EventTypeArrayID = new Array("1","2","3","4","5","6","7","8","9","10","11","12","13","14");

	while (eventtype.options.length)
	{
		eventtype.options[0] = null;
	}

	var oOption = new Option("All Events",0);

	AddOption(eventtype,oOption); //Compatibility 5.0+

	for ( i = 0; i < EventTypeArray.length; i++ )
	{
		var oOption = new Option(EventTypeArray[i],EventTypeArrayID[i]);
		oOption.text = EventTypeArray[i];
		oOption.value = EventTypeArrayID[i];
		if ( seleventtypeid == EventTypeArrayID[i] )
		{
			selInd = i+1;
		}
		AddOption(eventtype,oOption); //Compatibility 5.0+
	}

	if ( seleventtypeid != 0 )
	{
		eventtype.selectedIndex = selInd;
	}

	delete EventTypeArray;

}

function ScopeOptions(scope,selscopeid)
{
	var i = 0;
	var selInd = 0;

	var ScopeArray = new Array("International","National","Regional","Local");
	var ScopeArrayID = new Array("1","2","3","4");

	while (scope.options.length)
	{
		scope.options[0] = null;
	}

	var oOption = new Option("                ",0);
	AddOption(scope,oOption); //Compatibility 5.0+

	for ( i = 0; i < ScopeArray.length; i++ )
	{
		var oOption = new Option(ScopeArray[i],ScopeArrayID[i]);
		if ( selscopeid == ScopeArrayID[i] )
		{
			selInd = i+1;
		}
		AddOption(scope,oOption); //Compatibility 5.0+
	}

	if ( selscopeid != 0 )
	{
		scope.selectedIndex = selInd;
	}

	delete ScopeArray;

}

function NumAttendeesOptions(numattendees,selnumattendeesid)
{
	var i = 0;
	var selInd = 0;
	var AttendeesArray = new Array("Under 500 people","501 - 1000 people","1001 - 2000 people","2001 - 5000 people","5001 - 10,000 people","over 10,000 people");
	
	while (numattendees.options.length)
	{
		numattendees.options[0] = null;
	}

	var oOption = new Option("                ",0);
	AddOption(numattendees,oOption); //Compatibility 5.0+

	for ( i = 1; i <= AttendeesArray.length; i++ )
	{
		var oOption = new Option(AttendeesArray[i],i);
		if ( selnumattendeesid == i )
		{
			selInd = i;
		}
		AddOption(numattendees,oOption); //Compatibility 5.0+
	}

	if ( selnumattendeesid != 0 )
	{
		numattendees.selectedIndex = selInd;
	}

	delete AttendeesArray;

}

function NumExhibitorsOptions(numexhibitors,selnumexhibitorsid)
{
	var i = 0;
	var selInd = 0;
	var ExhibitorsArray = new Array("Under 25 exhibitors","26 - 50  exhibitors","51 - 100 exhibitors","100 - 500 exhibitors","over 500 exhibitors");
		
	while (numexhibitors.options.length)
	{
		numexhibitors.options[0] = null;
	}

	var oOption = new Option("                ",0);
	AddOption(numexhibitors,oOption); //Compatibility 5.0+

	for ( i = 1; i <= ExhibitorsArray.length; i++ )
	{
		var oOption = new Option(ExhibitorsArray[i],i);
		if ( selnumexhibitorsid == i )
		{
			selInd = i;
		}
		AddOption(numexhibitors,oOption); //Compatibility 5.0+
	}

	if ( selnumexhibitorsid != 0 )
	{
		numexhibitors.selectedIndex = selInd;
	}

	delete ExhibitorsArray;

}

function OpenToOptions(opento,selopentoid)
{
	var i = 0;
	var selInd = 0;

	var OpenToArray = new Array("Businesses","Consultants","General Public / Consumers","Entire Industry","Members Only","Trade Professionals","Traders","Wholesalers","Businesses & Consumers","Manufacturers","Retailers");
	var OpenToArrayID = new Array("1","2","3","4","5","6","7","8","9","10","11");

	while (opento.options.length)
	{
		opento.options[0] = null;
	}

	var oOption = new Option("                ",0);
	AddOption(opento,oOption); //Compatibility 5.0+

	for ( i = 1; i < OpenToArray.length; i++ )
	{
		var oOption = new Option(OpenToArray[i],OpenToArrayID[i]);

		if ( selopentoid == OpenToArrayID[i] )
		{
			selInd = i;
		}
		AddOption(opento,oOption); //Compatibility 5.0+
	}

	if ( selopentoid != 0 )
	{
		opento.selectedIndex = selInd;
	}

	delete OpenToArray;

}

function AddEventTypeOptions(eventtype,seleventtypeid)
{
	var i = 0;
	var selInd = 0;

	var EventTypeArray = new Array("Concert","Conference","Congress","Convention","Exhibition","Exposition","Fair/Festival","Meeting","Performance","Play","Seminar","Show","Symposium","Tradeshow");
	var EventTypeArrayID = new Array("1","2","3","4","5","6","7","8","9","10","11","12","13","14");

	while (eventtype.options.length)
	{
		eventtype.options[0] = null;
	}

	for ( i = 0; i < EventTypeArray.length; i++ )
	{
		var oOption = new Option(EventTypeArray[i],EventTypeArrayID[i]);

		if ( seleventtypeid == EventTypeArrayID[i] )
		{
			selInd = i;
		}
		AddOption(eventtype,oOption); //Compatibility 5.0+
	}

	if ( seleventtypeid != 0 )
	{
		eventtype.selectedIndex = selInd;
	}

	delete EventTypeArray;

}

function EventCategoryOptions(eventcategory,seleventcategoryid)
{
	var i = 0;
	var selInd = 0;

	var EventCategoryArray = new Array("Advertising & Marketing","Audio & Visual","Automobiles","Books","Business Opportunities","Collectibles, Antiques & Art","Commercial Art","Communications","Computers & Internet","Construction & Trades","Consultants & Professional Services","Consumer Products & Services","Current News","Electronics","Engineering & Architecture","Exhibits Products & Services","Fashion & Design","Finance & Investment","Flowers, Plants & Balloons","Food & Beverage","Gardening & Landscaping","Graphic Services","Health & Medicine","House & Home","Industry & Business","Media & Publishing","Movies","Music","Office Products & Services","Other / Miscellaneous","Professional Services","Real Estate","Restaurants / Food Services","Retail","Security Products & Services","Sports & Recreation","Staff & Personnel","Tradeshow Support Services","Transportation","Travel");
	var EventCategoryArrayID = new Array("400","401","423","424","425","402","426","403","404","407","405","406","427","428","429","408","430","438","409","431","432","410","411","412","413","414","433","415","416","434","417","435","422","464","418","436","419","437","420","421");

	while (eventcategory.options.length)
	{
		eventcategory.options[0] = null;
	}

	for ( i = 0; i < EventCategoryArray.length; i++ )
	{
		var oOption = new Option(EventCategoryArray[i],EventCategoryArrayID[i]);

		if ( seleventcategoryid == EventCategoryArrayID[i] )
		{
			selInd = i;
		}
		AddOption(eventcategory,oOption); //Compatibility 5.0+
	}

	if ( seleventcategoryid != 0 )
	{
		eventcategory.selectedIndex = selInd;
	}

	delete EventCategoryArray;

}

function SearchEventCategoryOptions(eventcategory,seleventcategoryid)
{
	var i = 0;
	var selInd = 0;

	var EventCategoryArray = new Array("Advertising & Marketing","Audio & Visual","Automobiles","Books","Business Opportunities","Collectibles, Antiques & Art","Commercial Art","Communications","Computers & Internet","Construction & Trades","Consultants & Professional Services","Consumer Products & Services","Current News","Electronics","Engineering & Architecture","Exhibits Products & Services","Fashion & Design","Finance & Investment","Flowers, Plants & Balloons","Food & Beverage","Gardening & Landscaping","Graphic Services","Health & Medicine","House & Home","Industry & Business","Media & Publishing","Movies","Music","Office Products & Services","Other / Miscellaneous","Professional Services","Real Estate","Restaurants / Food Services","Retail","Security Products & Services","Sports & Recreation","Staff & Personnel","Tradeshow Support Services","Transportation","Travel");
	var EventCategoryArrayID = new Array("400","401","423","424","425","402","426","403","404","407","405","406","427","428","429","408","430","438","409","431","432","410","411","412","413","414","433","415","416","434","417","435","422","464","418","436","419","437","420","421");

	while (eventcategory.options.length)
	{
		eventcategory.options[0] = null;
	}

	var oOption = new Option("All Categories",0);

	AddOption(eventcategory,oOption); //Compatibility 5.0+

	for ( i = 0; i < EventCategoryArray.length; i++ )
	{
		var oOption = new Option(EventCategoryArray[i],EventCategoryArrayID[i]);

		if ( seleventcategoryid == EventCategoryArrayID[i] )
		{
			selInd = i + 1;
		}
		AddOption(eventcategory,oOption); //Compatibility 5.0+
	}

	if ( seleventcategoryid != 0 )
	{
		eventcategory.selectedIndex = selInd;
	}

	delete EventCategoryArray;

}

function FrequencyOptions(frequency,selfrequencyid)
{
	var i = 0;
	var selInd = 0;

	var FrequencyArray = new Array("Annual","Semi-Annual","Quarterly","Monthly","Weekly","Once","Other");
	var FrequencyArrayID = new Array("1","2","3","4","5","6","7");

	while (frequency.options.length)
	{
		frequency.options[0] = null;
	}

	var oOption = new Option("                ",0);
	AddOption(frequency,oOption); //Compatibility 5.0+

	for ( i = 0; i < FrequencyArray.length; i++ )
	{
		var oOption = new Option(FrequencyArray[i],FrequencyArrayID[i]);

		if ( selfrequencyid == FrequencyArrayID[i] )
		{
			selInd = i+1;
		}
		AddOption(frequency,oOption); //Compatibility 5.0+
	}

	if ( selfrequencyid != 0 )
	{
		frequency.selectedIndex = selInd;
	}

	delete FrequencyArray;

}

//Facility Functions
function SearchFacilityTypeOptions(facilitytype,selfacilitytypeid)
{
	var i = 0;
	var selInd = 0;
	var FacilityTypeArray = new Array("Arena / Stadium / Athletic Field", "Auditorium / Hall / Convention Complex", "Concert Hall / Theater / Night Club", "Cruise Ship / Yacht", "Fishing / Hunting / Ski Lodge", "Golf Course / Country Club", "Hotel / Resort / Club", "Museum / Art Gallery / Library", "Other", "Park / Camp / Rural Retreat", "University / College")
	var FacilityTypeArrayID = new Array("1", "2", "3", "5", "21", "12", "7", "8", "11", "14", "10")


	while (facilitytype.options.length)
	{
		facilitytype.options[0] = null;
	}

	var oOption = new Option("All Facilities",0);
	AddOption(facilitytype,oOption); //Compatibility 5.0+

	for ( i = 0; i < FacilityTypeArray.length; i++ )
	{
		var oOption = new Option(FacilityTypeArray[i],FacilityTypeArrayID[i]);
	
		if ( selfacilitytypeid == FacilityTypeArrayID[i] )
		{
			selInd = i+1;
		}
		AddOption(facilitytype,oOption); //Compatibility 5.0+
	}

	if ( selfacilitytypeid != 0 )
	{
		facilitytype.selectedIndex = selInd;
	}

	delete FacilityTypeArray;

}

function AddFacilityTypeOptions(facilitytype,selfacilitytypeid)
{
	var i = 0;
	var selInd = 0;
	//var FacilityTypeArray = new Array("Arena","Auditorium / Hall","Casino","Concert Hall / Theater","Convention Center","Cruise Ship","Exhibition Center","Golf Courses / Country Clubs","Hotel / Resort","Museum / Art Gallery","Other","Parks & Camps","Stadium / Ball Park","University / College");
	//var FacilityTypeArrayID = new Array("1","2","13","3","4","5","6","12","7","8","11","14","9","10");
	var FacilityTypeArray = new Array("Arena / Stadium / Athletic Field", "Auditorium / Hall / Convention Complex", "Concert Hall / Theater / Night Club", "Cruise Ship / Yacht", "Fishing / Hunting / Ski Lodge", "Golf Course / Country Club", "Hotel / Resort / Club", "Museum / Art Gallery / Library", "Other", "Park / Camp / Rural Retreat", "University / College")
	var FacilityTypeArrayID = new Array("1", "2", "3", "5", "21", "12", "7", "8", "11", "14", "10")


	while (facilitytype.options.length)
	{
		facilitytype.options[0] = null;
	}

	for ( i = 0; i < FacilityTypeArray.length; i++ )
	{
		var oOption = new Option(FacilityTypeArray[i],FacilityTypeArrayID[i]);
		if ( selfacilitytypeid == FacilityTypeArrayID[i] )
		{
			selInd = i;
		}
		AddOption(facilitytype,oOption); //Compatibility 5.0+
	}

	if ( selfacilitytypeid != 0 )
	{
		facilitytype.selectedIndex = selInd;
	}

	delete FacilityTypeArray;

}

function TotalSqftAreaOptions(sqftarea,selsqftareaid)
{
	var i = 0;
	var selInd = 0;
	var SqftAreaArray = new Array("Under 1,000 Square Feet","1,001 - 5,000 Square Feet","5,001 - 10,000 Square Feet","10,001 - 25,000 Square Feet","25,001 - 50,000 Square Feet","50,001 - 100,000 Square Feet","100,000+ Square Feet");
	
	while (sqftarea.options.length)
	{
		sqftarea.options[0] = null;
	}

	var oOption = new Option("Any Size",0);
	AddOption(sqftarea,oOption); //Compatibility 5.0+

	for ( i = 0; i < SqftAreaArray.length; i++ )
	{
		var oOption = new Option(SqftAreaArray[i],i+1);

		if ( selsqftareaid == i+1 )
		{
			selInd = i+1;
		}
		AddOption(sqftarea,oOption); //Compatibility 5.0+
	}

	if ( selsqftareaid != 0 )
	{
		sqftarea.selectedIndex = selInd;
	}

	delete SqftAreaArray;

}

function SeatingCapacityOptions(seatingcapacity,selseatingcapacityid)
{
	var i = 0;
	var selInd = 0;
	var SeatingCapacityArray = new Array("Under 500 People","501 - 2,500 People","2,501 - 7,500 People","7,501 - 15,000 People","15,001 - 30,000 People","30,000 - 75,000 People","75,000+ People");
		
	while (seatingcapacity.options.length)
	{
		seatingcapacity.options[0] = null;
	}

	var oOption = new Option("Any Capacity",0);
	AddOption(seatingcapacity,oOption); //Compatibility 5.0+

	for ( i = 0; i < SeatingCapacityArray.length; i++ )
	{
		var oOption = new Option(SeatingCapacityArray[i],i+1);

		if ( selseatingcapacityid == i+1 )
		{
			selInd = i+1;
		}
		AddOption(seatingcapacity,oOption); //Compatibility 5.0+
	}

	if ( selseatingcapacityid != 0 )
	{
		seatingcapacity.selectedIndex = selInd;
	}

	delete SeatingCapacityArray;

}

//Supplier functions
function ResourceCategoryOptions(resource,categoryID,selresourceid)
{
	var i = 0;
	var selInd;
	var Count = 0;

	selInd = 0;

	while (resource.options.length)
	{
		resource.options[0] = null;
	}

	var oOption = new Option("Select...",0);
	AddOption(resource,oOption); //Compatibility 5.0+

	for ( i = 0; i < gResourceCategory.length; i++ )
	{
		if ( gResourceCategoryMainID[i] == categoryID )
		{
			Count++;
			var oOption = new Option(gResourceCategory[i],gResourceCategoryID[i]);
			if ( selresourceid == gResourceCategoryID[i] )
			{
				selInd = Count;
			}
			AddOption(resource,oOption); //Compatibility 5.0+
		}

	}

	if ( selresourceid != 0 )
	{
		resource.selectedIndex = selInd;
	}

	resource.style.pixelWidth = 180;
}

function ResourceMainCategoryOptions(resource,selresourceid)
{
	var i = 0;
	var selInd;

	selInd = 0;

	while (resource.options.length)
	{
		resource.options[0] = null;
	}

	for ( i = 0; i < gResourceMainCategory.length; i++ )
	{
		var oOption = new Option(gResourceMainCategory[i],gResourceMainCategoryID[i]);

		if ( selresourceid == gResourceMainCategoryID[i] )
		{
			selInd = i;
		}
		AddOption(resource,oOption); //Compatibility 5.0+
	}

	if ( selresourceid != 0 )
	{
		resource.selectedIndex = selInd;
	}

	resource.style.pixelWidth = 180;

}

function FillResourceCategoryOptions()
{
	ResourceCategoryOptions(getObjectName('Cat1'),1,0);
getObjectName('Cat1').style.pixelWidth = 235;
	ResourceCategoryOptions(getObjectName('Cat2'),2,0);
getObjectName('Cat2').style.pixelWidth = 235;
	ResourceCategoryOptions(getObjectName('Cat3'),3,0);
getObjectName('Cat3').style.pixelWidth = 235;
	ResourceCategoryOptions(getObjectName('Cat4'),4,0);
getObjectName('Cat4').style.pixelWidth = 235;
	ResourceCategoryOptions(getObjectName('Cat5'),5,0);
getObjectName('Cat5').style.pixelWidth = 235;
	ResourceCategoryOptions(getObjectName('Cat8'),8,0);
getObjectName('Cat8').style.pixelWidth = 235;
	ResourceCategoryOptions(getObjectName('Cat6'),6,0);
getObjectName('Cat6').style.pixelWidth = 235;
	ResourceCategoryOptions(getObjectName('Cat7'),7,0);
getObjectName('Cat7').style.pixelWidth = 235;
	ResourceCategoryOptions(getObjectName('Cat9'),9,0);
getObjectName('Cat9').style.pixelWidth = 235;
	ResourceCategoryOptions(getObjectName('Cat10'),10,0);
getObjectName('Cat10').style.pixelWidth = 235;
	ResourceCategoryOptions(getObjectName('Cat11'),11,0);
getObjectName('Cat11').style.pixelWidth = 235;
	ResourceCategoryOptions(getObjectName('Cat12'),12,0);
getObjectName('Cat12').style.pixelWidth = 235;
	ResourceCategoryOptions(getObjectName('Cat13'),13,0);
getObjectName('Cat13').style.pixelWidth = 235;
	ResourceCategoryOptions(getObjectName('Cat14'),14,0);
getObjectName('Cat14').style.pixelWidth = 235;
	ResourceCategoryOptions(getObjectName('Cat15'),15,0);
getObjectName('Cat15').style.pixelWidth = 235;
	ResourceCategoryOptions(getObjectName('Cat16'),16,0);
getObjectName('Cat16').style.pixelWidth = 235;
	ResourceCategoryOptions(getObjectName('Cat17'),17,0);
getObjectName('Cat17').style.pixelWidth = 235;
	ResourceCategoryOptions(getObjectName('Cat18'),18,0);
getObjectName('Cat18').style.pixelWidth = 235;
	ResourceCategoryOptions(getObjectName('Cat23'),23,0);
getObjectName('Cat23').style.pixelWidth = 235;
	ResourceCategoryOptions(getObjectName('Cat19'),19,0);
getObjectName('Cat19').style.pixelWidth = 235;
	ResourceCategoryOptions(getObjectName('Cat20'),20,0);
getObjectName('Cat20').style.pixelWidth = 235;
	ResourceCategoryOptions(getObjectName('Cat21'),21,0);
getObjectName('Cat21').style.pixelWidth = 235;
	ResourceCategoryOptions(getObjectName('Cat22'),22,0);
getObjectName('Cat22').style.pixelWidth = 235;


}

function AddResourceCategory(recategory,resubcategory,rescategorylist,limit)
{
	var bsentry = true;
	var xoption;
	var i;

	if (resubcategory.selectedIndex > 0)
	{
		if ( limit > rescategorylist.options.length )
		{
			if ( rescategorylist.options.length > 0 )
			{
				for (i = 0; i < rescategorylist.options.length; i++)
				{
					if (rescategorylist.options[i].value == resubcategory.options[resubcategory.selectedIndex].value)
					{
						bsentry = false;
						alert("Category already added!");
					}
				}
			}

			if ( bsentry )
			{
				var oOption = new Option(resubcategory.options[resubcategory.selectedIndex].text,resubcategory.options[resubcategory.selectedIndex].value);
				AddOption(rescategorylist,oOption); //Compatibility 5.0+
			}
		}
		else
		{
			alert("You may select up to " + limit.toString() + " categories only.");
		}

	}

}

function RemoveResourceCategory(rescategorylist)
{

	if ( rescategorylist.options.length > 0 && rescategorylist.selectedIndex >= 0 )
	{
		rescategorylist.options[rescategorylist.selectedIndex] = null;
		alert("Category removed!");
	}

}

function AddOption(objselect,objoption)
{

	if(is.ie)
		objselect.add(objoption);
	else if (is.ns4||is.ns4up||is.ns4only)
		objselect.options[objselect.options.length] = objoption;
	else if (is.nav)
		objselect.add(objoption,objselect.options[objselect.options.length]);
	else
		objselect.add(objoption);

}

function selectall(selectlist)
{
	var i

	if ( selectlist.options.length )
	{
		for (i = 0; i < selectlist.options.length; i++)
		{
			selectlist.options[i].selected = true;
		}
	}

}

function deselectallcheckboxes(selectlist)
{
	var i

	if ( selectlist.length )
	{
		for (i = 0; i < selectlist.length; i++)
		{
			selectlist[i].checked = false;
		}
	}

}

function textareacounter(textarea,display,maxlength)
{

	var eleDisplay = getObjectName(display);
	var eleTextArea = getObjectName(textarea);
	
	if (eleTextArea.value.length > maxlength)
	{
		event.returnValue = false;
		eleTextArea.value = eleTextArea.value.slice(0,maxlength);
	}

	eleDisplay.innerText = eleTextArea.value.length + ' characters ( max. ' + maxlength + ' characters )';

}

function selectOptionFromList(list, val)
{
	if (val >= 0)
	{
		for (var i = 0; i < list.options.length; i++)
		{
			if (list.options[i].value == val)
			{
				list.selectedIndex = i;
				break;
			}
		}
	}
}

