var myimages = new Array();

function preloading(){
	for (x=0; x<preloading.arguments.length; x++){
		myimages[x] = new Image();
		myimages[x].src = preloading.arguments[x];
	}
}

preloading("img/menu_home_on.png", "img/menu_artists_on.png","img/menu_disco_on.png", "img/menu_photos_on.png","img/menu_blog_on.png");

function move_box(an, box) 
{
	var cleft = 0;
	var ctop = 0;
	var obj = an;
	while (obj.offsetParent) {
		cleft += obj.offsetLeft;
		ctop += obj.offsetTop;
		obj = obj.offsetParent;
	}
	box.style.left = cleft + 'px';
	ctop += an.offsetHeight + 8;
	if (document.body.currentStyle && document.body.currentStyle['marginTop']) {
			ctop += parseInt(
			document.body.currentStyle['marginTop']);
	}
	box.style.top = ctop + 'px';
}

function show_hide_box(an, width, height, borderStyle) {
	var href = an.href;
	var boxdiv = document.getElementById(href);

	if (boxdiv != null) {
		if (boxdiv.style.display=='none') {
			move_box(an, boxdiv);
			boxdiv.style.display='block';
		} else
			boxdiv.style.display='none';
		return false;
	}

	boxdiv = document.createElement('div');
	boxdiv.setAttribute('id', href);
	boxdiv.style.display = 'block';
	boxdiv.style.position = 'absolute';
	boxdiv.style.width = width + 'px';
	boxdiv.style.height = height + 'px';
	boxdiv.style.border = borderStyle;
	boxdiv.style.backgroundColor = '#FFFF00';

	var contents = document.createElement('iframe');
	contents.scrolling = 'no';
	contents.frameBorder = '0';
	contents.style.width = width + 'px';
	contents.style.height = height + 'px';
	contents.src = href;

	boxdiv.appendChild(contents);
	document.body.appendChild(boxdiv);
	move_box(an, boxdiv);

	return false;
}

function validate_required(field,alerttxt)
{
	with (field)
	{
		if (value==null||value=="")
		{
			alert(alerttxt);return false;
		}
		else
		{
			return true;
		}
	}
}

function validate_form(thisform)
{
	with (thisform)
	{
		if (validate_required(name,"Name must be filled out!")==false)
		{
			name.focus();
			return false;
		}
		if (validate_required(comment,"Comment must be filled out!")==false)
		{
			comment.focus();
			return false;
		}
	}
}


