function focus() {
	document.getElementById("focus").focus();
}

function ShowMenu(name) {
	x=document.getElementsByTagName("div");
	for (i=0;i<x.length;i++) {
		if (x[i].id.substring(0,8) == "dropmenu") {
			closeMenu( x[i].id.substring(8) );
		}
	}
	openMenu(name);
}

function openMenu(name) {
	// probleem dropdown met div opgelost door iframe...
	var menuname = "dropmenu" + name;
	var framename = "if" + name;
	nObj = makeObj(menuname);
	nObj2 = makeObj(framename);
	
	if (nObj) {
		nObj.showIt();
		nObj2.setHeight(nObj.getHeight());			
		nObj2.style.zIndex=90;
		nObj2.style.border="none";
		nObj2.showIt();
	}
}
		
function closeMenu(name) {
	var menuname = "dropmenu" + name;
	var framename = "if" + name;
	
	nObj = makeObj(menuname);
	nObj2 = makeObj(framename);
	
	if (nObj) 
		nObj2.hideIt();
		nObj.hideIt(); 
}

function makeObj(name) {
	newObj=getObject(name);
	if (newObj){
		newObj.showIt=fShowIt;newObj.hideIt=fHideIt;
		newObj.setCoords=setXY;newObj.pos=setPosition;
		newObj.posRel=setPositionRelative;
		newObj.setHeight=setObjHeight;newObj.setWidth=setObjWidth;
		newObj.getHeight=getObjHeight;newObj.getWidth=getObjWidth;
		return newObj;
	}
	else 
		return;
}

function getObject(name) {
	newObj=document.getElementById(name); 
	return newObj;
}

function setXY(x,y){this.x=x;this.style.left=parseInt(x);this.y=y;this.style.top=parseInt(y);}

function setPosition(posX,posY,w,h,maxL,maxT) {
	x=0;y=0;newX=0;newY=0;win=window;winWidth=getWinWidth();winHeight=getWinHeight();
	if (posX=="c"){halfWidth=w/2;center=winWidth/2;x=center-halfWidth;}
	if (posX=="l"){x=maxL;}
	if (posX=="r"){x=winWidth-w;}
	if (posY=="b"){y=winHeight-h;}
	if (posY=="t"){y=maxT;}
	if (posY=="m"){halfHeight=h/2;middle=winHeight/2;y=middle-halfHeight;}
	newX=x;newY=y;if(x<maxL){newX=maxL;}if(y<maxT){newY=maxT;}
	this.setCoords(newX,newY);
}

function setPositionRelative(bLayer,h,v){x1=bLayer.x;x=x1+h;y1=bLayer.y;y=y1+v; newX=x;newY=y;this.setCoords(newX,newY);}

function fShowIt(){this.style.visibility="visible";this.style.display="block";}
function fHideIt(){this.style.visibility="hidden";this.style.display="none";}

function setObjWidth(newWidth) {nW=newWidth+"px";this.style.width=nW;}
function getObjWidth() {newWidth=parseInt(this.offsetWidth);return newWidth;}

function setObjHeight(newHeight) {nH=newHeight+"px";this.style.height=nH;}
function getObjHeight() {newHeight=parseInt(this.offsetHeight);return newHeight;}
