/* this js file finds all the elements on the page which need to be the same 
colour as the menu and adds the style */

//get the colour we need
var submenu = $("submenu");

if(submenu){

		colour = $w(submenu.className);


		//now we have the colour to apply, we need to find the elements to colour in!
		var elements = $$(".colour-me");


		// loop through all the elements and colour them
		for(i=0;i<elements.length;i++){
			$(elements[i]).removeClassName("colour-me");
			$(elements[i]).addClassName(colour);
		}

		//find elements that need a bottom border

		var border_elements = $$(".colour-border-bottom");

		for(x=0;x<border_elements.length;x++){
			var border_style = colour + "-border-bottom";

			$(border_elements[x]).removeClassName("colour-border-botom");
			$(border_elements[x]).addClassName(border_style);
		}

		//find elements that need a top border

		var border_elements = $$(".colour-border-top");

		for(x=0;x<border_elements.length;x++){
			var border_style = colour + "-border-top";

			$(border_elements[x]).removeClassName("colour-border-top");
			$(border_elements[x]).addClassName(border_style);
		}

		/*
		$(benefits_header).setStyle({borderBottom: '4px solid ' + colour + '})

		//change the coloured border on the contact div too
		var contact_div = $$(".contact-info");
		$(contact_div[0]).setStyle({borderTop: '4px solid ' + colour + '})
		*/
}

