function _closeCreator()
{
	$.fn.colorbox.close()
}

function _openMaxWindow(url) {
    var options = 'scrollbars=yes,resizable=yes,status=no,toolbar=no,menubar=no,location=no';
    options += ',width=' + screen.availWidth + ',height=' + screen.availHeight;
    options += ',screenX=0,screenY=0,top=0,left=0';
    var win = window.open(url, '', options);
    if (!win) {
    	alert("Please disable your popup blocker for this site and click LAUNCH again");
    	return;
    }
    win.focus();
    win.moveTo(0, 0);
    win.resizeTo(screen.availWidth, screen.availHeight);
}

var _currentGalleryPage = 0;

function _initGallery() {
 $("#gallery-prev").hide();
 $("#gallery-controls").css("margin-left", 130);
 if ($("#gallery").children().length == 1) {
	 $("#gallery-next").hide();
 }
}

function _galleryPrev() {
	_currentGalleryPage -= 1;
  if (_currentGalleryPage <= 0) {
	  _currentGalleryPage = 0;
	 $("#gallery-prev").hide();
   $("#gallery-controls").css("margin-left", 130);
  } else {
	 $("#gallery-prev").show();
   $("#gallery-controls").css("margin-left", 95);
  }
  if (_currentGalleryPage >= $("#gallery").children().length - 1) {
	  _currentGalleryPage = $("#gallery").children().length - 1;
   $("#gallery-next").hide();
  } else {
   $("#gallery-next").show();
  }
  $("#gallery-mask").animate({scrollLeft: 200 * _currentGalleryPage});
  return false;
}

function _galleryNext() {
	_currentGalleryPage += 1;
  if (_currentGalleryPage <= 0) {
	  _currentGalleryPage = 0;
   $("#gallery-prev").hide();
   $("#gallery-controls").css("margin-left", 130);
  } else {
   $("#gallery-prev").show();
   $("#gallery-controls").css("margin-left", 95);
  }
  if (_currentGalleryPage >= $("#gallery").children().length - 1) {
	  _currentGalleryPage = $("#gallery").children().length - 1;
   $("#gallery-next").hide();
  } else {
   $("#gallery-next").show();
  }
  $("#gallery-mask").animate({scrollLeft: 200 * _currentGalleryPage});
  return false;
}
