Created
March 24, 2012 23:37
-
-
Save anonymous/2189103 to your computer and use it in GitHub Desktop.
a guest on Mar 24th, 2012 - pastebin.com/BJMXR0wM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fill_stars(rating) | |
{ | |
switch(rating) | |
{ | |
case 1: | |
document.getElementById("one").src = "res/star_full.gif"; | |
break; | |
case 1.5: | |
document.getElementById("one").src = "res/star_full.gif"; | |
document.getElementById("two").src = "res/star_half.gif"; | |
break; | |
case 2: | |
document.getElementById("one").src = "res/star_full.gif"; | |
document.getElementById("two").src = "res/star_full.gif"; | |
break; | |
case 2.5: | |
document.getElementById("one").src = "res/star_full.gif"; | |
document.getElementById("two").src = "res/star_full.gif"; | |
document.getElementById("three").src = "res/star_half.gif"; | |
break; | |
case 3: | |
document.getElementById("one").src = "res/star_full.gif"; | |
document.getElementById("two").src = "res/star_full.gif"; | |
document.getElementById("three").src = "res/star_full.gif"; | |
break; | |
case 3.5: | |
document.getElementById("one").src = "res/star_full.gif"; | |
document.getElementById("two").src = "res/star_full.gif"; | |
document.getElementById("three").src = "res/star_full.gif"; | |
document.getElementById("four").src = "res/star_half.gif"; | |
break; | |
case 4: | |
document.getElementById("one").src = "res/star_full.gif"; | |
document.getElementById("two").src = "res/star_full.gif"; | |
document.getElementById("three").src = "res/star_full.gif"; | |
document.getElementById("four").src = "res/star_full.gif"; | |
break; | |
case 4.5: | |
document.getElementById("one").src = "res/star_full.gif"; | |
document.getElementById("two").src = "res/star_full.gif"; | |
document.getElementById("three").src = "res/star_full.gif"; | |
document.getElementById("four").src = "res/star_full.gif"; | |
document.getElementById("five").src = "res/star_half.gif"; | |
break; | |
case 5: | |
document.getElementById("one").src = "res/star_full.gif"; | |
document.getElementById("two").src = "res/star_full.gif"; | |
document.getElementById("three").src = "res/star_full.gif"; | |
document.getElementById("four").src = "res/star_full.gif"; | |
document.getElementById("five").src = "res/star_full.gif"; | |
break; | |
} | |
} | |
function hover_stars(rating) | |
{ | |
switch(rating) | |
{ | |
case "1": | |
document.getElementById("one").src = "res/star_hover.gif"; | |
break; | |
case "2": | |
document.getElementById("one").src = "res/star_hover.gif"; | |
document.getElementById("two").src = "res/star_hover.gif"; | |
break; | |
case "3": | |
document.getElementById("one").src = "res/star_hover.gif"; | |
document.getElementById("two").src = "res/star_hover.gif"; | |
document.getElementById("three").src = "res/star_hover.gif"; | |
break; | |
case "4": | |
document.getElementById("one").src = "res/star_hover.gif"; | |
document.getElementById("two").src = "res/star_hover.gif"; | |
document.getElementById("three").src = "res/star_hover.gif"; | |
document.getElementById("four").src = "res/star_hover.gif"; | |
break; | |
case "5": | |
document.getElementById("one").src = "res/star_hover.gif"; | |
document.getElementById("two").src = "res/star_hover.gif"; | |
document.getElementById("three").src = "res/star_hover.gif"; | |
document.getElementById("four").src = "res/star_hover.gif"; | |
document.getElementById("five").src = "res/star_hover.gif"; | |
break; | |
} | |
} | |
function remove_stars(rating,result) | |
{ | |
switch(rating) | |
{ | |
case "1": | |
document.getElementById("one").src = "res/star_empty.gif"; | |
break; | |
case "2": | |
document.getElementById("one").src = "res/star_empty.gif"; | |
document.getElementById("two").src = "res/star_empty.gif"; | |
break; | |
case "3": | |
document.getElementById("one").src = "res/star_empty.gif"; | |
document.getElementById("two").src = "res/star_empty.gif"; | |
document.getElementById("three").src = "res/star_empty.gif"; | |
break; | |
case "4": | |
document.getElementById("one").src = "res/star_empty.gif"; | |
document.getElementById("two").src = "res/star_empty.gif"; | |
document.getElementById("three").src = "res/star_empty.gif"; | |
document.getElementById("four").src = "res/star_empty.gif"; | |
break; | |
case "5": | |
document.getElementById("one").src = "res/star_empty.gif"; | |
document.getElementById("two").src = "res/star_empty.gif"; | |
document.getElementById("three").src = "res/star_empty.gif"; | |
document.getElementById("four").src = "res/star_empty.gif"; | |
document.getElementById("five").src = "res/star_empty.gif"; | |
break; | |
} | |
switch(result) | |
{ | |
case 1: | |
document.getElementById("one").src = "res/star_full.gif"; | |
break; | |
case 1.5: | |
document.getElementById("one").src = "res/star_full.gif"; | |
document.getElementById("two").src = "res/star_half.gif"; | |
break; | |
case 2: | |
document.getElementById("one").src = "res/star_full.gif"; | |
document.getElementById("two").src = "res/star_full.gif"; | |
break; | |
case 2.5: | |
document.getElementById("one").src = "res/star_full.gif"; | |
document.getElementById("two").src = "res/star_full.gif"; | |
document.getElementById("three").src = "res/star_half.gif"; | |
break; | |
case 3: | |
document.getElementById("one").src = "res/star_full.gif"; | |
document.getElementById("two").src = "res/star_full.gif"; | |
document.getElementById("three").src = "res/star_full.gif"; | |
break; | |
case 3.5: | |
document.getElementById("one").src = "res/star_full.gif"; | |
document.getElementById("two").src = "res/star_full.gif"; | |
document.getElementById("three").src = "res/star_full.gif"; | |
document.getElementById("four").src = "res/star_half.gif"; | |
break; | |
case 4: | |
document.getElementById("one").src = "res/star_full.gif"; | |
document.getElementById("two").src = "res/star_full.gif"; | |
document.getElementById("three").src = "res/star_full.gif"; | |
document.getElementById("four").src = "res/star_full.gif"; | |
break; | |
case 4.5: | |
document.getElementById("one").src = "res/star_full.gif"; | |
document.getElementById("two").src = "res/star_full.gif"; | |
document.getElementById("three").src = "res/star_full.gif"; | |
document.getElementById("four").src = "res/star_full.gif"; | |
document.getElementById("five").src = "res/star_half.gif"; | |
break; | |
case 5: | |
document.getElementById("one").src = "res/star_full.gif"; | |
document.getElementById("two").src = "res/star_full.gif"; | |
document.getElementById("three").src = "res/star_full.gif"; | |
document.getElementById("four").src = "res/star_full.gif"; | |
document.getElementById("five").src = "res/star_full.gif"; | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment