function init() {

			request = new HttpRequest();
			request.addHeader("Content-Type", "text/html");
			request.onComplete = function(response) {
				if(response.text == "1") {
					sState = new Array();
					for(x = 1; x < 11; x++) {
						sState[x] = $id("S" + x).getAttribute("src");
					}
				
					$id("S1").onmouseover = function() {
						this.setAttribute("src","/resources/images/ui/rollover.jpg");
					}
					$id("S1").onmouseout = function() {
						this.setAttribute("src",sState[1]);		
					}

					$id("S2").onmouseover = function() {
						$id("S2").setAttribute("src","/resources/images/ui/rollover.jpg");
						$id("S1").setAttribute("src","/resources/images/ui/rollover.jpg");
					}
					$id("S2").onmouseout = function() {
						$id("S2").setAttribute("src",sState[1]);		
						$id("S1").setAttribute("src",sState[2]);				
					}	
				
					$id("S3").onmouseover = function() {
						for(x =0;x<3;x++) {
							$id("S" + (x+1)).setAttribute("src","/resources/images/ui/rollover.jpg");
						}
					}
					$id("S3").onmouseout = function() {
						for(x =0;x<3;x++) {
							$id("S" + (x+1)).setAttribute("src",sState[x+1]);
						}
					}	
				
					$id("S4").onmouseover = function() {
						for(x =0;x<4;x++) {
							$id("S" + (x+1)).setAttribute("src","/resources/images/ui/rollover.jpg");
						}
					}
					$id("S4").onmouseout = function() {
						for(x =0;x<4;x++) {
							$id("S" + (x+1)).setAttribute("src",sState[x+1]);
						}
					}	
				
					$id("S5").onmouseover = function() {
						for(x =0;x<5;x++) {
							$id("S" + (x+1)).setAttribute("src","/resources/images/ui/rollover.jpg");
						}
					}
					$id("S5").onmouseout = function() {
						for(x =0;x<5;x++) {
							$id("S" + (x+1)).setAttribute("src",sState[x+1]);
						}
					}	
				
					$id("S6").onmouseover = function() {
						for(x =0;x<6;x++) {
							$id("S" + (x+1)).setAttribute("src","/resources/images/ui/rollover.jpg");
						}
					}
					$id("S6").onmouseout = function() {
						for(x =0;x<6;x++) {
							$id("S" + (x+1)).setAttribute("src",sState[x+1]);
						}
					}	
				
					
					$id("S7").onmouseover = function() {
						for(x =0;x<7;x++) {
							$id("S" + (x+1)).setAttribute("src","/resources/images/ui/rollover.jpg");
						}
					}
					$id("S7").onmouseout = function() {
						for(x =0;x<7;x++) {
							$id("S" + (x+1)).setAttribute("src",sState[x+1]);
						}
					}	
					
					
					
					
						$id("S8").onmouseover = function() {
						for(x =0;x<8;x++) {
							$id("S" + (x+1)).setAttribute("src","/resources/images/ui/rollover.jpg");
						}
					}
					$id("S8").onmouseout = function() {
						for(x =0;x<8;x++) {
							$id("S" + (x+1)).setAttribute("src",sState[x+1]);
						}
					}	
				
					$id("S9").onmouseover = function() {
						for(x =0;x<9;x++) {
							$id("S" + (x+1)).setAttribute("src","/resources/images/ui/rollover.jpg");
						}
					}
					$id("S9").onmouseout = function() {
						for(x =0;x<9;x++) {
							$id("S" + (x+1)).setAttribute("src",sState[x+1]);
						}
					}	
				
				
					$id("S10").onmouseover = function() {
						for(x =0;x<10;x++) {
							$id("S" + (x+1)).setAttribute("src","/resources/images/ui/rollover.jpg");
						}
					}
					$id("S10").onmouseout = function() {
						for(x =0;x<10;x++) {
							$id("S" + (x+1)).setAttribute("src",sState[x+1]);
						}
					}
					
					$id("S1").onclick = function() {
						setStars(1);
					}
					$id("S2").onclick = function() {
						setStars(2);
					}
					$id("S3").onclick = function() {
						setStars(3);
					}
					$id("S4").onclick = function() {
						setStars(4);
					}
					$id("S5").onclick = function() {
						setStars(5);
					}
					$id("S6").onclick = function() {
						setStars(6);
					}
					$id("S7").onclick = function() {
						setStars(7);
					}
					$id("S8").onclick = function() {
						setStars(8);
					}
					$id("S9").onclick = function() {
						setStars(9);
					}
					$id("S10").onclick = function() {
						setStars(10);
					}
						
					
					
						
				}
			}
			path = window.location.href.split("/");
			path.shift();
			path.shift();
			path.shift();						
			path2 = path[0];
			path.shift();
			path = path2 + "/checkStars/" + path.join("/")
		
			request.get("/" + path);		
				
		
}

function setStars(num) {
			request = new HttpRequest();
			request.addHeader("Content-Type", "text/html");
			request.onComplete = function(response) {
					alert("Your vote will be counted on the next refresh");
				for(x=1;x < 11; x++) {
					$id("S"+x).onmouseover = "";

				}
			}	
			path = window.location.href.split("/");
			path.shift();
			path.shift();
			path.shift();						
			path2 = path[0];
			path.shift();
			path = path2 + "/setStars/" + path.join("/")
			request.get("/" + path + "?rank=" + num);		
}			