function loadFunction(root,tips) {
	
	if (root==undefined) {root='';}
	document.getElementById("mainmenu").innerHTML='<ul><li class="color1"><a href="' + root + 'aboutus/index.htm">About Us</a></li><li class="color2"><a href="' + root + 'homeowners/index.htm">Homeowners & Property Owners</a><ul><li><a href="' + root + 'homeowners/do-i-need-a-permit/index.htm">Do I need a permit?</a></li><li><a href="' + root + 'homeowners/how-do-i-get-a-permit/index.htm">How do I get a permit?</a></li><li><a href="' + root + 'homeowners/permit-inspection-process/index.htm">Permit inspection process</a></li><li><a href="' + root + 'homeowners/project-planning-tips-and-resources/index.htm">Project planning tips and resources</a></li><li><a href="' + root + 'homeowners/finding-and-managing-a-contractor/index.htm">Finding and managing a contractor</a></li><li><a href="' + root + 'homeowners/informational-material/index.htm">Informational material</a></li><li><a href="' + root + 'homeowners/what-do-you-need-to-get-a-permit/index.htm">What do you need to get a permit?</a></li><li><a href="' + root + 'homeowners/remodeling-go-green/index.htm">Remodeling...Go green</a></li><li><a href="' + root + 'homeowners/dispute-resolution-services/index.htm">Dispute resolution services</a></li><li><a href="' + root + 'homeowners/contacts/index.htm">City & County Contacts</a></li></ul></li><li class="color3"><a href="' + root + 'contractors/index.htm">Contractors</a></li><li class="color4"><a href="' + root + 'cities/index.htm">Cities & Counties</a></li></ul>';
	document.getElementById("quicklinks_rap").innerHTML='<div id="quicklinks"><ul><li><a href="' + root + 'homeowners/do-i-need-a-permit/index.htm">Do I need a permit?</a></li><li><a href="' + root + 'homeowners/how-do-i-get-a-permit/index.htm">How do I get a permit?</a></li><li><a href="http://www4.cbs.state.or.us/ex/bcd/juris_lookup/index.cfm?fuseaction=lookup.reset">Find my local building department</a></li><li><a href="http://www.bcd.oregon.gov/Consumer_Assistance.html#check">Check a contractor&rsquo;s license</a></li><li><a href="http://www.oregon-epermitting.info/contractors.html">ePermits for contractors</a></li><li><a href="http://www.oregon-epermitting.info/public.html">ePermits for property owners</a></li><li><a href="http://www.bcd.oregon.gov/forms/forms_by_title.html">Forms for contractors</a></li></ul></div>';
	document.getElementById("footer").innerHTML='<p><a href="' + root + 'aboutus/index.htm">Contact Us</a> | <a href="http://www.bcd.oregon.gov/">Building Codes Division</a> | <a href="' + root + 'sitemap.htm">Site Map</a></p>';
	document.getElementById("header").innerHTML='<a href="' + root + 'index.htm" id="header_link"></a>';
	greentips(root,tips);

	}
	
function subdisplay(num) {

	if (document.getElementById('item' + num).style.display=='inline') {
		document.getElementById('item' + num).style.display='none';
		str=document.getElementById('arrow' + num).src;
		str=str.replace("arrow-d","arrow-r");
		document.getElementById('arrow' + num).src=str;
	} else {
		document.getElementById('item' + num).style.display='inline';
		str=document.getElementById('arrow' + num).src;
		str=str.replace("arrow-r","arrow-d");
		document.getElementById('arrow' + num).src=str;
	}

}

function greentips(root,tips) {

// Creates arrays & assigns random category

	var html = new Array();	
	var categories = new Array("money","energy","water","safety");
	var randomcategory = Math.floor(Math.random()*categories.length);
	var tip = new Array(categories.length);
	for (i=0; i< categories.length; i++) tip[i] = new Array();
	
// Money Tips

	html[0] = '<h1>Money Saving Tips</h1><p><img src="' + root + 'images/pp_house_icon_dollar.jpg" />';
	tip[0][0] = 'Timing your home improvement projects to coincide with slow periods for contractors, between New Year&rsquo;s and March, can save between 4.5 and 5.5% in the total cost of a remodel.';
	tip[0][1] = 'Install exterior doors that are better insulated and more secure.';
	tip[0][2] = "Investigate and claim all available state and local government tax credits, exemptions, rebates and financing offers when using energy-efficient materials.";
	tip[0][3] = "Plan ahead and add extra phone lines, Ethernet connections, cable TV hook-ups, additional switches and outlets before walls are closed and wiring becomes inaccessible.";
	tip[0][4] = "A rain check gauge on your automatic sprinkler system could save you hundreds of dollars through reduced water usage over two to three years.";
	tip[0][5] = "Use structural elements, like interior brick walls, ceiling beams and concrete floors, as finished surfaces since it is cheaper to refinish these surfaces than building up new finish surfaces.";
	tip[0][6] = "Be sure to check under a corner of your own carpet before buying expensive supplies or hiring contractors in case the original hard wood floors are candidates for refurbishing.";
	tip[0][7] = "Look for a less expensive alternative in wood products to achieve your desired look, like a fast-growing eucalyptus hybrid that looks and feels remarkably like pricier mahogany.";
	tip[0][8] = "If you are looking for an economical way to remodel your kitchen, think about replacing the hardware and refinishing or repainting the cabinets to give the room a whole new look.";
	tip[0][9] = "Choosing a remodeling plan without unnecessary angles will reduce your costs.";
	tip[0][10] = "Lighting is less expensive than a full remodeling project and goes a long way in brightening and updating a room.";
	tip[0][11] = "Obtain permits because property insurers may not cover work done without them. If you decide to sell a home or building that has had modifications without a permit, you may be required to leave it unoccupied or do costly repairs.";
	tip[0][12] = "Building inspections and permits ensure your structure meets minimum standards of safety.";
	tip[0][13] = "If your home is ever damaged from weather or other means, proper permits and inspections will ease the process of filing an insurance claim.";
	
// Energy Efficiency Tips

	html[1] = '<h1 style="font-size: .9em;">Energy Efficiency Tips</h1><p><img src="' + root + 'images/pp_house_icon_tree.jpg" />';
	tip[1][0] = 'Create natural air conditioning by planting deciduous trees on the south side of a house to provide shade during the summer months and, because they will drop their leaves in the fall, let more sunlight in during the winter.';
	tip[1][1] = 'Replace incandescent bulbs with compact fluorescent lamps to save energy.';
	tip[1][2] = 'Obtain an energy audit to find out how you can improve a home&rsquo;s energy use and lower your utility bills.';
	tip[1][3] = 'Seal doors with weather-stripping, windows with caulking and search for other major air leaks.';
	tip[1][4] = 'Replace substandard ductwork, seal and insulate all ductwork in unconditioned spaces.';
	tip[1][5] = 'Buy energy efficient appliances, which will do more than recoup the higher initial price in energy savings. Your water heater alone is likely the second largest energy consumer in the house next to your heating and cooling system. Replacing it with an Energy Star water heater could make a big difference.';
	tip[1][6] = 'If you don&rsquo;t have an insulating blanket on your water heater to hold the heat in, consider getting one. It will pay for itself in less than a year.';
	tip[1][7] = 'If you need to replace a water heater, think about an on-demand tank-less water heater, which uses less energy since no water is kept hot in a tank.';
	tip[1][8] = 'Consider maximizing natural light sources to reduce the need for artificial lighting.';
	tip[1][9] = 'Increase the amount of insulation in your house to an R-30 rating or greater in the ceiling and floor, and R-13 rating or greater in the walls where feasible.';
	tip[1][10] = 'Installing a ceiling fan will allow you to raise the thermostat setting about 4 degrees during the summer without a reduction in comfort.';
	tip[1][11] = 'Install a programmable house thermostat that can adjust the temperature to your schedule.';
	tip[1][12] = 'A fireplace insert can transform an older fireplace into an efficient heating system by circulating indoor air past the fire and back into the room.';
	tip[1][13] = 'When not in use, close the fireplace damper to help prevent heat loss.';
	
// Water Conservation Tips

	html[2] = '<h1 style="font-size: .8em;">Water Conservation Tips</h1><p><img src="' + root + 'images/pp_house_icon_tree.jpg" />';
	tip[2][0] = 'Fix leaky faucets and pipes, which can reduce substantial water loss.';
	tip[2][1] = 'Replace old faucets and showerheads with the low flow variety.';
	tip[2][2] = 'Install low flush or dual flush toilets.';
	tip[2][3] = 'Consider front-loading washing machines that use less water with better cleaning and spin-drying performance.'
	tip[2][4] = 'Use porous pavers for your driveway to reduce water runoff by allowing rain water to percolate down into the soil to add to the ground water supply.';
	tip[2][5] = 'A low flow faucet aerator will reduce water flow from the tap up to 50%.';
	tip[2][6] = 'Adding a sink filter for drinking water, or simply using tap water, eliminates the need for purchasing bottled water.';
	tip[2][7] = 'Capture rain water in barrels placed under roof downspouts to water your yard or garden.';
	tip[2][8] = 'Create rain gardens at a low-point in a yard to collect rainwater and, like rain barrels, keeps runoff out of storm drains.';
	tip[2][9] = 'Consider a system that collects and then uses your gray water (from bathroom sinks, bath tubs and washing machines) to provide water for flushing toilets. It can save 30 percent or more of a homeÕs water use.';

// Safety Tips

	html[3] = '<h1>Safety Tips</h1><p><img src="' + root + 'images/pp_house_icon_lock.jpg" />';
	tip[3][0] = 'Building permits ensure the safety of your family.';
	tip[3][1] = 'Building permits give you the extra benefit of a building inspector whose goal is to reduce potential hazards of unsafe construction and ensure your health, safety and welfare.';
	tip[3][2] = 'By following building code guidelines, your completed project will meet minimum standards of safety and will be less likely to cause injury to you, your family, your friends or future owners.';
	tip[3][3] = 'Ensure your house is ready for fire. Install at least one smoke detector in every bedroom and at least one on every level of a multi-level house.';
	tip[3][4] = 'Replace batteries in your smoke detectors when you reset your clocks for daylight savings time twice a year.';
	tip[3][5] = 'If your home has fuel fired appliances, install at least one carbon monoxide detector in your house.';
	tip[3][6] = 'Gas appliances need plenty of air to operate properly. Schedule an annual appliance inspection, cleaning and tune-up by a qualified specialist to ensure proper functioning.';
	tip[3][7] = 'Never overload electrical outlets or power strips. Use only electrical power strips that have overload protection and meet product safety standards.';
	tip[3][8] = 'Repair or replace damaged electrical cords to prevent a potential fire hazard.';
	tip[3][9] = 'Extension cords should not be used as a permanent solution for cords that cannot reach a wall outlet.';
	tip[3][10] = 'Make sure your extension cord is designed to carry the load you wish to carry. Putting too much of an electrical load on a cord can cause the wire to get hot enough to start a fire.';
	tip[3][11] = 'Know how to put out kitchen fires. Have an A-B-C fire extinguisher close by just in case.';
	tip[3][12] = 'Prevent scalds by setting your hot water heater to 120 degrees or lower. Anti-scald devices are available for bathtubs and showers.';
	tip[3][13] = 'Building permits are the first steps to help you work with standards that have been created with your home and safety in mind when it comes to natural disasters such as floods and forest fires.';
	tip[3][14] = 'During inspections, inspectors should only point out safety issues that pertain to the outstanding permit OR are a significant hazard that should be addressed.';
	tip[3][15] = 'Ensure all maintenance and operation documentation, especially an equipment inventory, is submitted to the building owner/operator prior to building occupancy.';
	tip[3][16] = 'Keep drill bits, blades, and cutters sharp. Dull tools require extra force and make them more dangerous to use.';
	tip[3][17] = 'Keep a stocked first aid kit near every work area.';
	tip[3][18] = 'The electrical outlet in the bathroom should have a Ground Fault Circuit Interrupter (GFCI) to protect users from a dangerous shock if water and electricity come together. An electrician can install a GFCI for you.';
	tip[3][19] = 'When doing home repairs do not wear baggy or loose clothing as it may get caught in the tools. Roll up your sleeves, be careful of loose hair and remove all jewelry.';

// displays random tip

	var tipcount = tip[randomcategory].length;
	var randomtip = Math.floor(Math.random()*tipcount);

	document.getElementById("greentips_rap").innerHTML='<div id="greentips">' + html[randomcategory] + tip[randomcategory][randomtip] + '</p></div>';
	
}
