var newwindow;
function poptastic(url, scrolls) {
	scrolls = scrolls || 0;
	if (scrolls == 0) {
		newwindow=window.open(url,'name','height=600,width=400,scrollbars=no');
	} else {
		newwindow = window.open(url,'name','height=600,width=417,scrollbars=yes');
	}
	
	if (window.focus) {newwindow.focus()}
}
function poptasticsmall(url, scrolls) {
	scrolls = scrolls || 0;
	if (scrolls == 0) {
		newwindow = window.open(url,'name','height=420,width=400,scrollbars=no');
	} else {
		newwindow = window.open(url,'name','height=420,width=417,scrollbars=yes');
	}
	
	if (window.focus) {newwindow.focus()}
}
function poptasticlarge(url, scrolls) {
	scrolls = scrolls || 0;
	if (scrolls == 0) {
		newwindow = window.open(url,'name','height=630,width=600,scrollbars=no');
	} else {
		newwindow = window.open(url,'name','height=630,width=617,scrollbars=yes');
	}
	
	if (window.focus) {newwindow.focus()}
}
function poptasticcustom(url, height, width) {
	newwindow = window.open(url,'name','height='+height+',width='+width+',scrollbars=1');
	
	if (window.focus) {newwindow.focus()}
}

jQuery.preloadImages = function() {
  for(var i = 0; i<arguments.length; i++) {
    jQuery("<img>").attr("src", arguments[i]);
  }
}


/* old code */
$(function() {
    $("#thumbs a").click(function() {
        var imageSource = $(this).attr("href");
		var caption = $(this).attr("title");	

		  $("#bath img").attr("src", imageSource)
		  $("#caption").html(caption);
          return false;
        });
});
