function openPopup(sURL, iWidth, iHeight){
	win = window.open(sURL, "smallwindow", "width=" + iWidth + ",height=" + iHeight +",status=no,toolbar=no,menubar=no,resizable=no,scrollbars=no,top=100px,left=200px");
}

//
// searchChild (recursive)
//
// Purpose:
//	Searches a child object with the correct tagname
//
// Param:
//	oObj		Object where to start the search
//	sTageName	Tagname of the searched object
//
function searchChild(oObj, sTagName){
	var oResult = null;
	
	for(var iLoop = 0; iLoop < oObj.childNodes.length && oResult == null; iLoop++){
		if(oObj.childNodes[iLoop].tagName == sTagName){
			oResult = oObj.childNodes[iLoop];
		}else{
			oResult = searchChild(oObj.childNodes[iLoop], sTagName);
		}
	}

	
	return oResult;
}

//
//	searchParent (Recursive)
//
// Purpose:
//	Returns the a parent object (or itself) with the requested tagname
//
// Param:
//	oObj		Object where to startt the search
//	sTagName	Tagname of searched object
//
function searchParent(oObj, sTagName){
	var oResult = null;

	if(oObj.tagName == sTagName){
		oResult = oObj;
	}else if(oObj.parentNode != null){
		oResult = searchParent(oObj.parentNode, sTagName);
	}
	
	return oResult;
}


//	Following code sets the browser boolean's so browser specific
//	code can be used
var isSafari;
var isMoz;
var isIE;

if (navigator.userAgent.indexOf("Safari") > 0)
{
    isSafari = true;
    isMoz = false;
    isIE = false;
}
else if (navigator.product == "Gecko")
{
    isSafari = false;
    isMoz = true;
    isIE = false;
}
else
{
    isSafari = false;
    isMoz = false;
    isIE = true;
}

//	Following code is for browser specific functionality
function AddGenericListener(theEvent, element, listener)
{
    if (isSafari)
        element.addEventListener(theEvent, listener, false);
    else if (isMoz)
        element.addEventListener(theEvent, listener, false);
    else
        element.attachEvent("on"+theEvent,listener);
}

function EventTarget(e)
{
    if(isMoz)
        return e.currentTarget;
    else
        return event.srcElement;
}

function EventStop(e)
{
    if(isIE){
		event.cancelBubble = true;
	}else if(isMoz){
		e.cancelBubble = true;
	}else{
        e.preventDefault();
	}
}
