Hi I am trying to use a cookie to determine whether my site will use pictures co far I have that code. I want the code to set the cookie value to 1 and then when the site loads to look and see if the cookie value is 1 and if it is to run the function stopLeaves(d) but if it not 1 I want it to do nothing. I also need the startleaves function to "delete" the cookie when it is started. I am not sure what the problem is with the code so I have no clue where to start looking so any help is appreciated

CODE
function get_cookie ( 1 )
{
  var results = document.cookie.match (cookie_name + '=1' );

  if ( 1 ){
   stopleaves(d)}
}

function stopLeaves(d) {
var all = d.getElementsByTagName('*');
var images = [];
for (var a=0; a<all.length; a++) {
if (all[a].tagName == 'IMG')
images.push(all[a]);
mkcookie()
}
for (var i=0; i<images.length; i++) {
images[i].parentNode.removeChild(images[i]);
}
}

function startleaf()
{
del_cookie(1)
location.reload();
}


function mkcookie()
{
set.document.cookie = "1")                
}


function del_cookie(1) {
document.cookie = name +
'=; expires=Thu, 01-Jan-70 00:00:01 GMT;';
}