$(document).ready(function(){
	$("a[rel^='prettyPhoto']").prettyPhoto({
		animation_speed: 'fast', /* fast/slow/normal */
		slideshow: false, /* false OF interval tijd in miliseconde */
		autoplay_slideshow: false, /* true/false */
		opacity: 0.80, /* Waarde tussen 0 en 1 */
		show_title: true, /* true/false */
		allow_resize: false, /* true/false */
		default_width: 500,
		default_height: 344,
		counter_separator_label: '/', /* Scheidingsteken voor galerij counter 1 "of" 2 */
		theme: 'facebook', /* light_rounded / dark_rounded / light_square / dark_square / facebook */
		modal: false, /* true, alleen de sluit knop werkt dan om de foto te sluiten */
		overlay_gallery: false, /* true, een thumbgalerij verschijnt in de foto om door te klikken */
		keyboard_shortcuts: false /* zet op false wanneer je een formulier gebruikt in de popup */
	});

	if ($('#contentzone').height()+57>$('#contentright').height()) {
		$('#contentright').height($('#contentzone').height()+57);
	}
});

$(window).resize(function () {
	if ($('#contentzone').height()+57>$('#contentright').height()) {
		$('#contentright').height($('#contentzone').height()+57);
	}
});

$(window).load(function() {
	if ($('#contentzone').height()+57>$('#contentright').height()) {
		$('#contentright').height($('#contentzone').height()+57);
	}
	if ($('#contentright').height()>$('#contentzone').height()) {
		$('#contentzone').height($('#contentright').height()-57);
	}
});

function openLytebox(title,url) {
  var el=document.createElement('a');
  el.title=title
  el.rel="prettyPhoto"
  el.href=url;
}

function bpopenwindow(url,name,features){ 
  if (url.match("bimgdirect.asp"))
  {
    url=url.replace(/bimgdirect/,"img").replace(/html/,"jpg");
	title=$("a").attr("title");
	alt=$("img").attr("alt");
    $.prettyPhoto.open(url,title,alt);
  }
  else
  {
    window.open(url,name,features);
  }
}

function resizetoright(afb,br,ho) {
 if ((afb.width>br)||(afb.height>ho))
 {
  if (afb.width>afb.height)
  {
    afb.height=(afb.height/afb.width)*ho;
    afb.width=br;
  } else{
    afb.width=(afb.width/afb.height)*br;
    afb.height=ho;  
  }
 }
}

