For your specific case the easiest fix (in my opinion) is to change the double quotes for the attributes in object to single ones (else it ends the document.write string). This should work
<script type="text/javascript">
var stream = location.pathname;
switch (stream) {
case "/defatank":
document.write("<object type='application/x-shockwave-flash' height='378' width='620' id='live_embed_player_flash' data='http://www.twitch.tv/widgets/live_embed_player.swf?channel=defatank' bgcolor='#000000'><param name='allowFullScreen' value='true' /><param name='allowScriptAccess' value='always' /><param name='allowNetworking' value='all' /><param name='movie' value='http://www.twitch.tv/widgets/live_embed_player.swf' /><param name='flashvars' value='hostname=www.twitch.tv&channel=defatank&auto_play=true&start_volume=25' /></object>");
break;
case "/seeingblue":
document.write("SeeingBlue's Live Stream Page");
break;
case "/shiroshii":
document.write("Shiroshii's Live Stream Page");
break;
case "/theend66":
document.write("TheEnd66's Live Stream Page");
break;
case "/wakawaka647":
document.write("WakaWaka647's Live Stream Page");
break;
case "/xtheguythatplays":
document.write("XTheGuyThatPlays' Live Stream Page");
break;
}
</script>
The JavaScript interpreter needs to know where a string begins and ends and the quote marks are used to do that. You can use single or double quotes for JavaScript strings. If you want to use the same quote type in a string that you used to deliminate the string, then that quote characters must be escaped - otherwise the interpreter gets confused and thinks the string has ended early.
Some examples
1. "Good string"
1. "Broken "hi" string"
1. "Good 'hi' string"
1. "Good \"hi\" string"
The 2nd string will not work because the interpreter thinks it ended just before the word hi - as indicated by the double quotes.
The 3rd string is fine because it uses single quotes for hi instead.
The 4th string is also fine because it "escapes" the double quote characters to let the interpreter know the following character should be treated literally and not as JavaScript code.
There's a little more details on JavaScript strings here: http://www.w3schools.com/js/js_obj_string.asp
So in summary, as the HTML spec allows for single, double, or not quoted attributes, changing the double quotes to single resolves the issue.