function new_image (file_name, file_width, file_height, title, medium, painting_height, painting_width, year, statement, file_name_large) {
	this.file_name = file_name;
	this.file_width = file_width;
	this.file_height = file_height;
	this.title = title;
	this.medium = medium;
	this.painting_height = painting_height;
	this.painting_width = painting_width;
	this.year = year;
	this.statement = statement;
	this.file_name_large = file_name_large;
}

// image_01 = new new_image("BreakfastBurrito.jpg", 350, 262, "Breakfast Burrito with No Breakfast", "Acrylic on Board", 18, 24, 2007, "");


function getQueryVariable(variable) {
  var query = window.location.search.substring(1);
  var vars = query.split("&");
  for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("=");
    if (pair[0] == variable) {
      return pair[1];
    }
  }
  return(0);
}

function getNext(num_x) {
  if (num_x == maxImages) {
  	return 0;
  } else {
  	return ((num_x * 1) + 1);
  }
}

function getPrevious(num_x) {
  if (num_x == 0) {
  	return maxImages;
  } else {
  	return ((num_x * 1) - 1);
  }
}

function genMagnify(file_name_large, title) {

  var large_text = "";

  if (file_name_large.length > 0) {
    large_text = "<a href='images/large/" + file_name_large + "' title='" + title + "' class='lightview'><img src='images/magnify2.png' border=0></a>" + large_text;
  } else {
    large_text = "<img src='images/magnify_blank.png' border=0>";
  }

  return large_text;
}

function genNumbers(num_y, max_num, file_text) {
	var num_text = "<SPAN STYLE='word-spacing:6px;'>";
	num_y = (num_y * 1) + 1;
	max_num = max_num + 1;

	for (i=1;i<=max_num;i++) {
		
		if (i == 9 ) {	
			if (i == num_y) {
				num_text = num_text + "</SPAN><BR><SPAN STYLE='word-spacing:6px;'><B>" + i + "</B> ";
			} else {
				num_text = num_text + "</SPAN><BR><SPAN STYLE='word-spacing:6px;'><A HREF='" + file_text + "?image=" + (i-1) + "' CLASS='normal'>" + i + "</A> ";
			}
		} else  if (i == 15 ) {
			if (i == num_y) {
				num_text = num_text + "</SPAN><BR><SPAN STYLE='word-spacing:5px;'><B>" + i + "</B> ";
			} else {
				num_text = num_text + "</SPAN><BR><SPAN STYLE='word-spacing:5px;'><A HREF='" + file_text + "?image=" + (i-1) + "' CLASS='normal'>" + i + "</A> ";
			}
		} else  if (i == 21 ) {
			if (i == num_y) {
				num_text = num_text + "</SPAN><BR><SPAN STYLE='word-spacing:5px;'><B>" + i + "</B> ";
			} else {
				num_text = num_text + "</SPAN><BR><SPAN STYLE='word-spacing:5px;'><A HREF='" + file_text + "?image=" + (i-1) + "' CLASS='normal'>" + i + "</A> ";
			}
		} else  if (i == 27 ) {
			if (i == num_y) {
				num_text = num_text + "</SPAN><BR><SPAN STYLE='word-spacing:5px;'><B>" + i + "</B> ";
			} else {
				num_text = num_text + "</SPAN><BR><SPAN STYLE='word-spacing:5px;'><A HREF='" + file_text + "?image=" + (i-1) + "' CLASS='normal'>" + i + "</A> ";
			}
		} else  if (i == 33 ) {
			if (i == num_y) {
				num_text = num_text + "</SPAN><BR><SPAN STYLE='word-spacing:5px;'><B>" + i + "</B> ";
			} else {
				num_text = num_text + "</SPAN><BR><SPAN STYLE='word-spacing:5px;'><A HREF='" + file_text + "?image=" + (i-1) + "' CLASS='normal'>" + i + "</A> ";
			}
		} else  if (i == 39 ) {
			if (i == num_y) {
				num_text = num_text + "</SPAN><BR><SPAN STYLE='word-spacing:5px;'><B>" + i + "</B> ";
			} else {
				num_text = num_text + "</SPAN><BR><SPAN STYLE='word-spacing:5px;'><A HREF='" + file_text + "?image=" + (i-1) + "' CLASS='normal'>" + i + "</A> ";
			}
		} else  if (i == 45 ) {
			if (i == num_y) {
				num_text = num_text + "</SPAN><BR><SPAN STYLE='word-spacing:5px;'><B>" + i + "</B> ";
			} else {
				num_text = num_text + "</SPAN><BR><SPAN STYLE='word-spacing:5px;'><A HREF='" + file_text + "?image=" + (i-1) + "' CLASS='normal'>" + i + "</A> ";
			}
		} else {
			if (i == num_y) {
				num_text = num_text + "<B>" + i + "</B> ";
			} else {
				num_text = num_text + "<A HREF='" + file_text + "?image=" + (i-1) + "' CLASS='normal'>" + i + "</A> ";
			}
		}
	}

	num_text = num_text + "</SPAN><BR>";
	return num_text;
}



