current = 1
current_text = 0

var dhtmlRange = (document.all) ? "all." : "";
var dhtmlStyle = (document.all) ? ".style" : "";
var hiddenName = (document.all) ? "hidden" : "hide";
var header = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"215\"><tr><td>";
var footer = "</td></tr></table>";

// for all but branding, dish and residence pages

function showImage (prefix, id) {
	document['image'].src = 'images/portfolio/' + prefix + '_0' + id + '.jpg'
	document['icn'+current].src = 'images/portfolio/' + prefix + '_icn0' + current +'u.jpg'
	document['icn'+id].src = 'images/portfolio/' + prefix + '_icn0' + id +'s.jpg'
	current = id
}

// for branding

function showImage2 (prefix, id) {
	if (current == 1) current = 2;
	id2 = id -1 
	document['image'].src = 'images/portfolio/' + prefix + '_0' + id + '.jpg'
	document['image2'].src = 'images/portfolio/' + prefix + '_icn0' + id2 + 'u.jpg'
	document['icn'+current].src = 'images/portfolio/' + prefix + '_icn0' + current +'u.jpg'
	document['icn'+id].src = 'images/portfolio/' + prefix + '_icn0' + id +'s.jpg'
	current = id
	txt = "(blank)"
	if (id == 2) {
		txt = "<font class=\"branding1\">Mein Bowl</font><br><font class=\"branding2\">Conveying the freshness and simplicity of Asian cuisine</font>"
	}
	else if (id == 4) {
		txt = "<font class=\"branding1\">Salsa Rico</font><br><font class=\"branding2\">Capturing the vibrant spice of an authentic Southwestern tacqueria.</font>"
	}
	else if (id == 6) {
		txt = "<font class=\"branding1\">Sky Ranch Grill</font><br><font class=\"branding2\">Bringing the taste of the wide, open spaces into the food court.</font>"
	}
	ShowMe(txt)
}

// for dish

function showImage3 (prefix, id) {
	if (current == 1) current = 2;
	id2 = id -1 
	document['image'].src = 'images/portfolio/' + prefix + '_0' + id + '.jpg'
	document['icn'+current].src = 'images/portfolio/' + prefix + '_icn0' + current +'u.jpg'
	document['icn'+id].src = 'images/portfolio/' + prefix + '_icn0' + id +'s.jpg'
	current = id
	txt = ""
	if (id == 9) {
		txt = "<a href=\"javascript://\" onclick=\"openWindow2('dish9.html', 800, 600)\" class=\"branding3\">Click here for a larger view</a>"
	}
	ShowMe(txt)
}

// for residence

function showImage4 (prefix, id) {
	if (id < 10) {
		document['image'].src = 'images/portfolio/' + prefix + '_0' + id + '.jpg'
	} else {
		document['image'].src = 'images/portfolio/' + prefix + '_' + id + '.jpg'
	}
	if (current < 10) {
		document['icn'+current].src = 'images/portfolio/' + prefix + '_icn0' + current +'u.jpg'
	} else {
		document['icn'+current].src = 'images/portfolio/' + prefix + '_icn' + current +'u.jpg'
	}
	if (id < 10) {
		document['icn'+id].src = 'images/portfolio/' + prefix + '_icn0' + id +'s.jpg'
	} else {
		document['icn'+id].src = 'images/portfolio/' + prefix + '_icn' + id +'s.jpg'
	}
	current = id
	
	if (id < 4) {
		swapResidenceText (2)
	} else {
		swapResidenceText (1)
	}
	
}

function toggleOn (prefix, id) {
	if (current != id) {
		if (id < 10) {
			document['icn'+id].src = 'images/portfolio/' + prefix + '_icn0' + id +'s.jpg'
		} else {
			document['icn'+id].src = 'images/portfolio/' + prefix + '_icn' + id +'s.jpg'
		}
	}
}

function toggleOff (prefix, id) {
	if (current != id) {
		if (id < 10) {
			document['icn'+id].src = 'images/portfolio/' + prefix + '_icn0' + id +'u.jpg'
		} else {
			document['icn'+id].src = 'images/portfolio/' + prefix + '_icn' + id +'u.jpg'
		}
	}
}

// for pop-up HTML

var dhtmlRange = (document.all) ? "all." : "";
var dhtmlStyle = (document.all) ? ".style" : "";
var hiddenName = (document.all) ? "hidden" : "hide";

// for branding

function ShowMe(txt) {
 	if (document.layers) {
		document.text1.document.write(txt)
     	document.text1.document.close()
	}
    if (document.all) {
        document.all.text1.innerHTML = txt
	}
}

// for branding

function openWindow (page, width, height) {
	if (current == 2) {
		page = "branding1.html"
	}
	if (current == 4) {
		page = "branding2.html"
	}
	if (current == 6) {
		page = "branding3.html"
	}
	window.open(page,"Connor","width=" + width + ",height=" + height + ",resizeable=no,toolbar=no,status=no,menubar=no,scrollbars=no");
}

// for dish

function openWindow2 (page, width, height) {
	window.open(page,"Connor","width=" + width + ",height=" + height + ",resizeable=yes,toolbar=no,status=no,menubar=no,scrollbars=yes");
}

function WM_preloadImages() {

// Don't bother if there's no document.images
	if (document.images) {
		if (typeof(document.WM) == 'undefined'){
	    	document.WM = new Object();
	    }
	    document.WM.loadedImages = new Array();
	    // Loop through all the arguments.
	    var argLength = WM_preloadImages.arguments.length;
	    for(arg=0;arg<argLength;arg++) {
		    // For each arg, create a new image.
	    	document.WM.loadedImages[arg] = new Image();
	    	// Then set the source of that image to the current argument.
	    	document.WM.loadedImages[arg].src = WM_preloadImages.arguments[arg];
	    }
	}
}

// swapResidenceText

function swapResidenceText (id) {
	
	txt1 = "<p class=\"portfolio\">Situated in the hills of Arlington Heights, this shingle style contemporary residence brings modern living to the suburbs.  The challenge was to transform the modest 1930's shingled bungalow into an exciting, spacious home without destroying its simple style and character.  A subtle series of layered rooflines blend the residence into it's lush landscape. With dramatic views of the surrounding hills and neighborhood, it was designed with easy flowing spaces and airy volume.     Layered floors, cathedral ceilings and overlooks create flowing vistas that expand beyond its curved glass walls onto the simple mahogany platform that extends the house into the yard.  Modern function and design were added throughout each space using custom maple and glass cabinets, display niches and garnet-slate fireplaces. Colored glass and dramatic lighting work together to create a cohesive comfortable home."
	txt2 = "<p class=\"portfolio_bold\">Transparent, new dimensions<p class=\"portfolio_italic\">Featured Homes, Rockport, Massachusetts<p class=\"portfolio\">Situated on the rocky coast of Cape Ann, the Brown's summer cottage offered a dramatic view encompassing three lighthouses. The challenge was to keep the integrity of the original cottage, while creating a distinctive year-round home that integrates seamlessly with its natural surroundings.<p class=\"portfolio\">We created a design that retained the home's New England character, while erasing the boundary between interior and exterior environments to create a new dimension of transparency. The design is a study in contrast, juxtaposing traditional contextual elements, such as the shingled siding, with contemporary forms, including glass surfaces. The dramatic curve of the roofline and exposed beam joints evoke the shape of a wooden sailing vessel, framing large windows that provide uninterrupted views of the ocean beyond. Inside, the multi-level, flow-through spaces reinforce this transparency, surrounding the original core of the cottage: the great room with its stone fireplace. On the street side, an enclosed façade and entryway preserves the family's privacy."

	if (current_text != id) {
	 	if (document.layers) {
//		alert ('NS4')
			document.text1.document.write(header+eval('txt'+id)+footer)
     		document.text1.document.close()
		}
    	else if (document.all) {
//		alert ('IE')
        	document.all.text1.innerHTML = header+eval('txt'+id)+footer
		}
   	else {
//		alert ('DOM')
    	    document.getElementById("text1").innerHTML = header+eval('txt'+id)+footer
		}
	}
}

function initPortfolio5 () {
	current = 11;
	swapResidenceText(1);
}

