jQuery(document).ready(function(){
	// mainmenu functions
	jQuery('#mainMenu li:first').addClass("firstItem");
	jQuery("#mainMenu li").hover(
      function () {
        jQuery(this).addClass("hovered");
      }, 
      function () {
        jQuery(this).removeClass("hovered");
      }
    );
	
	// buttons hover color
	jQuery("a.homeBtnOverlay").hover(
      function () {
        jQuery(this).siblings('h3').addClass("hovered");
      }, 
      function () {
        jQuery(this).siblings('h3').removeClass("hovered");
      }
    );
	
	// input hint
	if(jQuery('input')[0]){
		jQuery('input').hint();
	}
	
	// homeleft first paragraph
	jQuery('#homeLeft p:first').css({"font-weight":"bold"});
	
	// tell a friend
	jQuery('.closed #tellAFriend').accordion({ header: '.homeBtn', collapsible: true, active: false });
	jQuery('.opened #tellAFriend').accordion({ header: '.homeBtn', collapsible: true });
	
	// content
	jQuery('#content p:first').css({"font-weight":"bold"});
	
	// popup
	if(jQuery('.info')[0]){
		jQuery('.info').qtip({
			content: 	{ url: 'fileadmin/popups/pop.html', title: { text: ' &nbsp; ',  button: 'Sluiten' } },
			position: 	{ corner: { target: 'rightBottom',tooltip: 'bottomLeft' } },
			style: 		{ name: 'blue', tip: 'bottomLeft', border: { width: 5, radius: 10 } },
			show: 		{ when: 'click' },
			hide: 		false
		})
	}
});

function getLinkTitle(mysrc) {
	var mytitle = '';
	var myLink=document.getElementsByTagName("a");
	
	for (var i=0;i<myLink.length;i++){
		if(myLink[i].href == mysrc) {
			mytitle = myLink[i].title;
		}
    }
    return mytitle;
}
function ShowLightBoxFlash(images) {
	var nr = images.length;
	var imagesHTML = '';
	var imagesDescription = '';
	var str1 = '';
	var str2 = '';	
	
	for(i=0; i < nr; i++){
		//imagesDescription = getLinkTitle(images[i]); title="'+imagesDescription+'"
		str1 = images[i].split('/');
		str2 = str1[str1.length-1].split('.');
		imagesDescription = document.getElementById('myFlashLightboxImage_'+str2[0]).title;
		imagesHTML = imagesHTML + '<a href="'+images[i]+'" rel="lightbox" title="'+imagesDescription+'">image</a>';
	}
	
	/*imagesDescription = getLinkTitle(images[0]);
	imagesHTML = '<a href="'+images[0]+'" rel="lightbox[myflash]" title="'+imagesDescription+'">image</a>';
	*/
	document.getElementById("myFlashLightbox").innerHTML = imagesHTML;
	jQuery('#myFlashLightbox a').lightBox();
	jQuery('#myFlashLightbox').find('a').eq(0).trigger('click');
}