var fbwindow = '' ;
var newwindow = '';
var pnewwindow = '';
var notewin = '';
var thepopup = '';
var LayerToDo = new Array(6) ; 
LayerToDo[0] = 'Gallery1' ; 
LayerToDo[1] = 'Gallery2' ; 
LayerToDo[2] = 'Gallery3' ; 
LayerToDo[3] = 'Gallery4' ; 
LayerToDo[4] = 'Gallery5' ; 
LayerToDo[5] = 'purchase' ; 
//
//
//
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

function popitupn(url) {
// alert("calling popitup:"+url);
if (notewin.location && !notewin.closed) 
{
	notewin.location.href = url; notewin.focus(); } 
else 
{
	notewin=window.open(url,'htmlname','scrollbars=yes,resizable=yes') ;
}
}
function popitup(url) {
// alert("calling popitup:"+url);

if (newwindow.location && !newwindow.closed) 
{
	newwindow.location.href = url; newwindow.focus(); } 
else 
{
	newwindow=window.open(url,'htmlname','scrollbars=yes,resizable=yes') ;
}
}
function BBshowImage(url,width,height,imagetitle,imagedesc) {
	var iwidth=parseInt(width) + 60;
	var iheight=parseInt(height) + 100 ;
	if ( ! confirm("You are about to display a large," + iwidth +
		" by " + iheight + " image in a popup window") ) {
		return;	
	}
	pnewwindow=window.open('','AWindow','top=10,left=10,width=' + iwidth + ',height=' + iheight + ',scrollbars=yes,resizable=yes') ;
	var tmp = pnewwindow.document;
	tmp.write("<html><head><title>Pastel Art</title>");
	tmp.write("<link rel='stylesheet' href='awe.css'>");
	tmp.write("<script src='george.js'></script>");
	tmp.write("</head>");
	tmp.write("<body bgcolor='white' text='black' >");
//	tmp.write("<body bgcolor='white' text='black' onLoad='self.focus()'>");
	tmp.write("<center><a href='JAVASCRIPT:doSubmit(");
	tmp.write('"close","0") ');
	tmp.write("' class='buttontext'>");
	tmp.write("<div id='mybutton'> close </div>");
	tmp.write("</a>");
        tmp.write("<font size='-2' face='Verdana, Arial, Helvetica, sans-serif'>"); 
	tmp.write( imagetitle  + "<BR>" );
	tmp.write(imagedesc  + "</font></center><hr>");
	tmp.write("<p><img src='" + url + "' width='");
	tmp.write(width + "' height='" + height ) ; 
	tmp.write("' align='middle' border='0'>"); 
        tmp.write("<div align='left'><font size='-2' face='Verdana, Arial, Helvetica, sans-serif'>Copyright "); 
	tmp.write("&copy; 2008/2009 George Curington, All rights reserved. Images on this "); 
	tmp.write("website may not be copied or altered without the written consent of ");
	tmp.write("George Curington.</font><a href='mailto:sidhartha11@yahoo.com'><font size='-2' face='Verdana, Arial, Helvetica, sans-serif'> Contact Info</font></a></div>");
//	tmp.write("<<script>self.focus()</script>>");
	tmp.write("</body>");
	tmp.writeln("</html>");
	tmp.close();
	alert("window Loaded");
	pnewwindow.focus();
}
//
//
function showPhotoImage(
		 url
		,width
		,height
		,imagetitle
		,imagedesc
		// left link
		,lurl
		,lwidth
		,lheight
		,limagetitle
		,limagedesc
		// right link
		,rurl
		,rwidth
		,rheight
		,rimagetitle
		,rimagedesc
		) {
	var iwidth=parseInt(width) + 60;
	var iheight=parseInt(height) + 100 ;
	if ( ! confirm("You are about to display a large," + iwidth +
		" by " + iheight + " image in a popup window") ) {
		return;	
	}
	pnewwindow=window.open("",'AWindow','top=10,left=10,width=' + iwidth + ',height=' + iheight + ',scrollbars=yes,resizable=yes') ;
	var tmp = pnewwindow.document;
        var thefont="<font size='-2' face='Verdana, Arial, Helvetica, sans-serif'>"; 
	var line2 = "<table border='0'><tr>" ; 
	line2=line2 + "<td><a href='javascript:self.close()' noborder>" + thefont + "close</font></a></td>";
	line2=line2 + "<td><a href='#' noborder>" + thefont + "previous</font></a></td>";
	line2=line2 + "<td><a href='#' noborder>" + thefont + "next</font></a></td>";
	line2=line2 + "</tr></table>" ; 
	line2=line2 + "</font>" ; 
        var line="<font size='-2' face='Verdana, Arial, Helvetica, sans-serif'>" +
	imagetitle  + "<BR>" +  
	imagedesc  + "<BR>" +   line2 + "</font></center><hr>" ; 
	tmp.writeln("<html><head><title>Title:" + imagetitle + " " + imagedesc + "</title></head>");
	tmp.writeln("<body><div id='para1'>" + line + "</div>");
	tmp.writeln("<img src='" + url + "' ");
	tmp.writeln("width='" + width + "' height='" + height + "' ");
	tmp.writeln("align='middle' border='0'>");
        tmp.writeln("<div align='left'><font size='-2' face='Verdana, Arial, Helvetica, sans-serif'>Copyright "); 
	tmp.writeln("&copy; 2008/2009 George Curington, All rights reserved. Images on this "); 
	tmp.write("website may not be copied or altered without the written consent of ");
	tmp.writeln("George Curington.</font><a href='mailto:sidhartha11@yahoo.com'><font size='-2' face='Verdana, Arial, Helvetica, sans-serif'> Contact Info</font></a></div>");
	tmp.writeln("</body></html>"); 
	tmp.close();
//	alert("window Loaded");
	pnewwindow.document.getElementById('para1').innerHtml=line;
	pnewwindow.focus();
}
//
//
function PopUpImage
	(url
	,width
	,height
	,imagetitle
	,number
	) {
	var iwidth=parseInt(width) + 25;
	var iheight=parseInt(height) + 120 ;
	var i = imagetitle.indexOf(".");
	var s = imagetitle.substring(0,i);
//	alert("url=" + url + "," + s );
	if ( ! confirm("You are about to display a large," + width +
		" by " + height + " image in a popup window") ) {
		return;	
	}
	if (thepopup && thepopup.open && !thepopup.closed)
	{
		thepopup.close();
	}
	thepopup=window.open("","ThePopUpWind",'top=10,left=60,width=' + iwidth + ',height=' + iheight + ',scrollbars=false,resizable=yes') ;
//
// get the associated document of the popup window
	var thedocument = thepopup.document;
//
// create a string for the close command
	var closecommand="<a href='javascript:self.close()' noborder>close</a>";
//
// display the image title and the close command
        var thebody="<font size='-2' face='Verdana, Arial, Helvetica, sans-serif'>" +
	imagetitle  + "<BR>" +  
	closecommand + "</font></center><hr>" ; 
	thedocument.writeln("<html><head>");
	thedocument.writeln("<title>Title:" + imagetitle + " " + number + "</title>");
	thedocument.writeln("<style>");
	thedocument.writeln("img {");
	thedocument.writeln("   padding:1px;");
	thedocument.writeln("   border:1px solid #021a40;");
	thedocument.writeln("   background-color:white;");
	thedocument.writeln("}");
	thedocument.writeln("</style>	");
	thedocument.writeln("</head>");
	thedocument.writeln("<body><center><div id='para1'>" + thebody + "</div></center>");
	thedocument.writeln("<img src='" + url + "' ");
	thedocument.writeln("width='" + width + "' height='" + height + "' ");
	thedocument.writeln("align='middle' border='0'></center>");
        thedocument.writeln("<div align='left'><font size='-2' face='Verdana, Arial, Helvetica, sans-serif'>Copyright "); 
	thedocument.writeln("&copy; 2008/2009 George Curington, All rights reserved. Images on this "); 
	thedocument.write("website may not be copied or altered without the written consent of ");
	thedocument.writeln("George Curington.</font><a href='mailto:sidhartha11@yahoo.com'><font size='-2' face='Verdana, Arial, Helvetica, sans-serif'> Contact Info</font></a></div>");
//	thedocument.writeln("<p><a href=\"#\" onClick=\"PopUpImage('photos/gallery/mediumdig/dig_0006.jpg',752,752,'dig_0006.jpg',2); return false\" noborder >next</a>");
	thedocument.writeln("</body></html>"); 
	thedocument.close();
//	alert("window Loaded");
//	thepopup.document.getElementById('para1').innerHtml=thebody;
	thepopup.focus();
}
function XPopUpImage(url,width,height,imagetitle,number) {
	var iwidth=parseInt(width) + 25;
	var iheight=parseInt(height) + 150 ;
	var i = imagetitle.indexOf(".");
	var s = imagetitle.substring(0,i);
	alert("url=" + url + "," + s );
//	thepopup.close();
	if ( ! confirm("You are about to display a large," + width +
		" by " + height + " image in a popup window") ) {
		return;	
	}
	if (thepopup && thepopup.open && !thepopup.closed)
	{
		thepopup.close();
	}
	thepopup=window.open("",s,'top=10,left=60,width=' + iwidth + ',height=' + iheight + ',scrollbars=false,resizable=yes') ;
	var tmp = thepopup.document;
	var line2="<a href='javascript:self.close()' noborder>close</a>";
        var line="<font size='-2' face='Verdana, Arial, Helvetica, sans-serif'>" +
	imagetitle  + "<BR>" +  
	line2 + "</font></center><hr>" ; 
	tmp.writeln("<html><head><title>Title:" + imagetitle + " " + number + "</title></head>");
	tmp.writeln("<body><center><div id='para1'>" + line + "</div></center>");
	tmp.writeln("<img src='" + url + "' ");
	tmp.writeln("width='" + width + "' height='" + height + "' ");
	tmp.writeln("align='middle' border='0'></center>");
        tmp.writeln("<div align='left'><font size='-2' face='Verdana, Arial, Helvetica, sans-serif'>Copyright "); 
	tmp.writeln("&copy; 2008/2009 George Curington, All rights reserved. Images on this "); 
	tmp.write("website may not be copied or altered without the written consent of ");
	tmp.writeln("George Curington.</font><a href='mailto:sidhartha11@yahoo.com'><font size='-2' face='Verdana, Arial, Helvetica, sans-serif'> Contact Info</font></a></div>");
	tmp.writeln("</body></html>"); 
	tmp.close();
//	alert("window Loaded");
	thepopup.document.getElementById('para1').innerHtml=line;
	thepopup.focus();
}
function showImage(url,width,height,imagetitle,imagedesc) {
	var iwidth=parseInt(width) + 60;
	var iheight=parseInt(height) + 100 ;
	if ( ! confirm("You are about to display a large," + iwidth +
		" by " + iheight + " image in a popup window") ) {
		return;	
	}
	if (pnewwindow && pnewwindow.open && !pnewwindow.closed)
	{
		pnewwindow.close();
	}
	pnewwindow=window.open("",'AWindow','top=10,left=10,width=' + iwidth + ',height=' + iheight + ',scrollbars=yes,resizable=yes') ;
	var tmp = pnewwindow.document;
	var line2="<a href='javascript:self.close()' noborder>close</a>";
        var line="<font size='-2' face='Verdana, Arial, Helvetica, sans-serif'>" +
	imagetitle  + "<BR>" +  
	imagedesc  + "<BR>" +   line2 + "</font></center><hr>" ; 
	tmp.writeln("<html><head><title>Title:" + imagetitle + " " + imagedesc + "</title>");
	tmp.writeln("<style>");
	tmp.writeln("img {");
	tmp.writeln("   padding:1px;");
	tmp.writeln("   border:1px solid #021a40;");
	tmp.writeln("   background-color:white;");
	tmp.writeln("}");
	tmp.writeln("</style>	");
	tmp.writeln("</head>");
	tmp.writeln("<body><center><div id='para1'>" + line + "</div></center>");
	tmp.writeln("<img src='" + url + "' ");
	tmp.writeln("width='" + width + "' height='" + height + "' ");
	tmp.writeln("align='middle' border='0'>");
        tmp.writeln("<div align='left'><font size='-2' face='Verdana, Arial, Helvetica, sans-serif'>Copyright "); 
	tmp.writeln("&copy; 2008/2009 George Curington, All rights reserved. Images on this "); 
	tmp.write("website may not be copied or altered without the written consent of ");
	tmp.writeln("George Curington.</font><a href='mailto:sidhartha11@yahoo.com'><font size='-2' face='Verdana, Arial, Helvetica, sans-serif'> Contact Info</font></a></div>");
	tmp.writeln("</body></html>"); 
	tmp.close();
//	alert("window Loaded");
//	pnewwindow.document.getElementById('para1').innerHtml=line;
	pnewwindow.focus();
}
function popitupxy(url,width,height) {
// alert("calling popitup:"+url);

	pnewwindow=window.open('','popupwindow','top=50,left=10,width=' + width + ',height=' + height + ',scrollbars=yes,resizable=yes') ;
	var tmp = pnewwindow.document;
	tmp.writeln('<html><head><title>popup</title><BR>');
	tmp.writeln('</head><BR>');
	tmp.writeln('<link rel="stylesheet" href="awe.css"><BR>');
	tmp.writeln('<script src="george.js"></script><BR>');
	tmp.writeln('<body><BR>');
	tmp.writeln('<p><img src="' + url + '" width="');
	tmp.writeln(width + '" height="' + height ) ; 
	tmp.writeln('" align="middle" border="0">'); 
	tmp.writeln('<a href="JAVASCRIPT:doSubmit(');
	tmp.writeln("'close','0') ");
	tmp.writeln('"class="buttontext">');
	tmp.writeln('<div id="mybutton"> close </div>');
	tmp.writeln('</a>');
        tmp.writeln('<div align="left"><font size="-2" face="Verdana, Arial, Helvetica, sans-serif">Copyright '); 
	tmp.writeln('&copy; 2008/2009 George Curington, All rights reserved. Images on this '); 
	tmp.writeln('website may not be copied or altered without the written consent of ');
	tmp.writeln('George Curington.</font><a href="mailto:sidhartha11@yahoo.com"><font size="-2" face="Verdana, Arial, Helvetica, sans-serif"> Contact Info</font></a></div>');
	tmp.writeln('</body>');
	tmp.writeln('</html>');
//
//	tmp.write('</head><body><p>this is once again a popup.</p>');
//	tmp.write('class="buttontext">');
//	tmp.write('<div id="mybutton"> close </div>');
//	tmp.write('</a>');
//

}

function tidy()
{
if (newwindow.location && !newwindow.closed) { newwindow.close(); } 
}

//Routines specifically for popup feedback windows

function fbpopitup(url) {
if (fbwindow && !fbwindow.closed) 
	{ fbwindow.location.href = url; fbwindow.focus(); } 
else 
	{ fbwindow=window.open(url,'fhtmlname','width=1000,height=800,resizable=1,scrollbars=1,top=50,left=10'); }
}
function fbtidy(){
if (fbwindow && !fbwindow.closed) {fbwindow.close(); } }

function doSubmit(var1, var2) {
self.close();
}
function MakeVisible(str) {
document.getElementById(str).style.visibility="visible";
}
function MakeInvisible(str) { 
document.getElementById(str).style.visibility="hidden";
}
function ShowIt(str) { 
// alert("str=" + str);
if ( str == 'Gallery 1' ) {
document.getElementById(LayerToDo[0]).style.visibility="visible";
document.getElementById(LayerToDo[1]).style.visibility="hidden";
document.getElementById(LayerToDo[2]).style.visibility="hidden";
document.getElementById(LayerToDo[3]).style.visibility="hidden";
document.getElementById(LayerToDo[4]).style.visibility="hidden";
document.getElementById(LayerToDo[5]).style.visibility="hidden";
}
else if ( str == 'Gallery 2' ) {
document.getElementById(LayerToDo[0]).style.visibility="hidden";
document.getElementById(LayerToDo[1]).style.visibility="visible";
document.getElementById(LayerToDo[2]).style.visibility="hidden";
document.getElementById(LayerToDo[3]).style.visibility="hidden";
document.getElementById(LayerToDo[4]).style.visibility="hidden";
document.getElementById(LayerToDo[5]).style.visibility="hidden";
}
else if ( str == 'Gallery 3' ) {
document.getElementById(LayerToDo[0]).style.visibility="hidden";
document.getElementById(LayerToDo[1]).style.visibility="hidden";
document.getElementById(LayerToDo[2]).style.visibility="visible";
document.getElementById(LayerToDo[3]).style.visibility="hidden";
document.getElementById(LayerToDo[4]).style.visibility="hidden";
document.getElementById(LayerToDo[5]).style.visibility="hidden";
}
else if ( str == 'Gallery 4' ) {
document.getElementById(LayerToDo[0]).style.visibility="hidden";
document.getElementById(LayerToDo[1]).style.visibility="hidden";
document.getElementById(LayerToDo[2]).style.visibility="hidden";
document.getElementById(LayerToDo[3]).style.visibility="visible";
document.getElementById(LayerToDo[4]).style.visibility="hidden";
document.getElementById(LayerToDo[5]).style.visibility="hidden";
}
else if ( str == 'Gallery 5' ) {
document.getElementById(LayerToDo[0]).style.visibility="hidden";
document.getElementById(LayerToDo[1]).style.visibility="hidden";
document.getElementById(LayerToDo[2]).style.visibility="hidden";
document.getElementById(LayerToDo[3]).style.visibility="hidden";
document.getElementById(LayerToDo[4]).style.visibility="visible";
document.getElementById(LayerToDo[5]).style.visibility="hidden";
}
else if ( str == 'Collectors' ) {
document.getElementById(LayerToDo[0]).style.visibility="hidden";
document.getElementById(LayerToDo[1]).style.visibility="hidden";
document.getElementById(LayerToDo[2]).style.visibility="hidden";
document.getElementById(LayerToDo[3]).style.visibility="hidden";
document.getElementById(LayerToDo[4]).style.visibility="hidden";
document.getElementById(LayerToDo[5]).style.visibility="visible";
}
else { 
	alert(str + " is not constructed yet, try back later");
}
}
function wload(url) {
if (!newwindow.closed && newwindow.location) {
		newwindow.location.href = url;
	}
	else {
		newwindow = window.open(url,'','scrollbars=no,menubar=no,height=400,width=860,resizable=yes,toolbar=no,location=no,status=no');
		if (!newwindow.opener) newwindow.opener = self;
	}
	if (window.focus) {newwindow.focus()}
	return false;
}
