	function $(id)
	{
		return document.getElementById(id);
	}
	function $v(id)
	{
		return document.getElementById(id).value;
	}
	function $i(id)
	{
		return document.getElementById(id).innerHTML;
	}
	function isEmail(add){
		if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,5})+$/.test(add))
			return true;
		else
			return false;
	}
	function findX(obj)
	{
		var curleft = 0;
		if(obj.offsetParent)
			while(1)
				{
					curleft += obj.offsetLeft;
					if(!obj.offsetParent)
						break;
					obj = obj.offsetParent;
				}
		else if(obj.x)
			curleft += obj.x;
		return curleft;
	}
	function findY(obj)
	{
		var curtop = 0;
		if(obj.offsetParent)
			while(1)
			{
				curtop += obj.offsetTop;
				if(!obj.offsetParent)
					break;
				obj = obj.offsetParent;
			}
		else if(obj.y)
			curtop += obj.y;
		return curtop;
	}
	function noresponse(response)
	{
		alert ('A background AJAX request was sent to retrieve details. It failed with the following message:\n' + response.responseText);
	}
	function screen(id,flag)
	{
		if(flag)
		{
			if(document.all)
			{
				var body = document.getElementsByTagName('html')[0];
				body.style.height = '100%';
				body.style.overflow = 'hidden';
			}
			else
				document.body.style.overflow = 'hidden';
			scroll(0,0);
			document.getElementById('screen').style.visibility = "visible";
			document.getElementById(id).style.visibility = "visible";
		}
		else
		{
			if(document.all)
			{
				var body = document.getElementsByTagName('html')[0];
				body.style.height = '';
				body.style.overflow = '';
			}
			else
				document.body.style.overflow = '';
			document.getElementById('screen').style.visibility = "hidden";
			document.getElementById(id).style.visibility = "hidden";
		}
	}
	function toggle(id)
	{
		if($(id).style.display == 'none')
			$(id).style.display = 'block';
		else
			$(id).style.display = 'none';
	}
	function show(id)
	{
		$(id).style.display = 'block';
	}
	function hide(id)
	{
		$(id).style.display = 'none';
	}
	function selectValue(id,value)
	{
		var select = document.getElementById(id).getElementsByTagName("option");
		for(i=0;i<select.length;i++)
			if(select[i].value == value)
				select[i].selected = "selected";
			else
				select[i].selected = null;
	}
	function selectElement(id,ele)
	{
		selectValue(id,document.getElementById(ele).value);
	}
	function getradiovalue(radioname)
	{
		if(!document.getElementsByName(radioname))
			return;
		var ids = document.getElementsByName(radioname);
		for(i=0;i<ids.length;i++)
			if(ids[i].checked)
				return ids[i].value;
		return 0;
	}
