function voteWindow(url){
      mywindow=open(url,'myname','resizable=yes,width=495,height=250,left=100,top=100,scrollbars=1');
      mywindow.focus();
}

// Get base url
url = document.location.href;
xend = url.lastIndexOf("/") + 1;
var base_url = url.substring(0, xend);

function ajax_do (url) {
        // Does URL begin with http?
        if (url.substring(0, 4) != 'http') {
                url = base_url + url;
        }
        // Create new JS element
        var jsel = document.createElement('SCRIPT');
        jsel.type = 'text/javascript';
        jsel.src = url;
        // Append JS element (therefore executing the 'AJAX' call)
        document.body.appendChild (jsel);
}

function setW(){
	var i=getElementWidth("file");
	var j=getElementWidth("tree");
	i=i+j+10;
	if (self.innerWidth)
	{
	var frameWidth = self.innerWidth;
	}
	else if (document.documentElement && document.documentElement.clientWidth)
	{
	var	frameWidth = document.documentElement.clientWidth;
	}
	else if (document.body)
	{
	var frameWidth = document.body.clientWidth;
	}
	if (i>frameWidth)
	document.getElementById("body").style.width=i+"px";
	else
	document.getElementById("body").style.width=frameWidth+"px";
}
function getElementWidth(Elem) {
		if(document.getElementById) {
			var elem = document.getElementById(Elem);
		} else if (document.all){
			var elem = document.all[Elem];
		}
			xPos = elem.offsetWidth;

		return xPos;
}
