function _id(id){return document.getElementById(id);}

function checkInput()
{
	if(document.getElementById('naam').value == 'Name')
	{
		document.getElementById('naam').value='';
	}

	if(document.getElementById('email').value =='Email')
	{
		document.getElementById('email').value='';
	}
}

function popUp(URL,width,height) {
	day = new Date();
	id = day.getTime();

	var winLeft = (screen.width - width) / 2;
	var winUp = (screen.height - height) / 2;

	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width='+width+',height='+height+',left='+winLeft+',top='+winUp);");
}


function contact_by_mail(user, domain, suffix, content)
{
	if (!content)
	{
		document.write('<a href="' + 'mailto:' + user + '@' + domain + '.' + suffix + '">' + user + '@' + domain + '.' + suffix + '</a>');
	} else
	{
		document.write('<a href="' + 'mailto:' + user + '@' + domain + '.' + suffix + '">' + content + '</a>');
	}
	return true;
}


function flashChangePageTitle(newTitle)
{
	document.title = newTitle;
}

// Called from page header
// checks if url contains # and redirects to new url
function flashCheckUrlRedirect()
{
	var urlParts = window.location.href.split("#/");
	if (urlParts[1])
	{
		window.location = '/'+urlParts[1];
	}
}


function flashFindPageDimensions()
{
	var winWidth, winHeight, d=document;
	if (typeof window.innerWidth!='undefined')
	{
		winWidth = window.innerWidth;
		winHeight = window.innerHeight;
	} else if ( d.documentElement && typeof d.documentElement.clientWidth!='undefined' && d.documentElement.clientWidth!=0 )
	{
		winWidth = d.documentElement.clientWidth;
		winHeight = d.documentElement.clientHeight;
	} else if ( d.body && typeof d.body.clientWidth!='undefined')
	{
		winWidth = d.body.clientWidth;
		winHeight = d.body.clientHeight;
	}
	var returnArray = new Array(winWidth, winHeight);
	return returnArray;
}

var resizeTimeout;
var lastGivenHeight;
function flashSetObjHeight(objHeight)
{
	lastGivenHeight = objHeight;
	var obj = document.getElementById('swfBase');
	var pageDimensions = flashFindPageDimensions();
	if (objHeight<pageDimensions[1])
	{
		objHeight = pageDimensions[1] - 5;
	}
	obj.style.height = objHeight + 'px';

	if (pageDimensions[0] < 960)
	{
		obj.style.width = '960px';

		// Keep calling this function or Flash will not resize back in IE
		resizeTimeout = setTimeout("setObjHeight("+lastGivenHeight+")", 500);
	} else
	{
		obj.style.width = '100%';
	}
}

var scrollPos = 0
function flashDoPageScroll(delta)
{
	var obj = document.body;
	obj.scrollTop -= (delta*10);
}

function open_block_image(id,myId) {
	if (document.getElementById(id)) {
		document.getElementById(id).style.display = 'block';
		_id('vlarge_prod_img').src='/media/images/product/'+myId;
	}
}

function close_block(id) {
	if (document.getElementById(id)) {
		document.getElementById(id).style.display = 'none';
	}
}


function enlargeImage(myId){
	_id('vlarge_prod_img').src='/media/images/product/'+myId;
	show('enlarge_prod_image');
}
