var mybrow = navigator.appName;
if (mybrow == "Microsoft Internet Explorer"){
document.write("<link type='text/css' rel='stylesheet' href='includes/styles_ie.css'>");
} else {
document.write("<link type='text/css' rel='stylesheet' href='includes/styles.css'>");
}

function loadingOff(){
	var loadobj = document.getElementById("loadgif");
	loadobj.className = "loadoff";
	}

var leftnav = [
				["Home","index.html"],
				["Portraits","portraits.html"],
				["Musicians","musicians.html"],
				["Hot97 DJs","hot97.html"],
				["Food","food.html"],
				["Personal Work","personal.html"],
				["Mangled","mangled.html"],
				["Contact","mailto:sl@spencerlloydphoto.com"]
				];
				
				

var filepath = window.location.pathname;	
var splitfilepath = filepath.split("/");
var filename = splitfilepath[splitfilepath.length -1];

var currentnum = "1";
var notitle = 0;



function writeNav(){
document.write("<table width='130' cellspacing='0' cellpadding='0' border='0' style='margin-top: 38px'>");

	for (x = 0; x < leftnav.length; x++){
	document.write("<tr>");
	//document.write("<td style='width: 12px'><img src='images/spacer.gif' width='12' height='1'><\/td>");
	document.write("<td valign='top' class='arrowcell'><img src='images/spacer.gif' width='12' height='1'><br>");
		if (((filename == "") && (notitle == 0)) || (leftnav[x][1] == filename)){
		document.write("<font style='color: #ababab'>&rarr;<\/font>");
		notitle++;
		} else {
		document.write("<br>");
		}
		//if (leftnav[x][1] == filename){
		//document.write("<img src='images/arrow.gif'>");
		//alert(leftnav[x][0]);
		//}
	document.write("<\/td>");
	document.write("<td class='navlinks'><a href='" + leftnav[x][1] + "' class='navlinks'>" + leftnav[x][0] + "<\/a><\/td>");
	document.write("<\/tr>");
	}
document.write("<\/table>");
}

function writeGal2(whichgal,galname){
	//alert(galname);
	var rownum = 0;
	document.write("<table><tr><td colspan='7' align='right' style='width: 780px; height: 20px; font-size: 11px; color: #ababab; font-family: verdana,arial,helvetica,sans-serif'>Click Image to Enlarge<\/td><\/tr><\/table>");
	document.write("<table width='780' cellpadding='0' cellspacing='12' border='0'>");
		for (galloop = 0; galloop < whichgal[0].length; galloop++){
			if (rownum == 7){
			rownum = 0;
			document.write("<\/tr><tr>");
			}
		document.write("<td><div onClick='showPic(\"" + galname + "\",\"" + whichgal[0][galloop][0] + "pic\",\"" + whichgal[0][galloop][1] + "\");' class='thumbs'><img src='" + whichcat + "/" + whichgal[0][galloop][0] + "sm.jpg'><\/div><\/td>");
		rownum++;
		}
	document.write("<\/tr><\/table>");
	}
	
	
	function writePicDivs(thisgal,galname){
		for (divloop = 0; divloop < thisgal[0].length; divloop++){
		document.write("<div id='" + thisgal[0][divloop][0] + "pic' class='hidimg'><div class='toprow'><table style='width: 800px'><tr><td align='center'><table><tr><td class='prenext'>(" + (divloop +1) + " of " + gallery1[0].length + ") |<\/td><td><div class='prenext'><font style='cursor: pointer' onClick='preDiv(" + divloop + ")'>Previous<\/font> | <font style='cursor: pointer' onClick='nextDiv(" + divloop + ")'>Next<\/font><\/div><\/td><td><div onClick='closePic(\"" + thisgal[0][divloop][0] + "pic\");' class='closex'>| Close [X]<\/div><\/td><\/tr><\/table><\/td><\/tr><\/table><\/div><center><img src='" + whichcat + "/" + thisgal[0][divloop][0] + "lg.jpg'><br><div class='captions'>" + thisgal[0][divloop][1] + "<\/div><\/center><\/div><\/div>");
		}
	}
	
	function preDiv(currentdiv){
	var visiblediv = gallery1[0][currentdiv][0] + "pic";
		if (currentdiv == 0){
			currentdiv = gallery1[0].length;
		}
	var previousdiv = gallery1[0][currentdiv -1][0] + "pic";
	var currentobj = document.getElementById(visiblediv);
	var previousobj = document.getElementById(previousdiv);
	currentobj.className =  "hidimg";
	previousobj.className =  "hidimgb";
	}
	
	function nextDiv(currentdiv){
	var visiblediv = gallery1[0][currentdiv][0] + "pic";
		if (currentdiv == gallery1[0].length -1){
			currentdiv = -1;
		}
	var nextdiv = gallery1[0][currentdiv +1][0] + "pic";
	var currentobj = document.getElementById(visiblediv);
	var nextobj = document.getElementById(nextdiv);
	currentobj.className =  "hidimg";
	nextobj.className =  "hidimgb";
	}
	
	function showPic(mygal,picid){
		if (mygal == 'gallery1'){
			for (idloop = 0; idloop < gallery1[0].length; idloop++){
			var idtemp = gallery1[0][idloop][0] + "pic";
			var objtemp = document.getElementById(idtemp);
			objtemp.className = "hidimg";
			}
		}
		
		if (mygal == 'gallery2'){
			for (idloop = 0; idloop < gallery2[0].length; idloop++){
			var idtemp = gallery2[0][idloop][0] + "pic";
			var objtemp = document.getElementById(idtemp);
			objtemp.className = "hidimg";
			}
		}
		
	//alert(picid);
	var imgobj = document.getElementById(picid);
	var allobj = document.getElementById("allcontent");
			imgobj.className = "hidimgb";
			allobj.className = "mainb";
	}
	
	
	function closePic(picid,galname){
	//alert(galname[0].length);
	//if (galname == 'gallery1'){
		//for (idloop = 0; idloop < gallery1[0].length; idloop++){
		//var idtemp = gallery1[0][idloop][0] + "pic";
		//var objtemp = document.getElementById(idtemp);
		//objtemp.className = "hidimg";
		//}
	//}
		
		var imgobj = document.getElementById(picid);
		var allobj = document.getElementById("allcontent");
		imgobj.className = "hidimg";
		allobj.className = "main";
		activepic = "";
	}
	
	function picOff(){
	//alert(activepic);
		if (activediv = "on"){
		closePic(activepic);
		activediv = "off";
		}
	}









