// JavaScript Document
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->


	<!-- Hide script from old browsers
	//get values from querystring
	var args = new Object();
	var query = location.search.substring(1); 
	//alert(query)// get query string.
	var pairs = query.split(",");
	//alert("pairs=" + pairs);						//break at comma
	
	if(pairs == "") {
		//alert("nobody home");
		var hairs = new Array ("page=11","fn=01")				//break at &
		//alert("hairs=" + hairs);
		var firstpart = hairs[0].split("=");
		//alert("firstpart=" + firstpart);
		var secondpart = hairs[1].split("=");
		//alert("secondpart=" + secondpart);
	}
	else {
	//	alert("Yay, we got it")
	var hairs = query.split("&");				//break at &
	//alert("hairs=" + hairs);
	var firstpart = hairs[0].split("=");
	//alert("firstpart=" + firstpart);
	var secondpart = hairs[1].split("=");
	//alert("secondpart=" + secondpart);
	}
	
	var heading = "";
	var picnum = "";
	var hdimage = "";
	var button = "";
	var pagename = "";

	//alert(heading);	
	//this is the portion that the slideshow uses to show the images
	
	if(firstpart[1] == 111) {
		firstpart[1] = "farm-buildings";
		heading = "AGRICULTURAL &amp; FARM BUILDINGS";
		picnum = "02";
		hdimage = "hd-farm-buildings"
		button = "btn-galback";
		pagename = "steel-building-photos.htm"
		//alert(heading);
		}
	if(firstpart[1] == 121) {
		firstpart[1] = "residential";
		heading = "RESIDENTIAL STEEL BUILDINGS";
		picnum = "02";
		hdimage = "hd-farm-buildings";
		button = "btn-galback";
		pagename = "steel-building-photos.htm"
		//alert(heading);
		}
	if(firstpart[1] == 222){
		firstpart[1] = "aircraft-hangar";
		heading = "AIRCRAFT HANGAR";
		picnum = "03";
		hdimage = "hd-aircraft-hangars";
		button = "btn-galback";
		pagename = "steel-building-photos.htm"
		}
	if(firstpart[1] == 333){
		firstpart[1] = "commercial-steel-buildings";
		heading = "COMMERCIAL STEEL BUILDINGS";
		picnum = "04";
		hdimage = "hd-commercial-buildings";
		button = "btn-galback";
		pagename = "steel-building-photos.htm"
		}
	if(firstpart[1] == 444){
		firstpart[1] = "steel-garage-kits";
		heading = "STEEL GARAGE KITS";
		picnum = "05";
		hdimage = "hd-steel-garage-kits";
		button = "btn-galback";
		pagename = "steel-building-photos.htm"
		}
	if(firstpart[1] == 555){
		firstpart[1] = "government-buildings";
		heading = "GOVERNMENT BUILDINGS";
		picnum = "06";
		hdimage = "hd-government-buildings";
		button = "btn-galback";
		pagename = "steel-building-photos.htm"
		}
	if(firstpart[1] == 665){
		firstpart[1] = "industrial-buildings";
		heading = "INDUSTRIAL BUILDINGS";
		picnum = "07";
		hdimage = "hd-industrial-buildings";
		button = "btn-galback";
		pagename = "steel-building-photos.htm"
		}
	if(firstpart[1] == 777){
		firstpart[1] = "military";
		heading = "MILITARY BUILDINGS";
		picnum = "08";
		hdimage = "hd-military-buildings";
		button = "btn-galback";
		pagename = "steel-building-photos.htm"
		}
	if(firstpart[1] == 888){
		firstpart[1] = "metal-storage-sheds";
		heading = "METAL STORAGE SHEDS";
		picnum = "09";
		hdimage = "type-building-photo";
		button = "btn-galback";
		pagename = "steel-building-photos.htm"
		}
	if(firstpart[1] == 999){
		firstpart[1] = "workshops";
		heading = "GARAGE WORKSHOPS";
		picnum = "10";
		hdimage = "hd-workshops";
		button = "btn-galback";
		pagename = "steel-building-photos.htm"
		}
	/* ===============================*/
	
	if(firstpart[1] == 11) {
		firstpart[1] = "farm-buildings";
		heading = "AGRICULTURAL &amp; FARM BUILDINGS";
		picnum = "02";
		hdimage = "hd-farm-buildings";
		button = "btnBackFarm";		
		pagename = "farm-buildings.htm";
		//alert(heading);
		}
	if(firstpart[1] == 12) {
		firstpart[1] = "residential";
		heading = "RESIDENTIAL STEEL BUILDINGS";
		picnum = "02";
		hdimage = "hd-farm-buildings";
		button = "btnBackResidential";		
		pagename = "residential-buildings.htm";
		//alert(heading);
		}
	if(firstpart[1] == 22){
		firstpart[1] = "aircraft-hangar";
		heading = "AIRCRAFT HANGAR";
		picnum = "03";
		hdimage = "hd-aircraft-hangars";
		button = "btnBackHangar";		
		pagename = "aircraft-hangars.htm";
		}
	if(firstpart[1] == 33){
		firstpart[1] = "commercial-steel-buildings";
		heading = "COMMERCIAL STEEL BUILDINGS";
		picnum = "04";
		hdimage = "hd-commercial-buildings";
		button = "btnBackCommercial";		
		pagename = "commercial-steel-buildings.htm";
		}
	if(firstpart[1] == 44){
		firstpart[1] = "steel-garage-kits";
		heading = "STEEL GARAGE KITS";
		picnum = "05";
		hdimage = "hd-steel-garage-kits";
		button = "btnBackGKits";		
		pagename = "garage-kits.htm";
		}
	if(firstpart[1] == 55){
		firstpart[1] = "government-buildings";
		heading = "GOVERNMENT BUILDINGS";
		picnum = "06";
		hdimage = "hd-government-buildings";
		}
	if(firstpart[1] == 66){
		firstpart[1] = "industrial-buildings";
		heading = "INDUSTRIAL BUILDINGS";
		picnum = "07";
		hdimage = "hd-industrial-buildings";
		button = "btnBackIndustrial";		
		pagename = "industrial-steel-buildings.htm";
		}
	if(firstpart[1] == 77){
		firstpart[1] = "military";
		heading = "MILITARY BUILDINGS";
		picnum = "08";
		hdimage = "hd-military-buildings";
		button = "btnBackMilitary";		
		pagename = "military-buildings.htm";
		}
	if(firstpart[1] == 88){
		firstpart[1] = "metal-storage-sheds";
		heading = "METAL STORAGE SHEDS";
		picnum = "09";
		hdimage = "type-building-photo";
		button = "btnBackSheds";		
		pagename = "metal-storage-sheds.htm";
		}
	if(firstpart[1] == 99){
		firstpart[1] = "workshops";
		heading = "GARAGE WORKSHOPS";
		picnum = "10";
		hdimage = "hd-workshops";
		button = "btnBackWorkshops";		
		pagename = "workshops.htm";
		}
	if(firstpart[1] == 91){
		firstpart[1] = "P";
		heading = "P-MODEL ARCH BUILDINGS";
		picnum = "11";
		hdimage = "hd-workshops";
		button = "btnBackToP";
		pagename = "curvco_p.php";
		}
	if(firstpart[1] == 92){
		firstpart[1] = "S";
		heading = "S-MODEL ARCH BUILDINGS";
		picnum = "11";
		hdimage = "hd-workshops";
		button = "btnBackToS";
		pagename = "curvco_s.php";
		}
	if(firstpart[1] == 93){
		firstpart[1] = "Q";
		heading = "Q-MODEL ARCH BUILDINGS";
		picnum = "11";
		hdimage = "hd-workshops";
		button = "btnBackToQ";
		pagename = "curvco_q.php";
		}
	if (heading == null) {
			//alert("nuttin");
			heading = "WELCOME TO CURVCO STEEL STRUCTURES";
			button = "btn-galback";
			pagename = "steel-building-photos.htm"
	}
	else if (query == null) {
		//alert("OY"+heading)
		firstpart[1] = "farm-buildings";
		heading = "AGRICULTURAL &amp; FARM BUILDINGS";
		button = "btn-galback";
		pagename = "steel-building-photos.htm"
		}
		
	myPix = new Array("images/" + firstpart[1] + "/01.jpg","images/" + firstpart[1] + "/02.jpg","images/" + firstpart[1] + "/03.jpg","images/" + firstpart[1] + "/04.jpg","images/" + firstpart[1] + "/05.jpg")//,"images/" + firstpart[1] + "/06.jpg","images/" + firstpart[1] + "/07.jpg","images/" + firstpart[1] + "/08.jpg","images/" + firstpart[1] + "/09.jpg","images/" + firstpart[1] + "/10.jpg")
	thisPic = 0//originally 0
	imgCt = myPix.length - 1

	function chgSlide(direction) {//a one or minus-one gets passed into direction from the link
		if (document.images) {
			thisPic = thisPic + direction
			if (thisPic > imgCt) {
				thisPic = 0//0
			}
			if (thisPic < 0) {//originally said (thisPic < 0)
				thisPic = imgCt
			}
			document.myPicture.src=myPix[thisPic]
		}
	}	
	function writeMe(){
	document.write("<img src=images/" + firstpart[1] + "/" + secondpart[1] + ".jpg id=myPicture name=myPicture>")
	}
	function writePic() {
	document.write("<img src=images/" + hdimage + ".jpg alt=Steel Buildings id=photo />")
	}
	function writeBtn() {
	document.write("<a href=\"" + pagename + "\"><img src=images/" + button + ".gif alt=Back class=moreroom /></a>")
	}
	function brochure() {
		//alert(button);
		if (button == "btnBackGKits") {
		//alert("hey");
		document.writeln("<div class=\"ph\" align=\"center\"><a href=\"data/CurvcoSteel_Struc_brochure_pdf.pdf\">Click here to download Curvco Steel Structures brochure.<br /><img src=\"images/curvcosteel-structure-brochure.jpg\" alt=\"Click here to download our brochure.\" style=\"padding: 1px; border: 1px solid #003366;\" /></a></div>");
		}
	}
	// End hiding script from old browsers -->