/*  JavaScript include: Common functions */

function TopPath()
{   var path;
   	if (top==self.parent && top!=self && top.LAmandier){path=top}
   	else if (top == self && opener != null && opener.LAmandier){path=opener}
   	else {path=false};
   	return path;
}

function FrameCheck(page)
{   // Make sure page is presented in its proper frame context	
	var path=TopPath();
	if(page.length>0)page = '?'.page;
	if(!path)
	{	if (location.protocol == 'file:'){ top.location.replace('index.html' + page) }
		else if (1+navigator.userAgent.indexOf('etscape6')){ open('index.php' + page) }
		else { top.location.replace('index.php' + page) }  
	}		
	return path
}

function Home()
{   // Display Home page allowing for local contexts (from file or localhost server)
	var url = 'http://www.au-village.com/index.php';
	if (location.protocol == 'file:'){ url = 'index.html' }
	else if (1+location.href.indexOf('http://localhost')){ url = 'index.php' }                           	                       
	var path=TopPath();
	if(!path){path=top}
	path.location.href=url;
	return false;     
} 

