function init() {
	resizeWindow()
}
function resizeWindow() {
	var imageHeight = 167
	var footerHeight = 25
	var WinHeight = (document.layers)? window.innerHeight:document.body.clientHeight
	var Offset = (document.layers)? window.pageYOffset:document.body.scrollTop
	var positionY = WinHeight + Offset - imageHeight
	var pageHeight = document.body.scrollHeight

	if(positionY > 200) {
		if((positionY+imageHeight) == (pageHeight))
			positionY = positionY-footerHeight
		else if((positionY+imageHeight) > (pageHeight-footerHeight)) {
			var verschil = (positionY+imageHeight) - (pageHeight-footerHeight)
			positionY = positionY - verschil
		}
		document.getElementById('bottomLeftNav').style.top = (positionY)+'px'
	}
	setTimeout('resizeWindow()',100)
}
function timeout_mc_questions(){
	document.frmMain.submit();
}
function deleteitem(to_page,objectid,clientid,navid,projectid){
	if(confirm('Are you sure you want to delete this item permanently?')){
		if(projectid==''){
			if(clientid==''){
				location.href(to_page+'?action=delete&objectid='+objectid+'&navid='+navid);
			}else{
				location.href(to_page+'?action=delete&objectid='+objectid+'&clientid='+clientid+'&navid='+navid);
			}
		}else{
			location.href(to_page+'?action=delete&objectid='+objectid+'&clientid='+clientid+'&navid='+navid+'&projectid='+projectid);
		}
	}
}
function deleteinvoice(to_page,objectid,clientid,navid,action){
	if(confirm('Are you sure you want to delete this invoice permanently?')){
		location.href(to_page+'?action='+action+'&objectid='+objectid+'&clientid='+clientid+'&navid='+navid);
	}
}
function deleteitemNoClientid(to_page,objectid,navid,action){
	if(confirm('Are you sure you want to delete this item permanently?')){
		location.href(to_page+'?action='+action+'&objectid='+objectid+'&navid='+navid);
	}
}

function popup(url, width, height){
	xl = (screen.availWidth/2)-(width/2)
	tt = (screen.availHeight/2)-(height/2)
	picture=window.open(url,'showSearch','toolbar=no,scrolling=yes,resizable=no,location=no,directories=no,status=no,scrollbars=yes,menubar=no,width='+width+',height='+height+',left='+xl+',top='+tt);
	picture.focus()
}
function popup_noscroll(url, width, height){
	xl = (screen.availWidth/2)-(width/2)
	tt = (screen.availHeight/2)-(height/2)
	picture=window.open(url,'showSearch','toolbar=no,scrolling=no,resizable=no,location=no,directories=no,status=no,scrollbars=no,menubar=no,width='+width+',height='+height+',left='+xl+',top='+tt);
	picture.focus()
}
function mouseMeOver(id){
	document.getElementById('tr'+id).className = 'trOver';
}
function mouseMeOverTD(id){
	document.getElementById('td'+id).className = 'tdOver';
}

function mouseMeOut(id){
	if(id%2 == 0){
		document.getElementById('tr'+id).className = 'trOdd';
	} else {
		document.getElementById('tr'+id).className = 'trEven';
	}
}
function mouseMeOutTD(id,tdclass){
	document.getElementById('td'+id).className = tdclass;
}