function framebuster() {
	if (self.parent.frames.length != 0) self.parent.location=document.location;
}

var loadPixFlag = 0;

function loadPix() {
	if (document.images) {
		oneon = new Image(43,22);
		oneon.src = "gizmos/splash/Home2.gif";

		twoon = new Image(56,22);
		twoon.src = "gizmos/splash/About2.gif";

		threeon = new Image(50,22);
		threeon.src = "gizmos/splash/Search2.gif";

		fouron = new Image(40,22);
		fouron.src = "gizmos/splash/News2.gif";

		fiveon = new Image(45,22);
		fiveon.src = "gizmos/splash/Events2.gif";

		sixon = new Image(40,22);
		sixon.src = "gizmos/splash/Links2.gif";

		sevenon = new Image(56,22);
		sevenon.src = "gizmos/splash/ContactUs2.gif";
		
		eighton = new Image(80,22);
		eighton.src = "gizmos/CampingSelect4.gif";

		loadPixFlag = 1;
	}
}

if (document.images) {
		oneoff = new Image(43,22);
		oneoff.src = "gizmos/splash/Home1.gif";

		twooff = new Image(56,22);
		twooff.src = "gizmos/splash/About1.gif";

		threeoff = new Image(50,22);
		threeoff.src = "gizmos/splash/Search1.gif";

		fouroff = new Image(40,22);
		fouroff.src = "gizmos/splash/News1.gif";

		fiveoff = new Image(45,22);
		fiveoff.src = "gizmos/splash/Events1.gif";

		sixoff = new Image(40,22);
		sixoff.src = "gizmos/splash/Links1.gif";

		sevenoff = new Image(56,22);
		sevenoff.src = "gizmos/splash/ContactUs1.gif";
		
		eightoff = new Image(80,22);
		eightoff.src = "gizmos/CampingSelect3.gif";
}

function flipOn(imgName) {
	if (document.images && loadPixFlag) {
		imgOn = eval(imgName + "on.src");
		document[imgName].src = imgOn;
	}
}

function flipOff(imgName) {
	if (document.images && loadPixFlag) {
		imgOff = eval(imgName + "off.src");
		document[imgName].src = imgOff;
	}
}

function PopulateRegions(lang) {
	var Keyword = escape(document.AdvancedSearch.Keyword.value);
	var ProvinceID = escape(document.AdvancedSearch.ProvinceID.options[document.AdvancedSearch.ProvinceID.selectedIndex].value);
	if (lang == 1)
		location.href = location.pathname + "?Keyword="+Keyword+"&ProvinceID="+ProvinceID;
	else
		location.href = location.pathname + "?Keyword="+Keyword+"&ProvinceID="+ProvinceID+"&sl=2";
}

function PopulateLocations(lang) {

	if (document.forms) {
	
		var Keyword = escape(document.AdvancedSearch.Keyword.value);
		if (document.AdvancedSearch.ProvinceID.options)
			var ProvinceID = escape(document.AdvancedSearch.ProvinceID.options[document.AdvancedSearch.ProvinceID.selectedIndex].value);
		else
			var ProvinceID = escape(document.AdvancedSearch.ProvinceID.value);
		var RegionID = escape(document.AdvancedSearch.RegionID.options[document.AdvancedSearch.RegionID.selectedIndex].value);
		if (lang == 1)
			location.href = location.pathname + "?Keyword="+Keyword+"&ProvinceID="+ProvinceID+"&RegionID="+RegionID;
		else
			location.href = location.pathname + "?Keyword="+Keyword+"&ProvinceID="+ProvinceID+"&RegionID="+RegionID+"&sl=2";
	}
}

// Extras...

function MiniMapPopup(RID,webURL) {
	WinName = 'TrailsWin';
	URL     = webURL + 'minimap.cfm?RID=' + RID;
	switch(RID) {
		case 1:
			Width = 575;
			Height = 355;
			break;
		case 2:
			Width = 302;
			Height = 364;
			break;
		case 3:
			Width = 585;
			Height = 317;
			break;
		case 4:
			Width = 501;
			Height = 539;
			break;
		case 5:
			Width = 585;
			Height = 264;
			break;
		case 6:
			Width = 302;
			Height = 364;
			break;
		case 7:
			Width = 585;
			Height = 338;
			break;
		case 8:
			Width = 489;
			Height = 514;
			break;
		case 9:
			Width = 589;
			Height = 675;
			break;
		case 10:
			Width = 589;
			Height = 614;
			break;
		case 11:
			Width = 589;
			Height = 515;
			break;
		case 12:
			Width = 589;
			Height = 675;
			break;
		case 13:
			Width = 585;
			Height = 395;
			break;
		case 14:
			Width = 585;
			Height = 371;
			break;
		case 15:
			Width = 558;
			Height = 561;
			break;
		case 16:
			Width = 570;
			Height = 578;
			break;
		case 17:
			Width = 585;
			Height = 592;
			break;
		case 18:
			Width = 552;
			Height = 546;
			break;
		case 19:
			Width = 585;
			Height = 730;
			break;
		case 20:
			Width = 585;
			Height = 571;
			break;
		case 21:
			Width = 585;
			Height = 446;
			break;
		case 22:
			Width = 585;
			Height = 610;
			break;
		case 23:
			Width = 585;
			Height = 489;
			break;
		case 24:
			Width = 178;
			Height = 192;
			break;
		case 25:
			Width = 338;
			Height = 190;
			break;
		case 26:
			Width = 454;
			Height = 436;
			break;
		case 27:
			Width = 340;
			Height = 409;
			break;
		case 29:
			Width = 255;
			Height = 432;
			break;
		case 30:
			Width = 312;
			Height = 203;
			break;
	}
	var Params = "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=yes,width="+Width+",height="+Height+",screenX=50,screenY=50,top=50,left=50";
	if (document.images) {
		popup = open(URL,WinName,Params);
	} else {
		location.href = URL;
	}
}

function PopupWinClose(URL) {
	if (document.images) {
		opener.location = URL;
		window.close();
	} else {
		location.href = URL;	
	}
}

function startup() {
	framebuster();
	loadPix();
}

