image1=new Image;
image1.src="/images/logo.jpg";

image2=new Image;
image2.src="/images/architectural_photography/ARCD-7746-th.jpg";

image3=new Image;
image3.src="/images/architectural_photography/ARCD-8096-th.jpg";

image4=new Image;
image4.src="/images/architectural_photography/ARCD-7243-th.jpg";

image5=new Image;
image5.src="/images/architectural_photography/ARCD-9212-th.jpg";

image6=new Image;
image6.src="/images/architectural_photography/ARC4x5-5946-th.jpg";

image7=new Image;
image7.src="/images/architectural_photography/ARCD-8661-th.jpg";

image8=new Image;
image8.src="/images/architectural_photography/ARCD-8674-th.jpg";

image9=new Image;
image9.src="/images/architectural_photography/architecture_interiors.gif";

var newwindow

function popitup(url , title, location, client) {
if (newwindow && !newwindow.closed) 
{ newwindow.focus(); newwindow.document.clear() } 
else 
{ newwindow=window.open('','','width=800,height=720,resizable=0,location=0,scrollbars=0,menubar=no,toolbar=0') }
newwindow.document.writeln('<html> <head> <title>' + title + '</title><link href=\"/css/main.css\" rel=\"stylesheet\" type=\"text/css\" /></head><body style=\"background-color:#000000;\"><center>');
newwindow.document.writeln('<br><span style=\"text-align:right; width:95%; display:block;\"><a href=\"javascript:void(window.close())\"><span style=\"font-size:10px; text-transform:uppercase; background-color:#111111; border:1px solid #666666; padding-left:4px; padding-right:4px;\">close window</span></a></span>');
newwindow.document.writeln('<img src=\"/images/architectural_photography/enlarged' + url + '" class=\"portfolio_photo\"><br>');
newwindow.document.writeln('<br><span class=\"photo_txt">' + location + '</span><br>');
newwindow.document.writeln('<br><span class=\"photo_txt">' + client + '</span><br>');
newwindow.document.writeln('<br><br><div class=\"grey_border\" style=\"width:100%\"><div class=\"footer\"><span class=\"footer_txt\">Roger Wade is a member of the <a href=\"http://www.asmp.org\">American Society of Media Photographers (ASMP)</a> and <a href=\"http://www.editorialphoto.com/\">Editorial Photographers (EP)</a><br /><br />All images and content appearing within this site &copy; 2006-2011 Roger Wade Studio, Inc. All rights reserved.</span></div></div><br>');
newwindow.document.writeln('</center> </body> </html>');
newwindow.document.close();
}

function tidy()
{
if (newwindow && !newwindow.closed) { newwindow.close(); } 
}

var num = 2;
var max = 9;

function startFade() {
  opacity('i' + num, 0, 100, 500);
  
  num++;
  

  if (num <= max) {
    setTimeout("startFade()", 200);
  }
  else {
	 setTimeout("showMenu()", 500);
  }
}

function opacity(id, opacStart, opacEnd, millisec) {
	//speed for each frame
	var speed = Math.round(millisec / 100);
	var timer = 0;

	//determine the direction for the blending, if start and end are the same nothing happens
	if(opacStart > opacEnd) {
		for(i = opacStart; i >= opacEnd; i--) {
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	} else if(opacStart < opacEnd) {
		for(i = opacStart; i <= opacEnd; i++)
			{
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	}
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
	var object = document.getElementById(id).style; 
	object.opacity = (opacity / 100);
	object.MozOpacity = (opacity / 100);
	object.KhtmlOpacity = (opacity / 100);
	object.filter = "alpha(opacity=" + opacity + ")";
}

function shiftOpacity(id, millisec) {
	//if an element is invisible, make it visible, else make it invisible
	if(document.getElementById(id).style.opacity == 0) {
		opacity(id, 0, 100, millisec);
	} else {
		opacity(id, 100, 0, millisec);
	}
}

function currentOpac(id, opacEnd, millisec) {
	//standard opacity is 100
	var currentOpac = 100;
	
	//if the element has an opacity set, get it
	if(document.getElementById(id).style.opacity < 100) {
		currentOpac = document.getElementById(id).style.opacity * 100;
	}

	//call for the function that changes the opacity
	opacity(id, currentOpac, opacEnd, millisec)
}

function showMenu () {
	document.getElementById("menu").style.visibility='visible';
	/*document.getElementsByName("menuLink").style.color='#ffcc33';
	setTimeout("changeColor()", 200)*/
}

function changeColor () {
	document.getElementsByName("menuLink").style.color='#9999cc';
}

