function urlencode(str) {
	str = escape(str);
	str = str.replace('+', '%2B');
	str = str.replace('%20', '+');
	str = str.replace('*', '%2A');
	str = str.replace('/', '%2F');
	str = str.replace('@', '%40');
	str = str.replace('.', '%2e');
	return str;
}

function GetXmlHttpObject(){
	var instance=null;
	try{		// Firefox, Opera 8.0+, Safari
	instance=new XMLHttpRequest();
	}
	catch (e){	// Internet Explorer
	try{
		instance=new ActiveXObject("Msxml2.XMLHTTP");
		}
	catch (e){
		instance=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return instance;
} 

function popup(popupcompanyfile, winheight, winwidth, Type, Scrollable)
		{
				if (winheight==0)
						winheight = screen.availHeight - 100;
				if (winwidth==0)
						winwidth = screen.availWidth - 50;
				var myTop;
				var myWidth;
				myTop = ((screen.availHeight - winheight)/2) - 25;
				myLeft = (screen.availWidth - winwidth)/2;
				if (Scrollable == 0)
					window.open(popupcompanyfile, Type, "resizable=no,status=no,height=" + winheight + ",width=" + winwidth + ",scrollbars=no, location=no, menubar=no, left=" + myLeft + ", top=" + myTop);
				else
					window.open(popupcompanyfile, Type, "resizable=no,status=no,height=" + winheight + ",width=" + winwidth + ",scrollbars=yes, location=no, menubar=no, left=" + myLeft + ", top=" + myTop);
		}
