var selectedHash = '';
/*
function initialize() {

	window.setInterval(function () {

		var currentHash = getLocationHash();
		
		if(selectedHash != currentHash) {
			loadPage(currentHash);
			selectedHash = currentHash;
		}

	}, 500);

}
*/

function rollOver(id){

	//Effect.Appear('bluebar_'+id, { duration: 0.3 });
	//new Effect.Opacity('bluebar_'+id,{duration:0.3, from:0.0, to:1.0});
	var element = $('bluebar_'+id);
	element.setOpacity(1);

	if( id == 'blog' || id == 'bio' || id == 'contact' )
		swapImage(id,'grey');
	else
		swapImage(id,'blue');

}

function rollOut(id){

	var element = $('bluebar_'+id);
	element.setOpacity(0);

	//Effect.Fade('bluebar_'+id, { duration: 0.3 });
//	new Effect.Opacity('bluebar_'+id, {duration:0.1, from:1.0, to:0});

	if( id == 'blog' || id == 'bio' || id == 'contact' )
		swapImage(id,'blue');
	else
		swapImage(id,'grey');

}

function swapImage(id,color){

	document.getElementById('link_'+id).src = document.getElementById(id+'_'+color).src;

}

function bluebarOpacityInit(){
	$('bluebar_weddings').setOpacity(0);
	$('bluebar_portraits').setOpacity(0);
	$('bluebar_seniors').setOpacity(0);
	$('bluebar_commercial').setOpacity(0);
}

function nextPhoto(id){
	if( document.getElementById('pic_pages_img') != null) {
		//document.getElementById('main_photo').src = document.getElementById('thumb_'+id).src;
		document.getElementById('pic_pages_img').innerHTML = document.getElementById('thumbbox_'+id).innerHTML;
		document.getElementById('next_button').innerHTML = document.getElementById('next_'+id).innerHTML;
		document.getElementById('prev_button').innerHTML = document.getElementById('prev_'+id).innerHTML;
	}

}

function getLTDimage(code)
{

	window.location.href = 'getLTD.php?code='+code;

}

function disableEnterKey(e,code)
{
	var key;     
	code += '';

	if(window.event)
		key = window.event.keyCode; //IE
	else
		key = e.which; 

	if( key == 13 ){
		getLTDimage(code);
	}

	return (key != 13);
}


