
/* Make sure we are at the main page - if not, put the page the person is trying to get to into the div/iframe */

var qs = location.href.indexOf('?');
if (qs == -1)  
	qs = location.href.length;
var url = location.href.substring(0, qs);

if (url.toLowerCase() != "http://www.ardf.org.au/cgi-bin/menu.cgi" && url.toLowerCase != "www.ardf.org.au/cgi-bin/menu.cgi" && url.toLowerCase() != "http://www.ardf.org.au/cgi-bin/menu1.cgi" && url.toLowerCase != "www.ardf.org.au/cgi-bin/menu1.cgi") {
	// Remove domain name
	var temp = url.replace("http://www.ardf.org.au/", "");
	temp = temp.replace("www.ardf.org.au/", "");
	if (temp == "events/pictures_aj.html" || temp == "events/pictures_upload_aj.html" || temp == "events/event_aj.html" || temp == "events/report_aj.html" || temp == "events/event_cash_aj.html")
		temp = "../events/calendar_aj.html";
	if (temp == "committee/action_pts_aj.html")
		temp = "../committee/minutes_aj.html";
	if (temp == "about/email_aj.html")
		temp = "../about/contacts_aj.html";

	if (left(temp, 3) != '../')	temp = "../" + temp;
	location.href = "http://www.ardf.org.au/cgi-bin/menu.cgi?frm_src=" + temp;
}


function left(str, n){
	if (n <= 0)
	    return "";
	else if (n > String(str).length)
	    return str;
	else
	    return String(str).substring(0,n);
}
