Hi guys, first time posting... :-)

I'm trying to hide a div based on parameter in my URL. I can't seem to get it to work. I've tried different approaches, which I will show below... can someone help me figure out why all of these don't work? I know that the evaluation of the URL parameter is working, because the correct "URL parameter found" and "URL parameter not found" displays each time... however the actual code to hide the div doesn't work. Any suggestions? I'm open to anything. Well... almost anything. :-) haha!

All of these assumes that I have a div called "canam": <div id="canam">
APPROACH 1 - Using JQuery - Note: Yes, I am trying to hide the div in both conditions... only for testing, because I just wanted to see if I could get it to work anywhere. Obviously, I will be removing it from the else area once this works:
Code:
<script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
// jQuery Show / Hide Div based on URL parameter
if(window.location.href.indexOf("&Manufacturer=18&") > -1){
  document.write("<h1>URL Parameter Found</h1>");
  $('#canam').hide();
} else {
  document.write("<h1>URL Parameter Not Found</h1>");
  $('#canam').hide();
}
</script>
APPROACH 2 - Note: Yes, I am trying to hide the div in both conditions... only for testing, because I just wanted to see if I could get it to work anywhere. Obviously, I will be removing it from the else area once this works:
Code:
<script language="javascript" type="text/javascript">
if(window.location.href.indexOf("&Manufacturer=18&") > -1){
  document.write("<h1>URL Parameter Found</h1>");
  document.getElementById('canam').style.display = "hidden"; // hide body div tag
} else {
  document.write("<h1>URL Parameter Not Found</h1>");
  document.getElementById('canam').style.display = "hidden"; // hide body div tag
}
</script>
APPROACH 3 - Note: This time, I commented out the div tag line ( <div id="canam"> ) so that it would not be in the code. Then I had this code above it, to try to dynamically create the div tag:
Code:
<script language="javascript" type="text/javascript">
if(window.location.href.indexOf("&Manufacturer=18&") > -1){
  document.write("<h1>URL Parameter Found</h1>");
  document.write("<div id=\"canam\" style=\"display:hidden;\">");
} else {
  document.write("<h1>URL Parameter Not Found</h1>");
  document.write("<div id=\"canam\">");
}
</script>
I would so appreciate any kind assistance. I'm not very experienced in javascript, so I do something idiotic, please bare with me.