// Read parameters from URL
var parsed = window.location.search.substring(1)
var currentSize = getParm(parsed,"size")
var exif        = getParm(parsed,"exif")
var page	= getParm(parsed,"page")

// set the image size & sub-folder
if(currentSize == "") currentSize = defaultSize
if(currentSize != defaultSize)
	subDir = "size" + currentSize + "/"
else	subDir = ""


// print title navigation text
function printNavigation(where) {
	document.write('<center>')
	document.write('  <table class="mainmenu"><tr class="mainmenu">')
	document.write('      <td class="mainmenu" align="left">')
	
	// The menu ...
	
	if(where=="home") {
		document.write('<a href="' + myhomepage + '" title="goto home page" class="selectedmenu">Home</a>')
	} else {
		document.write('<a href="' + myhomepage + '" title="goto home page" class="unselectedmenu">Home</a>')
	}
	if((where=="galleries") || (where=="galleryindex")|| (where=="gallery")){
		document.write('      <a href="' + mygallery + '" title="visit the galleries" class="selectedmenu">Galleries</a>')
	} else {
		document.write('      <a href="' + mygallery + '" title="visit the galleries" class="unselectedmenu">Galleries</a>')
	}
	if(where=="blog") {
		document.write('      <a href="' + myblog + '" title="Photo-Vinc blog" class="selectedmenu">BLOG</a>')
	} else {
		document.write('      <a href="' + myblog + '" title="Photo-Vinc blog" class="unselectedmenu">BLOG</a>')
	}
/*	if(where=="prints") {
		document.write('      <a href="' + myprints + '" title="purchase a print" class="selectedmenu">Purchase</a>')
	} else {
		document.write('      <a href="' + myprints + '" title="purchase a print" class="unselectedmenu">Purchase</a>')
	} */
	if(where=="links") {
		document.write('      <a href="' + mylinks + '" title="vist selected websites" class="selectedmenu">Links</a>')
	} else {
		document.write('      <a href="' + mylinks + '" title="visit selected websites" class="unselectedmenu">Links</a>')
	}
	if(where=="news") {
		document.write('      <a href="' + mynews + '" title="read news" class="selectedmenu">News</a>')
	} else {
		document.write('      <a href="' + mynews + '" title="read news" class="unselectedmenu">News</a>')
	}
	if(where=="about") {
		document.write('      <a href="' + myabout + '" title="information about this site" class="selectedmenu">About</a>')
	} else {
		document.write('      <a href="' + myabout + '" title="information about this site" class="unselectedmenu">About</a>')
	}
	document.write('</td>')
	
	// The navigation buttons...
	
	switch (where) {
	
		case "galleryindex":
			document.write('<td align="right">')
			if (page > 1) {
			   prevPage = page - 1
			   document.write('<a href="index.htm' + indexURLparam + prevPage + '" class="navbutton" title="previous index page">')
			   document.write('<img src="'+myiconpath+'navarrowleft.gif" class="navbutton">')
			   document.write('</a>')
			} 
			else {
		   		document.write('<img src="'+myiconpath+'navarrowleftgrayed.gif" class="navbutton">')
			}
			if (page < numPages && page > 0) {
	   			nextPage = page
	   			nextPage++
   	   			document.write('<a href="'+mygallery+'" class="navbutton" title="back to galleries">')
				document.write('<img src="'+myiconpath+'navarrowup.gif" class="navbutton">')
 	   			document.write('</a>')
	   			document.write('<a href="index.htm' + indexURLparam + nextPage + '" class="navbutton" title="next index page">')
				document.write('<img src="'+myiconpath+'navarrowright.gif" class="navbutton">')
	   			document.write('</a>')
			} else {
		   		document.write('<a href="'+mygallery+'" class="navbutton" title="back to galleries">')
		   		document.write('<img src="'+myiconpath+'navarrowup.gif" class="navbutton">')
		   		document.write('</a>')
		   		document.write('<img src="'+myiconpath+'navarrowrightgrayed.gif" class="navbutton">')
			}
			document.write('</td>')
			break
	
		case "gallery":
			document.write('<td align="right">')
			if (prevURL != "") {
	   			document.write('<a href="' + prevURL + imageURLparam + '" class="navbutton" title="previous image">')
	   			document.write('<img src="'+myiconpath+'navarrowleft.gif" class="navbutton">')
	   			document.write('</a>')
			}
			else {
				document.write('<img src="'+myiconpath+'navarrowleftgrayed.gif" class="navbutton">')
			}			
	        	document.write('<a href="index.htm' + indexURLparam + '" class="navbutton" title="back to gallery index">')
	        	document.write('<img src="'+myiconpath+'navarrowup.gif" class="navbutton">')
	        	document.write('</a>')
			if (nextURL != "") {
				document.write('<a href="' + nextURL + imageURLparam + '" class="navbutton" title="next index image">')
				document.write('<img src="'+myiconpath+'navarrowright.gif" class="navbutton">')
				document.write('</a>')
			}
			else {
				document.write('<img src="'+myiconpath+'navarrowrightgrayed.gif" class="navbutton">')
			}
			document.write('</td>')
			break

		case "guestbookview":
			document.write('<td align="right">')
			if (showLeftArrow==1) {
	   			document.write('<a href="'+ myguestbookview +'?page='+(page-1)+'" class="navbutton" title="previous guestbook page">')
	   			document.write('<img src="'+myiconpath+'navarrowleft.gif" class="navbutton">')
   				document.write('</a>')
			}
			else {
				document.write('<img src="'+myiconpath+'navarrowleftgrayed.gif" class="navbutton">')
			}
			if (showRightArrow==1) {
	   			document.write('<a href="' + myguestbookview +'?page='+(page+1)+'" class="navbutton" title="next guestbook page">')
	   			document.write('<img src="'+myiconpath+'navarrowright.gif" class="navbutton">')
   				document.write('</a>')
			}
			else {
				document.write('<img src="'+myiconpath+'navarrowrightgrayed.gif" class="navbutton">')
			}
			document.write('</td>')
			break

		default:
//			document.write('<td align="right">')
//	   		document.write('<img src="'+myiconpath+'navarrowleftgrayed.gif" class="navbutton">')
//			document.write('<img src="'+myiconpath+'navarroupgrayed.gif" class="navbutton">')
//			document.write('<img src="'+myiconpath+'navarrowrightgrayed.gif" class="navbutton">')
//			document.write('</td>')
			break
	}

	document.write('    </tr>')
	document.write('  </table>')
	document.write('</center>')
}

// print title line
function printTitle(title) {
	document.write('<center>')
	document.write('<div class="titlebar">'+title+'&nbsp;</div>')
	document.write('</center>')
}


function printCopyright() {
	document.write('<center>')
	document.write('<div id="copyrightbar" class="copyrightbar">')
	document.write('<a href="http://www.photo-vinc.com/copyright.htm">Copyright</a> ')
	document.write(copyright)
	document.write(' <a href="http://www.photo-vinc.com/PHP/mail/contact.php">Vincent de Groot</a>')
	document.write('<br>&nbsp;<br><script TYPE="text/javascript" src="/PHP/Online/online.php"></script>')
    document.write('</div>')
    document.write('</center>')
}

function printCopyrightET() {
	document.write('<center>')
	document.write('<div id="copyrightbar" class="copyrightbar">')
	document.write('<a href="http://www.photo-vinc.com/copyright.htm">Copyright</a> ')
	document.write(copyright)
	document.write(' <a href="http://www.photo-vinc.com/PHP/mail/contact.php">Vincent de Groot</a>')
		document.write('<a target="_blank" href="http://t.extreme-dm.com/?login=vdegroot">')
		document.write('<img name=im src="http://t1.extreme-dm.com/i.gif" height=1 order=0 width=1 border=0 alt="">')
		document.write('</a>')
		an=navigator.appName;d=document;function
			pr(){
				d.write("<img src=\"http://t0.extreme-dm.com", "/0.gif?tag=vdegroot&j=y&srw="+srw+"&srb="+srb+"&", "rs="+r+"&l="+escape(parent.document.referrer)+"\" height=1 ","width=1>");
			}
			srb="na";srw="na";
			s=screen;srw=s.width;
			an!="Netscape"?srb=s.colorDepth:srb=s.pixelDepth;
			r=41;d.images?r=d.im.width:z=0;
			pr();
		    document.write('<br>&nbsp;<br><script TYPE="text/javascript" src="/PHP/Online/online.php"></script>')

            document.write('</div>')
            document.write('</center>')
}




// reading a variable in the parsed string
function getParm(string,parm) {
	var startPos= string.indexOf(parm+"=");
	if (startPos> -1) {
		startPos= startPos+parm.length+1;
		var endPos= string.indexOf("&",startPos);
		if (endPos== -1) endPos= string.length;
		return unescape(string.substring(startPos,endPos));
	}
	return '';
}

function bookmarklink() {
	if (navigator.appName =="Microsoft Internet Explorer") {
		document.write('<a href="javascript:window.external.addFavorite(\'http://www.photo-vinc.com\',\'Photo-Vinc\');">bookmark</a>')
	}
	else {
		document.write('bookmark')
	}
}

//function newWindow(page) {
//	OpenWin	= this.open(page, "CtrlWindow",	"toolbar=yes,menubar=yes,location=yes,scrollbars=yes,status=yes,resizable=yes");
//}

function printImgBox() {
	document.write('<table class="texttableimgbox" align="right"><tr class="texttableimgbox"><td class="texttableimgbox">')
	document.write('<img class="texttableimgbox" src="PHP/randomimages/randomimages.php?folder=../../welcome images/thumbs">')
	document.write('</td></tr></table>')
}

function Go (select) {
	top.location.href = select.options[select.options.selectedIndex].value;
}

function incpyplmail()
{
var f = document.PaypalForm;
var name = "paypal";
var at = "@";
var url = "photo-vinc.com";
f.business.value = name + at + url;
return true;
}

