Event.observe(window, 'load', startup);

function startup(){
	Shadowbox.init({
    	handleOversize: "drag",
    	modal: true,
    	players: ['swf', 'iframe', 'html']
	});
    galleryLink();
}

function callGallery(album){
	if(album == undefined){
		album = '';
	}else {
		album = '%26album='+album;
	}
	Shadowbox.open({
		content: 'http://apps.cooliris.com/embed/cooliris.swf?feed=api://picasaweb.google.com/?user=ibanez97'+album+'&showItemEmbed=false&showLinkOut=false&showEmbed=false&numrows=4&showTutorial=true',
        player: "swf",
        height: 1000,
        width: 1000
    });
}

function callHDR(){
	Shadowbox.open({
		content: 'http://www.passionandwarfare.net/dev/slider.php',
        player: "iframe",
        height: 1000,
        width: 1000
    });
}

function callRSVP(){
	Shadowbox.open({
		content: 'https://spreadsheets.google.com/embeddedform?formkey=dFhlbm15QUVmLWE3ZEtYeGFzOHNXelE6MQ',
		player: "iframe",
        height: 1000,
        width: 1000
    }); 
}

function galleryLink(){
    $$('a:not([id*=sb-nav])').each(function(item){
    if(item['href'].match(/#([A-Za-z0-9_]+)#/)){
    	var patt=/#([A-Za-z0-9_]+)#/;
    	var out = patt.exec(item['href']);
    	link = out[1];
    	item.setAttribute('onclick', 'callGallery("'+link+'");'); 
    	//alert(link);
   	}
    });
}

