var menuArray = Array();
var settimeout_var = Array();

function showsmenu (menu) {
	menuArray[menu] = 1;
	settimeout_var[menu] = window.setTimeout(function(){
		if(menuArray[menu] == 1){
			$('#slice'+menu).animate({right: "890px"}, 1800); 
		}
	}, 250);
}

function hidesmenu (menu) {
	menuArray[menu] = 0;
	$('#slice'+menu).animate({right: "0px"}, 1800);
	clearTimeout(settimeout_var[menu]);
}

$(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: true, /* true/false */
			default_width: 500,
			default_height: 344,
			counter_separator_label: '/', /* Scheidingsteken voor galerij counter 1 "of" 2 */
			theme: 'light_rounded', /* 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: true, /* true, een thumbgalerij verschijnt in de foto om door te klikken */
			keyboard_shortcuts: true /* zet op false wanneer je een formulier gebruikt in de popup */
		});
	});

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;  
  }
 }
}

