var W3CDOM = (document.createElement && document.getElementsByTagName);

var mouseOvers = new Array();
var mouseOuts = new Array();
var W3CDOM2 = (document.createElement && document.getElementsByTagName);

var mouseOvers2 = new Array();
var mouseOuts2 = new Array();

function init()
{
	if (!W3CDOM) return;
	var nav = document.getElementById('mouseovers');
	var imgs = nav.getElementsByTagName('img');
	for (var i=0;i<imgs.length;i++)
	{
		imgs[i].onmouseover = mouseGoesOver;
		imgs[i].onmouseout = mouseGoesOut;
		var suffix = imgs[i].src.substring(imgs[i].src.lastIndexOf('.'));
		mouseOuts[i] = new Image();
		mouseOuts[i].src = imgs[i].src;
		mouseOvers[i] = new Image();
		mouseOvers[i].src = imgs[i].src.substring(0,imgs[i].src.lastIndexOf('.')) + "_omo" + suffix;
		imgs[i].number = i;
	}
	
	var nav2 = document.getElementById('mouseover2');

	if(nav2){
	var imgs2 = nav2.getElementsByTagName('img');
	for (var i=0;i<imgs2.length;i++)
	{
		imgs2[i].onmouseover = mouseGoesOver2;
		imgs2[i].onmouseout = mouseGoesOut2;
		var suffix2 = imgs2[i].src.substring(imgs2[i].src.lastIndexOf('.'));
		mouseOuts2[i] = new Image();
		mouseOuts2[i].src = imgs2[i].src;
		mouseOvers2[i] = new Image();
		mouseOvers2[i].src = imgs2[i].src.substring(0,imgs2[i].src.lastIndexOf('.')) + "_omo" + suffix;
		imgs2[i].number = i;
	}
}

function mouseGoesOver2()
{
	this.src = mouseOvers2[this.number].src;
}

function mouseGoesOut2()
{
	this.src = mouseOuts2[this.number].src;
}

}

function mouseGoesOver()
{
	this.src = mouseOvers[this.number].src;
}

function mouseGoesOut()
{
	this.src = mouseOuts[this.number].src;
}


// JK Pop up image viewer script- By JavaScriptKit.com
// Visit JavaScript Kit (http://javascriptkit.com)
// for free JavaScript tutorials and scripts
// This notice must stay intact for use

var popbackground="#974d0c"; //specify backcolor or background image for pop window
var windowtitle="View Photo";  //pop window title

function detectexist(obj){
return (typeof obj !="undefined");
}

function jkpopimage(imgpath, popwidth, popheight, textdescription){

function getpos(){
leftpos=(detectexist(window.screenLeft))? screenLeft+document.body.clientWidth/2-popwidth/2 : detectexist(window.screenX)? screenX+innerWidth/2-popwidth/2 : 0;
toppos=(detectexist(window.screenTop))? screenTop+document.body.clientHeight/2-popheight/2 : detectexist(window.screenY)? screenY+innerHeight/2-popheight/2 : 0;
toppos=100;
if (window.opera){
leftpos-=screenLeft;
toppos-=screenTop;
}
}

getpos();
var winattributes='width='+popwidth+',height='+popheight+',scrollbars=1,resizable=yes,left='+leftpos+',top='+toppos;
var bodyattribute=(popbackground.indexOf(".")!=-1)? 'background="'+popbackground+'"' : 'bgcolor="'+popbackground+'"';
if (typeof jkpopwin=="undefined" || jkpopwin.closed)
jkpopwin=window.open("","",winattributes);
else{
//getpos() //uncomment these 2 lines if you wish subsequent popups to be centered too
//jkpopwin.moveTo(leftpos, toppos)
jkpopwin.resizeTo(popwidth, popheight+30);
}
jkpopwin.document.open();
jkpopwin.document.write('<html><head><title>'+windowtitle+'</title><scr' + 'ipt language="javascript">');
jkpopwin.document.write('var arrTemp=self.location.href.split("?");');
jkpopwin.document.write('var picUrl = (arrTemp.length>0)?arrTemp[1]:""; ');
jkpopwin.document.write('var NS = (navigator.appName=="Netscape")?true:false;');
jkpopwin.document.write('function FitPic() {');
jkpopwin.document.write('       iWidth = (NS)?window.innerWidth:document.body.clientWidth;');
jkpopwin.document.write('       iHeight = (NS)?window.innerHeight:document.body.clientHeight;');
 jkpopwin.document.write('      iWidth = document.images[0].width - iWidth;');
 jkpopwin.document.write('      iHeight = document.images[0].height - iHeight;');
 jkpopwin.document.write('      window.resizeBy(iWidth, iHeight);');
 jkpopwin.document.write('      self.focus();');
jkpopwin.document.write('     };');
 jkpopwin.document.write('</scr' + 'ipt><head><body '+bodyattribute+' onload="FitPic();"><img src="'+imgpath+'" style="margin-bottom: 0.5em;"><br>'+textdescription+'</body></html>');
jkpopwin.document.close();
jkpopwin.focus();
}
