
$(document).ready( function() { 
	$('a#zoom_image').fancybox({
		'overlayshow': true,
		'zoomSpeedIn': 400,
		'zoomSpeedOut': 400
	});
});
		
function gojourney() 
{
  	var sel = document.getElementById("journey_dropdown");
  	var alias = sel.value;
	if (alias != '') window.location = "/journey/index/"+alias;
}
function goartist() 
{
  	var sel = document.getElementById("artists_dropdown");
  	var alias = sel.value;
	if (alias != '') {
		if (alias == 'all') window.location = "/artists";
		else window.location = "/artist/index/"+alias;
	}
}
function gofilter() 
{
  	var sel = document.getElementById("filter_dropdown");
  	var alias = sel.value;
	if (alias != '') {
		if (alias == 'journey') window.location = "/journeys";
		else window.location = "/journeys/index/"+alias;
	}
}
function gomedium() 
{
  	var sel = document.getElementById("medium_dropdown");
  	var alias = sel.value;
	if (alias != '') {
		window.location = "/medium/index/"+alias;
	}
}
function gocontributor() 
{
  	var sel = document.getElementById("contributor_dropdown");
  	var alias = sel.value;
	if (alias != '') {
		window.location = "/contributor/index/"+alias;
	}
}
function golocation() 
{
  	var sel = document.getElementById("location_dropdown");
  	var alias = sel.value;
	if (alias != '') {
		window.location = "/location/index/"+alias;
	}
}
function confirmDelete()
{
	var decide = confirm('Are you sure you want to delete this?');
	if (decide) return true;
	else return false;
}

function thumbRollover(img_id, link_id, thumbnail_on) {	
	if (thumbnail_on.length > 0) MM_swapImage(img_id, '', thumbnail_on, 1);
	document.getElementById(link_id).style.color = '#f30';
}
function thumbRollout(link_id) {	
	MM_swapImgRestore();
	document.getElementById(link_id).style.color = '#fff';
}
		
function clearMe(obj){

	$(obj).value = '';
	//this.value = '';
}

function showButton(myButton){
	myButtonID = myButton + 'Button';
	myButtonOver = myButton + 'Over';
	
	$(myButtonID).hide();
	$(myButtonOver).show();
}

function hideButton(myButton){
	myButtonID = myButton + 'Button';
	myButtonOver = myButton + 'Over';
	
	$(myButtonID).show();
	$(myButtonOver).hide();
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
