// Various Preferences
var numColumns    = 4		// The number of columns on each index page
var numRows       = 3		// The number of rows on each index page
var showExif      = 0		// set to 1 to show EXIF data
var showComment   = 0		// set to 1 to show image comment field
var navigAsThumbs = 0		// set to 1 to show thumbs for prev. & next images
var sizesAsThumbs = 0		// set to 1 to show thumbs for image variations


// Personal information
var baseURL      = "http://www.photo-vinc.com/"
var myname       = ""		// if blank @owner@ will be used
var myhomepage   = baseURL + ""
var myiconpath   = baseURL + "icons/"
var mygallery    = baseURL + "Portfolio/index.php"
var myblog       = baseURL + "PHP/blog/index.php"
var myabout      = baseURL + "about.php"
var myprints     = baseURL + "prints.php"
var mycopyright  = baseURL + "copyright.php"
var mycontact    = baseURL + "PHP/mail/contact.php"
var mymailinglist= baseURL + "PHP/txtlist/mailinglist.php"
var mynews       = baseURL + "PHP/rssnews/index.php"
var copyright    = "&copy; 1999-2011"


// Image sizes and description
var size = new Array()
var sizename      = "other sizes:"
var defaultSize   = 1
size[1] = "" 			// only one size (default)


// 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 ...
	
	document.write('<a href="' + myhomepage + '" title="Home page" class="unselectedmenu">Home</a>')
	document.write('<a href="' + mygallery + '" title="Slide shows" class="unselectedmenu">Galleries</a>')
	document.write('<a href="' + myblog + '" title="Actual work" class="unselectedmenu">BLOG</a>')
	document.write('<a href="' + mymailinglist + '" title="Subscribe to the mailinglist" class="unselectedmenu">Mailing list</a>')
	document.write('<a href="' + myprints + '" title="Arder a real Vincent de Groot for your wall" class="unselectedmenu">Purchase prints</a>')
	document.write('<a href="' + mynews + '" title="Read photography industry news" class="unselectedmenu">News</a>')
	document.write('<a href="' + myabout + '" title="Secrets about Vincent de Groot" class="unselectedmenu">About</a>')
	document.write('<a href="' + mycontact + '" title="Send mail to Vincent de Groot" class="unselectedmenu">Contact</a>')
	document.write('</td>')
	
	// The navigation buttons...
	
	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>')
}

// 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 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;
}

// google analytics
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-4773685-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();


function blogContentGen(folder)
{	this.id = folder;	
	this.cboxref = 'cbox'+folder;
	this.images = new Array();
	this.descriptions = new Array();

	this.setThumb = function(img, descr)
	{	this.thumbImg = img;
		this.thumbDescr = descr;
	}

	this.addImage = function(img, descr)
	{	this.images.push(img);
		this.descriptions.push(descr);
	}
	
	this.showContent = function()
	{	document.write('<p><a title="' + this.thumbDescr + '" rel="' + this.cboxref + '" href="/PHP/blog/media/blogs/all/' + this.id + '/' + this.images[0] + '">');
		document.write('<img src="/PHP/blog/media/blogs/all/' + this.id + '/' + this.thumbImg + '" alt="" /></a></p>');
		document.write('<div align="right"><i>');
		if (this.images.length == 2)
		{	document.write('<p>- View this image in a gallery with <a title="' + this.descriptions[0] + '" rel="' + this.cboxref + 'a" href="/PHP/blog/media/blogs/all/' + this.id + '/' + this.images[0] + '">');
			document.write(' one additional large image.</a></p>');
		}
		else
		{
			if (this.images.length > 2)
			{	document.write('<p>- View this image in a gallery with <a title="' + this.descriptions[0] + '" rel="' + this.cboxref + 'a" href="/PHP/blog/media/blogs/all/' + this.id + '/' + this.images[0] + '">');
				document.write((this.images.length-1) + ' additional large images.</a></p>');
			}
			else
			{	document.write('<p>- View this image as <a title="' + this.descriptions[0] + '" rel="' + this.cboxref + 'a" href="/PHP/blog/media/blogs/all/' + this.id + '/' + this.images[0] + '">');
				document.write('large version.</a></p>');
			}
		}
		document.write('</i></div>');

		for (var i=1; i < this.images.length; i++)
		{	document.write('<a title="' + this.descriptions[i] + '" rel="' + this.cboxref + '" href="/PHP/blog/media/blogs/all/' + this.id + '/' + this.images[i] + '"></a>');
			document.write('<a title="' + this.descriptions[i] + '" rel="' + this.cboxref + 'a" href="/PHP/blog/media/blogs/all/' + this.id + '/' + this.images[i] + '"></a>');
		}
		colorboxref.push(this.cboxref);
		colorboxref.push(this.cboxref + 'a');
	}
}

