// check resolution
// -----------------------
var scrw = screen.width;
var scrh = screen.height;
screenRes = "640x480";
if (scrw >= "800" && scrh >= "600") {
	screenRes = "800x600";
}
if (scrw >= "1024" && scrh >= "768") {
	screenRes = "1024x768";
}


// function getDimensions()
// -----------------------
function getDimensions(URL) {

	// establish painting arrays
	var header	= new Array("URL",	"640x480W",	"640x480H",	"800x600W",	"800x600H",	"1024x768W",	"1024x768H");
	var g_pianist	= new Array("g_pianist",	"416",	"360",	"520",	"450",	"665",	"576");
	var p_asbestos_remover	= new Array("p_asbestos_remover",	"185",	"360",	"231",	"450",	"296",	"576");
	var p_bakery_factory_workers	= new Array("p_bakery_factory_workers",	"540",	"360",	"675",	"450",	"864",	"576");
	var p_barb_at_cynthias	= new Array("p_barb_at_cynthias",	"424",	"360",	"530",	"450",	"679",	"576");
	var p_barista	= new Array("p_barista",	"307",	"360",	"384",	"450",	"492",	"576");
	var p_branch_over_charles	= new Array("p_branch_over_charles",	"393",	"360",	"491",	"450",	"628",	"576");
	var p_brattle_street	= new Array("p_brattle_street",	"450",	"375",	"563",	"469",	"720",	"600");
	var p_bridge_rd	= new Array("p_bridge_rd",	"500",	"327",	"625",	"409",	"800",	"523");
	var p_brookline_ma	= new Array("p_brookline_ma",	"500",	"306",	"625",	"383",	"800",	"490");
	var p_central_square	= new Array("p_central_square",	"500",	"333",	"625",	"416",	"800",	"533");
	var p_chicago_belmont	= new Array("p_chicago_belmont",	"320",	"360",	"400",	"450",	"512",	"576");
	var p_cubister	= new Array("p_cubister",	"229",	"360",	"286",	"450",	"366",	"576");
	var p_depot_pond	= new Array("p_depot_pond",	"500",	"417",	"625",	"521",	"800",	"667");
	var p_depot_pond_cottage	= new Array("p_depot_pond_cottage",	"500",	"410",	"625",	"513",	"800",	"657");
	var p_depot_pond_w_tree	= new Array("p_depot_pond_w_tree",	"240",	"360",	"300",	"450",	"384",	"576");
	var p_diner	= new Array("p_diner",	"450",	"360",	"563",	"450",	"720",	"576");
	var p_dish_washer	= new Array("p_dish_washer",	"443",	"360",	"554",	"450",	"709",	"576");
	var p_eastham	= new Array("p_eastham",	"508",	"360",	"635",	"450",	"813",	"576");
	var p_eastham_floor	= new Array("p_eastham_floor",	"500",	"250",	"625",	"313",	"800",	"400");
	var p_eastham_interior	= new Array("p_eastham_interior",	"479",	"360",	"599",	"450",	"767",	"576");
	var p_eastham_interior_2	= new Array("p_eastham_interior_2",	"500",	"333",	"625",	"416",	"800",	"533");
	var p_en_route	= new Array("p_en_route",	"283",	"360",	"354",	"450",	"453",	"576");
	var p_espresso_drinker	= new Array("p_espresso_drinker",	"288",	"360",	"360",	"450",	"461",	"576");
	var p_fireplace	= new Array("p_fireplace",	"458",	"360",	"573",	"450",	"733",	"576");
	var p_forest_road_at_night	= new Array("p_forest_road_at_night",	"450",	"360",	"563",	"450",	"720",	"576");
	var p_four_jobs	= new Array("p_four_jobs",	"500",	"400",	"625",	"500",	"800",	"640");
	var p_glare_on_roadway	= new Array("p_glare_on_roadway",	"600",	"300",	"700",	"350",	"900",	"450");
	var p_halibut_point	= new Array("p_halibut_point",	"500",	"360",	"625",	"450",	"800",	"576");
	var p_harvard_gardens	= new Array("p_harvard_gardens",	"450",	"360",	"563",	"450",	"720",	"576");
	var p_harvard_st_interior	= new Array("p_harvard_st_interior",	"463",	"360",	"579",	"450",	"741",	"576");
	var p_hiker	= new Array("p_hiker",	"576",	"360",	"720",	"450",	"922",	"576");
	var p_hospital_waiting_room	= new Array("p_hospital_waiting_room",	"500",	"371",	"625",	"464",	"800",	"594");
	var p_impersonator	= new Array("p_impersonator",	"146",	"360",	"183",	"450",	"234",	"576");
	var p_lead_smelting_company	= new Array("p_lead_smelting_company",	"294",	"360",	"368",	"450",	"471",	"576");
	var p_lighting_a_candle	= new Array("p_lighting_a_candle",	"310",	"360",	"388",	"450",	"497",	"576");
	var p_lincoln_ma	= new Array("p_lincoln_ma",	"500",	"406",	"625",	"508",	"800",	"650");
	var p_living_room	= new Array("p_living_room",	"500",	"187",	"625",	"234",	"800",	"300");
	var p_lookout	= new Array("p_lookout",	"476",	"410",	"603",	"520",	"765",	"660");
	var p_manchester_vt	= new Array("p_manchester_vt",	"500",	"370",	"625",	"463",	"800",	"593");
	var p_maynard_ma	= new Array("p_maynard_ma",	"500",	"400",	"625",	"500",	"800",	"640");
	var p_michigan	= new Array("p_michigan",	"400",	"368",	"500",	"460",	"640",	"589");
	var p_norwottuck_ma	= new Array("p_norwottuck_ma",	"450",	"360",	"563",	"450",	"720",	"576");
	var p_norwottuck_ma_2	= new Array("p_norwottuck_ma_2",	"500",	"393",	"625",	"491",	"800",	"629");
	var p_office_worker	= new Array("p_office_worker",	"286",	"360",	"357",	"450",	"457",	"576");
	var p_pianist	= new Array("p_pianist",	"416",	"360",	"520",	"450",	"665",	"576");
	var p_pianist_print	= new Array("p_pianist_print",	"416",	"360",	"520",	"450",	"665",	"576");
	var p_poets_walk_ny	= new Array("p_poets_walk_ny",	"500",	"355",	"625",	"444",	"800",	"568");
	var p_provincetown_interior	= new Array("p_provincetown_interior",	"500",	"400",	"625",	"500",	"800",	"640");
	var p_recliner	= new Array("p_recliner",	"500",	"382",	"625",	"478",	"800",	"612");
	var p_route_65_indiana	= new Array("p_route_65_indiana",	"500",	"393",	"625",	"491",	"800",	"629");
	var p_sailor	= new Array("p_sailor",	"283",	"360",	"354",	"450",	"453",	"576");
	var p_scape_1	= new Array("p_scape_1",	"500",	"389",	"625",	"486",	"800",	"622");
	var p_scape_2	= new Array("p_scape_2",	"500",	"389",	"625",	"486",	"800",	"622");
	var p_scene_from_a_museum	= new Array("p_scene_from_a_museum",	"318",	"360",	"397",	"450",	"508",	"576");
	var p_so_swan_st_albany	= new Array("p_so_swan_st_albany",	"500",	"400",	"625",	"500",	"800",	"640");
	var p_steeple_st_providence	= new Array("p_steeple_st_providence",	"463",	"360",	"579",	"450",	"741",	"576");
	var p_three_plants	= new Array("p_three_plants",	"304",	"360",	"380",	"450",	"487",	"576");
	var p_tibetan_wall_hanging	= new Array("p_tibetan_wall_hanging",	"277",	"360",	"346",	"450",	"443",	"576");
	var p_tree	= new Array("p_tree",	"375",	"360",	"469",	"450",	"600",	"576");
	var p_under	= new Array("p_under",	"270",	"360",	"338",	"450",	"432",	"576");
	var p_used_book_seller	= new Array("p_used_book_seller",	"270",	"360",	"338",	"450",	"432",	"576");
	var p_warren_ma	= new Array("p_warren_ma",	"500",	"383",	"625",	"479",	"800",	"613");
	var p_watertown	= new Array("p_watertown",	"458",	"360",	"573",	"450",	"733",	"576");
	var p_white_cedar_swamp	= new Array("p_white_cedar_swamp",	"500",	"420",	"625",	"525",	"800",	"672");
	var p_wind_in_trees	= new Array("p_wind_in_trees",	"406",	"360",	"507",	"450",	"649",	"576");
	var p_winthrop_street	= new Array("p_winthrop_street",	"500",	"306",	"625",	"383",	"800",	"490");
	var p_word_crosser	= new Array("p_word_crosser",	"300",	"360",	"375",	"450",	"480",	"576");
	var p_writer	= new Array("p_writer",	"500",	"436",	"625",	"545",	"800",	"697");

	// establish array of painting arrays
	var paintingArrayAll = new Array(g_pianist,
									p_asbestos_remover,
									p_bakery_factory_workers,
									p_barb_at_cynthias,
									p_barista,
									p_branch_over_charles,
									p_brattle_street,
									p_bridge_rd,
									p_brookline_ma,
									p_central_square,
									p_chicago_belmont,
									p_cubister,
									p_depot_pond_cottage,
									p_depot_pond_w_tree,
									p_depot_pond,
									p_diner,
									p_dish_washer,
									p_eastham_floor,
									p_eastham_interior_2,
									p_eastham_interior,
									p_eastham,
									p_en_route,
									p_espresso_drinker,
									p_fireplace,
									p_forest_road_at_night,
									p_four_jobs,
									p_glare_on_roadway,
									p_halibut_point,
									p_harvard_gardens,
									p_harvard_st_interior,
									p_hiker,
									p_hospital_waiting_room,
									p_impersonator,
									p_lead_smelting_company,
									p_lighting_a_candle,
									p_lincoln_ma,
									p_living_room,
									p_lookout,
									p_manchester_vt,
									p_maynard_ma,
									p_michigan,
									p_norwottuck_ma_2,
									p_norwottuck_ma,
									p_office_worker,
									p_pianist_print,
									p_pianist,
									p_poets_walk_ny,
									p_provincetown_interior,
									p_recliner,
									p_route_65_indiana,
									p_sailor,
									p_scape_1,
									p_scape_2,
									p_scene_from_a_museum,
									p_so_swan_st_albany,
									p_steeple_st_providence,
									p_three_plants,
									p_tibetan_wall_hanging,
									p_tree,
									p_under,
									p_used_book_seller,
									p_warren_ma,
									p_watertown,
									p_white_cedar_swamp,
									p_wind_in_trees,
									p_winthrop_street,
									p_word_crosser,
									p_writer);


	// run loop to determine columns for width and height
	for (var i=0; i<paintingArrayAll.length; i++) {
		if (paintingArrayAll[i][0] == URL) {
			if (screenRes == '1024x768') {
				WID = paintingArrayAll[i][5];
				HEI = paintingArrayAll[i][6];
			}
			if (screenRes == '800x600') {
				WID = paintingArrayAll[i][3];
				HEI = paintingArrayAll[i][4];
			}
			if (screenRes == '640x480') {
				WID = paintingArrayAll[i][1];
				HEI = paintingArrayAll[i][2];
			}
		}
	}
}


// function openWin()
// -----------------------
function openWin(URL,WID,HEI) {
	aWindow=window.open(URL + ".html", URL + "window", "width=" + WID + ",height=" + HEI + ",toolbar=no,status=no,menubar=no,location=no,scrollbars=no,resizable=no");
	aWindow.focus();
}

// added 7/2/05 as test
// function openWinNew()
// -----------------------
function openWinNew(URL,WID,HEI) {
	aWindow=window.open("paintings_" + screenRes + "/" + URL + ".html", URL + "window", "width=" + WID + ",height=" + HEI + ",toolbar=no,status=no,menubar=no,location=no,scrollbars=no,resizable=no");
	aWindow.focus();
}


// function openWinScroll()
// -----------------------
function openWinScroll(URL,WID,HEI) {
	scrollWindow=window.open(URL + ".html", URL + "window", "width=" + WID + ",height=" + HEI + ",toolbar=no,status=no,menubar=no,location=no,scrollbars=yes,resizable=yes");
	scrollWindow.focus();
}


// function openNews()
// -----------------------
function openNews(URL,WID,HEI) {
	scrollWindow=window.open(URL, "newswindow", "width=" + WID + ",height=" + HEI + ",toolbar=no,status=no,menubar=no,location=no,scrollbars=yes,resizable=yes");
	scrollWindow.focus();
}


// function openPainting()
// -----------------------
function openPainting(URL) {
	getDimensions(URL);
	paintWindow=window.open(URL + ".html", URL + "window", "width=" + WID + ",height=" + HEI + ",toolbar=no,status=no,menubar=no,location=no,scrollbars=no,resizable=no");
	paintWindow.focus();
}


// function openCatalog()
// -----------------------
function openCatalog(URL,WID,HEI) {
	catWindow=window.open(URL, "catalogWindow", "width=" + WID + ",height=" + HEI + ",toolbar=no,status=no,menubar=no,location=no,scrollbars=yes,resizable=yes");
	catWindow.focus();
}


// blurb width and height
// -----------------------
imgBlurbW = '200';
imgBlurbH = '120';
if (screenRes == '800x600') {
	imgBlurbW = '250';
	imgBlurbH = '150';
}
if (screenRes == '1024x768') {
	imgBlurbW = '320';
	imgBlurbH = '192';
}


// copyright and floor plan width and height
// -----------------------
imgSmallSquareW = '200';
imgSmallSquareH = '200';
if (screenRes == '800x600') {
	imgSmallSquareW = '250';
	imgSmallSquareH = '250';
}
if (screenRes == '1024x768') {
	imgSmallSquareW = '320';
	imgSmallSquareH = '320';
}


// room 1-4 width and height
// -----------------------
imgRoomW = '550';
imgRoomH = '300';
if (screenRes == '800x600') {
	imgRoomW = '687';
	imgRoomH = '375';
}
if (screenRes == '1024x768') {
	imgRoomW = '880';
	imgRoomH = '480';
}

