function getUrl()
{	return parent.location;}

function getPageTitle()
{	return document.title;}


function setValueAsURL(objID,qs)
{
	var o = document.getElementById(objID);
	o.value=getUrl() + qs;
	//alert(objID + "\n" + o.value);
}	

function setValueAsPageTitle(objID)
{
	var o = document.getElementById(objID);
	o.value=getPageTitle();
}	


function redirectWithURLandTitle(baseUrl)
{
	var myUrl = baseUrl; 
	var currUrl = getUrl().toString().replace(/#/,'');
	if(myUrl.indexOf("?") < 0)
	{myUrl+='?rurl=' + currUrl + '&rtitle=' + getPageTitle() }
	else
	{myUrl+='&rurl=' + currUrl + '&rtitle=' + getPageTitle()}
	window.location = myUrl;
}


function setValueAsURLPhysicalPath(objID,qs)
{
	var o = document.getElementById(objID);
	o.value=contertUrlToPhysical(getUrl()) ;
	//o.value=getUrl()
	//alert(objID + "\n" + o.value);
}	

function contertUrlToPhysical(inURL)
{
	//alert(inURL.toString());
	var myURL = inURL.toString();
	return myURL.replace(/http:\/\/www.csu.edu.au\//i,'/local/WWW/');
}
