// Gallery JavaScript 

/***********************************************
* Multi-Part Content script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

if (document.getElementById){
document.write('<style type="text/css">')
document.write('.multiparts, #formnavigation{display:none;}')
document.write('</style>')
}

var curpart=0

function getElementbyClass(classname){
partscollect=new Array()

var inc=0
var alltags=document.all? document.all : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags[i].className==classname)
partscollect[inc++]=alltags[i]
}
}

function cycleforward(){
partscollect[curpart].style.display="none"
curpart=(curpart<partscollect.length-1)? curpart+1 : 0
partscollect[curpart].style.display="block"
updatenav()
}

function cycleback(){
partscollect[curpart].style.display="none"
curpart=(curpart>0)? curpart-1 : partscollect.length-1
partscollect[curpart].style.display="block"
updatenav()
}


function updatenav(){
document.getElementById("backbutton").style.visibility=(curpart==0)? "hidden" : "visible"
document.getElementById("forwardbutton").style.visibility=(curpart==partscollect.length-1)? "hidden" : "visible"
}

function onloadfunct(){
getElementbyClass("multiparts")
partscollect[0].style.display="block"
document.getElementById("formnavigation").style.display="block"
updatenav()
}

if (window.addEventListener)
window.addEventListener("load", onloadfunct, false)
else if (window.attachEvent)
window.attachEvent("onload", onloadfunct)
else if (document.getElementById)
window.onload=onloadfunct

function generation(photo,description,height,width)
{
		
	// Create New Window With All Data In It
	
	otput=window.open("","otput","height="+height+",width="+width+",left=80,top=80 scrollbars");
	otput.document.write('<head><title>');
	otput.document.write(description);
	otput.document.write('</title></head>');	
	otput.document.write('<body style="background-color:#D8C9B6;color:black;font-family:Arial, Helvetica, sans-serif;;font-size:70%;font-weight:bold;text-align:center;">');
	otput.document.write('<img src=');
	otput.document.write(photo);
	otput.document.write(' border="0"><br>');
	otput.document.write('<strong>');
	otput.document.write(description);
	otput.document.write('<strong>');
	otput.document.write('</div></body>');
	otput.document.write('</html>');
	otput.document.close();	
}
