window.name = 'main';
function setFocus(strFieldName) {
	document.userinput[strFieldName].focus();
}

function hallo (hallotext) {

	alert(hallotext);
}


      
// hide all menu and product divs
function hideall() {
	hideallcategories();
	hideallproducts();
}
// hide all category divs
function hideallcategories() {
	var i;
	for(i = 0; i < 8; i++)
		if(document.getElementById("c" + i))
			document.getElementById('c' + i).style.visibility = 'hidden';
}
// hide all product divs
function hideallproducts() {
	var el, i;
	i = 1;
	while (el = document.getElementById('p' + i)) {
		document.getElementById('p' + i).style.visibility = 'hidden';
		i++;
	}
}
// show layer by ID
function MM_showLayer(strLayer) { //v3.0
	hideall();
	if(document.getElementById(strLayer))
		document.getElementById(strLayer).style.visibility = "visible";
}
function closeMenu(event) {
	var current, related;
	if (window.event) {
		current=this;
		related=window.event.toElement;
	} else {
		current=event.currentTarget;
		related=event.relatedTarget;
	}
	if (current != related && !contains(current, related)) {
		//current.style.visibility="hidden";  
		//	setTimeout(function() { current.style.visibility="hidden"; },500) 
		}
}
function cOn(td,oncolor){
	if(document.getElementById||(document.all && !(document.getElementById)))
		td.style.backgroundColor=oncolor;
}
function cOut(td,offcolor){
	if(document.getElementById||(document.all && !(document.getElementById)))
		td.style.backgroundColor=offcolor;
}
function contains (a, b) {
	while (b.parentNode)
		if((b=b.parentNode)==a)
			return true;
	return false;
}

function eventFunction(id) {
	document.getElementById(id).onmouseout=closeMenu
}
function openMenu(id) {
	var el;
	el = document.getElementById(id);
	el.style.visibility="visible";
}

function swapPic() {
	var imgnum = images.length - 1;
	do {
		var randnum = Math.random();
		rand1 = Math.round((imgnum - 1) * randnum) + 1;
	} while (rand1 == useRand);
	useRand = rand1;
	document.randimg.src = images[useRand].src;
}

window.name = 'main';
function OpenWindow(url) {
	newWindow = window.open(url,'', "status=1,toolbar=0,scrollbars=1,height=300,width=500");
	newWindow.focus();
}
 function showLayer(layerName)
{
	if (document.getElementById) // Netscape 6 and IE 5+
	{
		var targetElement = document.getElementById(layerName);
		//setTimeout(function() { targetElement.style.visibility = 'visable'; },500) 
		targetElement.style.visibility = 'visible';
	}
}
function hideLayer(layerName)
{
	if (document.getElementById)
	{
		var targetElement = document.getElementById(layerName);
		//setTimeout(function() { targetElement.style.visibility = 'hidden'; },500) 
		targetElement.style.visibility = 'hidden';
		//alert('hello');
	}
}
function setCookie(name, value, expires, path, domain, secure)
{
	document.cookie= name + "=" + escape(value) +
		((expires) ? "; expires=" + expires.toGMTString() : "") +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		((secure) ? "; secure" : "");
}
function getCookie(name)
{
	var dc = document.cookie;
	var prefix = name + "=";
	var begin = dc.indexOf("; " + prefix);
	if (begin == -1) {
		begin = dc.indexOf(prefix);
		if (begin != 0) return null;
	} else {
		begin += 2;
	}
	var end = document.cookie.indexOf(";", begin);
	if (end == -1)
		end = dc.length;
	return unescape(dc.substring(begin + prefix.length, end));
}
function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 		'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=550,height=600');");
}