<!--
	
	function init_form() {
		if(!document.getElementById("client_review")) { return false; }
		var client_form = document.getElementById("client_review");
		var uls = client_form.getElementsByTagName("UL");
		for (var i=0; i<uls.length; i++) { 
			var stars = uls[i].getElementsByTagName("A");
			for (var j=0; j<stars.length; j++) {
				var star = stars[j];
				star.onclick = function() {
					var num_stars = parseInt(this.getAttribute("title"));
					var this_stars = this.parentNode.parentNode.getElementsByTagName("A");
					for (var count=0; count<this_stars.length; count++)
					{
						if (count<num_stars) {
							this_stars[count].style.backgroundPosition = "0px -14px";													
						}
						else
						{
							this_stars[count].style.backgroundPosition = "0px 0px";																				
						}
					}
					
					var div_row = this.parentNode.parentNode.parentNode;
					var input = div_row.getElementsByTagName("INPUT");
					input[0].value = num_stars;
					return false;
				}
			}
		}
		
		var legends = client_form.getElementsByTagName("LEGEND");
		for (var i=0; i<legends.length; i++) {
			legend = legends[i];
			legend.onclick = function() {
				
				var window_string = "/cms/wp-content/themes/imaginasium/page_client_review_popup.php?click=explanation&label=" + this.innerHTML;
				var explanation_window = window.open(window_string,'explanation','height=500,width=500');
				if (explanation_window.opener == null) { explanation_window.opener = self; }
			    
			}
		}

		var row = 0;
		var quotes_div = client_form.getElementsByTagName("DIV");		
		for (var i=0; i<quotes_div.length; i++) {
			node = quotes_div[i];		
			for(var c = 0; c<node.childNodes.length; c++) { 
				var childNode = node.childNodes[c]; 
				if (childNode.tagName == "DIV") { 			
					childNode.onclick = function() {
						var quote_textarea = this.parentNode.lastChild.previousSibling;
						quote_id = quote_textarea.getAttribute("id");
						var window_string = "/cms/wp-content/themes/imaginasium/page_client_review_popup.php?click=quote&label=" + quote_id;
						var quote_window = window.open(window_string,'quote','height=500,width=500');
					    if (quote_window.opener == null) { quote_window.opener = self; } 
					    
					}
				}
			}
		}
	}

	window.onload = init_form;

//-->