$(document).ready(function(){
	
	//Cufon
	Cufon.replace('.cufon', { fontFamily: 'Frutiger LT Std', hover: true });	
	Cufon.replace('h1', { fontFamily: 'Frutiger LT Std', hover: true });
	Cufon.replace('h2', { fontFamily: 'Frutiger LT Std', hover: true });
	Cufon.replace('h3', { fontFamily: 'Frutiger LT Std', hover: true });
	Cufon.replace('.dynamic-input h4', { fontFamily: 'Frutiger LT Std', hover: true });
	Cufon.replace('.dynamic-input h5', { fontFamily: 'Frutiger LT Std', hover: true });
	Cufon.replace('.projects h4', { fontFamily: 'Frutiger LT Std', hover: true });
	

});
/**
 * function is gone show a specific image by index
 * @param theGallery {String} name of the gallary class ex: "prettyPhoto[photo]"
 * @param index {int}
 */
function showLightboxImg(theGallery, index) {
//   var theGallery = "prettyPhoto[photo]";
   $('a[rel*='+theGallery+']').each(function(i){
		   // Lightbox.prototype.start($(this));
			_self = this; // Fix scoping
			
			// Find out if the picture is part of a set
			theRel = $(this).attr('rel');
			galleryRegExp = /\[(?:.*)\]/;
			theGallery = galleryRegExp.exec(theRel);
			
			// Build the gallery array
			var images = new Array(), titles = new Array(), descriptions = new Array();
			if(theGallery){
					
					$('a[rel*='+theGallery+']').each(function(i){
						images.push($(this).attr('href'));
						titles.push($(this).find('img').attr('alt'));
						descriptions.push($(this).attr('title'));
					});
			}else{
				images = $(this).attr('href');
				titles = ($(this).find('img').attr('alt')) ?  $(this).find('img').attr('alt') : '';
				descriptions = ($(this).attr('title')) ?  $(this).attr('title') : '';
			}

			$.prettyPhoto.open(images,titles,descriptions, index);
			return false;
   });
}

function getLightBoxXml(){
	var strXML = "<ul>" +document.getElementById("lightboxlist").innerHTML + "</ul>";
	strXML = strXML.replace(/(<img)(\/?[^>]+)(>)/gim, "$1$2/>");
	strXML = strXML.replace(/\/[\s]*?\/>/gim, "/>");
	strXML = strXML.replace(/(<\/img>)/gim, "");
	strXML = strXML.replace(/rel\=prettyphoto\[photo\]/gim, "");
	//alert(strXML.toLowerCase());
	return strXML.toLowerCase();
}
