// JavaScript Document
function MenuItemOver(element)
{
	var submenuname = 'submenu'+element.id.substr(element.id.length-1, 1);
	document.getElementById(submenuname).style.visibility = 'visible';
}

function MenuItemOut(element)
{
	var submenuname = 'submenu'+element.id.substr(element.id.length-1, 1);
	document.getElementById(submenuname).style.visibility = 'hidden';
}

function SubmenuOver(element)
{
	var submenuname = 'submenu'+element.id.substr(7, 1);
	document.getElementById(submenuname).style.visibility = 'visible';
	
	if(element.className == "submenuitemout")
	{
		element.style.backgroundColor = "#e16934";
	}
}

function SubmenuOut(element)
{
	var submenuname = 'submenu'+element.id.substr(7, 1);
	document.getElementById(submenuname).style.visibility = 'hidden';
	
	if(element.className == "submenuitemout")
	{
		element.style.backgroundColor = "#663600";
	}
}

function SubmenuItemClick(element)
{
	var href = element.innerHTML.split("href=\"");
	href = href[1].split("\">");
	document.location.href = href[0];
}

function deleteItem(id, page)
{
		if(confirm("Weet u zeker dat u dit item wilt verwijderen"))
		{
			document.location.href = 'index.php?action=deleteitem&page='+page+'&item='+id;
		}
}

if(navigator.appName == "Netscape")
{
	window.onload = function() 
	{
		if(document.getElementById('content').scrollHeight < 400 )
		{
			document.getElementById('content').style.height = document.body.scrollHeight-228+"px"; 
		}
		else
		{
			document.getElementById('content').style.height = document.getElementById('content').scrollHeight+"px"; 
		}
	}
			
	window.onresize = function() 
	{ 
		if(document.getElementById('content').scrollHeight < 400 )
		{
			document.getElementById('content').style.height = document.body.scrollHeight-228+"px"; 
		}
		else
		{
			document.getElementById('content').style.height = document.getElementById('content').scrollHeight+"px"; 
		}
	}
}


function Bookmark(url, titel)
{
  if (document.all)
  {
    window.external.AddFavorite(url, titel);
  }
}

function Print()
{
  if(navigator.appName == "Netscape")
  {
    var printwindow = window.open('' ,'', 'width=455,height=600,scrollbars=yes,toolbar=no,location=no');
    printwindow.document.writeln('<html>');
    printwindow.document.writeln('<head>');
    printwindow.document.writeln('<link rel="stylesheet" href="http://www.chocoladeonline.nl/printstyle.css" type="text/css">');
    printwindow.document.writeln('</head>');
    printwindow.document.writeln('<body>');
    printwindow.document.writeln('<div class="contentcontainer">');
  	printwindow.document.writeln('<div id="content" class="content">');
    printwindow.document.writeln(document.getElementById('content').innerHTML);
    printwindow.document.writeln('</div>');
    printwindow.document.writeln('</div>');
    printwindow.document.writeln('</body>');
    printwindow.document.writeln('</html>');
    
    printwindow.print();
    printwindow.close();
  }
  else
  {
    var printwindow = window.open('' ,'', 'width=455,height=600,scrollbars=yes,toolbar=no,location=no');
    printwindow.document.writeln('<html>');
    printwindow.document.writeln('<head>');
    printwindow.document.writeln('<link rel="stylesheet" href="http://www.chocoladeonline.nl/printstyle.css" type="text/css">');
    printwindow.document.writeln('</head>');
    printwindow.document.writeln('<body onLoad="window.print(); self.close();">');
    printwindow.document.writeln('<div class="contentcontainer">');
  	printwindow.document.writeln('<div id="content" class="content">');
    printwindow.document.writeln(document.getElementById('content').innerHTML);
    printwindow.document.writeln('</div>');
    printwindow.document.writeln('</div>');
    printwindow.document.writeln('</body>');
    printwindow.document.writeln('</html>');
    
    printwindow.document.location.reload();
  }
}  


function TellAFriend()
{
  window.open('tellafriend.php', '', 'width=500,height=300,scrollbars=no,toolbar=no,location=no');
}
