
var links = new Array("vision",21,"service",21,"staff",26,"portfolio",33,"contact",21,"honors",26);
var subtitle;
function beginBody(title,typ){
	subtitle = title.substr(0,4);
	subtitle = subtitle.toLowerCase();
	if(typ)
		bgImage = subtitle + '_cover_' + typ + '.jpg';
	else
		bgImage = subtitle + '_cover.jpg';

	document.write(''+ //<title>'+ title +' - Architerra Design Group</title>
		'<body bottommargin="0" leftmargin="0" marginheight="0" marginwidth="0" rightmargin="0" topmargin="0">'+
		'<div id="hiddenDiv" style="display:none;"></div>'+
		'<div align="center">'+
			'<table border="0" width=870 cellpadding="0" cellspacing="0" style="background:url(images/interior_bg.jpg) no-repeat;  margin-top:72px;">'+
				'<tr valign="top">'+
					'<td>'+
						'<a href="index.html"><img src="images/tpn.gif" alt="" width="224" height="200" border="0"></a><br>'+
						'<div style="border: 0px solid red; position:relative; top:10px; left:85px;">');
	writeLinks();

	document.write('</div><br><div align="right" style="border: 0px solid yellow;"><img src="images/tpn.gif" alt="" width="60" height="83" border="0"><br>'+
					'<img src="images/tpn.gif" alt="click to send email" width="100" height="18" border="0" style="position:relative;left:-22;cursor:pointer;" onclick="sendEM(\'info\',\'architerradesigngroup\',\'com\')" onmouseover="this.src=\'images/send.gif\'" onmouseout="this.src=\'images/tpn.gif\'"><br>'+
					'<img src="images/tpn.gif" alt="" width="60" height="36" border="0"><br>'+
					'<a href="http://johnhuberdesign.com"><img src="images/tpn.gif" alt="visit john huber design" width="100" height="18" border="0" style="position:relative;left:-22;" onmouseover="this.src=\'images/huberline.gif\'" onmouseout="this.src=\'images/tpn.gif\'"></a><br><br><br><br><br>'+
					'</div></td><td><a href="index.html"><img src="images/tpn.gif" alt="" width="460" height="108" border="0"></a><br>'+
					'<div style="border: 0px solid blue; background:url(images/'+ bgImage +') no-repeat" width="650" height="200" style=" width:630px; height:550px;">'+
					'<img src="images/tpn.gif" width="630" height="1" border="0"><br>');
}
function writeLinks(){
	for(i=0;i<links.length;i+=2){
	//alert(links[i].substr(0, 4));
    	document.getElementById("hiddenDiv").innerHTML += '<img src="images/'+ links[i].substr(0, 4) +'_1.gif"><img src="images/'+ links[i].substr(0, 4) +'_2.gif">';
		if(subtitle != links[i])
			document.write('<a href="'+ links[i] +'.html"><img src="images/'+ links[i].substr(0, 4) +'_1.gif" alt="" width="100" height="'+ links[i+1] +'" border="0" onmouseover="this.src=\'images/'+ links[i].substr(0, 4) +'_2.gif\';" onmouseout="this.src=\'images/'+ links[i].substr(0, 4) +'_1.gif\';"></a><br>');
		else
			document.write('<a href="'+ links[i] +'.html"><img src="images/'+ links[i].substr(0, 4) +'_2.gif" alt="" width="100" height="'+ links[i+1] +'" border="0"></a><br>');
		if(i < links.length-2){
			if(!subtitle)
				document.write('<img src="images/tpn.gif" alt="" width="10" height="16" border="0"><br>');
			else
				document.write('<img src="images/tpn.gif" alt="" width="10" height="10" border="0"><br>');
		}
    }
}
function endBody(){
	document.write('</td></tr></table></div></body>');
}
function dget(id){
	lmnt = document.getElementById(id);
	return lmnt;
}

function swapText(lmnt,txt){
	var el = dget(lmnt);
	var textNode = document.createTextNode(txt);
	while (el.hasChildNodes())
		el.removeChild(el.lastChild);
	el.appendChild(textNode);
}

function openPic(picName,end){
	newwindow = top.open('bigImage.html?name=' + picName + '&' + end,'adgPort','width=600,height=300,scrollbars=0,address=0,status=0,location=0,toolbar=0');
	newwindow.focus();
}

function onePic(picName,end){
	document.write('<table border="0" cellspacing="0" cellpadding="0"><tr><td colspan="2" rowspan="2"><table bgcolor="white" cellspacing="0" cellpadding="0"><tr><td><a href="#">');
	document.write('<img src="images/portfolio/' + picName + 't.jpg" alt="" width="200" height="133" border="0" onclick=openPic("' + picName + '",' + end + ')>');
	document.write('</a></td></tr></table></td><td><img src="images/tpn.gif" alt="" width="3" height="3" border="0"></td>');
	document.write('</tr><tr><td bgcolor="996526"><img src="images/tpn.gif" alt="" width="3" height="130" border="0"></td>');
	document.write('</tr><tr><td><img src="images/tpn.gif" alt="" width="3" height="3" border="0"></td>');
	document.write('<td bgcolor="996526"><img src="images/tpn.gif" alt="" width="197" height="3" border="0"></td>');
	document.write('<td bgcolor="996526"></td></tr></table>');
}

function sendEM(rec,dom,ext){
	location.href = "mailto:"+ rec +"@"+ dom +"."+ ext;
}
