/*
	Copyright David Trewern Design         :: www.dtdesign.com ::
	Unauthorised modification / use is a criminal offence, and
	will be prosecuted to the fullest extent permitted by law.
	All Rights Reserved
*/

// USE: call images 'swap_*_#.gif' in 'i' folder with:
// * = image name (must also be placed in NAVarr array below)
// # = image state : 0 = off, 1 = on

NAVarr = new Array("about", "theprojects", "awards", "news", "contacts", "pdfprojectsheet", "submitbut");
if (document.images) {
	for (var NAVitem in NAVarr) { 
		 for (var NAVicount=0; NAVicount < 2; NAVicount++) { 
				eval("b" + NAVarr[NAVitem] + NAVicount + " = new Image()");
				eval("b" + NAVarr[NAVitem] + NAVicount + ".src = 'assets/swap_" + NAVarr[NAVitem] + "_" + NAVicount + ".gif'");
		 } 
	} 
}

function BturnOn(imageName) {
	if (document.images) { document [imageName].src = eval("b" +imageName + "1.src");   }
}

function BturnOff(imageName) {
	if (document.images) { document [imageName].src = eval("b" + imageName + "0.src");   }
}

function showhide1(layer_ref, state) {
	if (document.all) { //IS IE 4 or 5 (or 6 beta)
		eval( "document.all." + layer_ref + ".style.visibility = state");
	}
	if (document.layers) { //IS NETSCAPE 4 or below
		document.layers[layer_ref].visibility = state;
	}
	if (document.getElementById && !document.all) {
		layer_x = document.getElementById(layer_ref);
		layer_x.style.visibility = state;
	}
		
}


function changefilter(val) {
	//showhide1("discipline", "hidden");
	showhide1("theme", "hidden");

	switch (val) {
		case "featured":
			self.location = "projects.aspx"
			break;
		
		case "All":
					changefilter2("discipline", "All");
			break;
		case "Urban Design":
			changefilter2("discipline", "Urban Design");
			break;
			
		case "Landscape Architecture":
			changefilter2("discipline", "Landscape Architecture");
			break;
			
		case "Planning":
			changefilter2("discipline", "Planning");
			break;

		/*
		case "discipline":
			showhide1("discipline", "visible");
			break;
		*/

		case "theme":
			showhide1("theme", "visible");
			break;

	}

}

function changefilter2(type_val, val) {
	if (val != "") {
		self.location = "projects.aspx?" + type_val + "=" + val;
	}

}

function imgpopup(imgsrc) {
	if (imgsrc != "") {
		window.open('image_popup.aspx?image=' + imgsrc, 'image_popup', 'width=400, height=400, toolbar=0, scrollbars=0, status=0, resizable=1');
	}
}

function popup(){
window.open('tract_news_video.html','video','width=400, height=225,scrollbar=1');
}
