var g_stylename = "";
var g_color = "";
var g_fabric = "";
var g_path;
var g_className = ( document.all && !window.opera )? 'className' : 'class';

function MM_swapImage2() {
	var x,a=MM_swapImage2.arguments;
	if ((x=MM_findObj(a[0]))!=null) {
		x.src=a[2];
		x.setAttribute('title', "closeup");
		var fname = x.src.substr(x.src.lastIndexOf("/") + 1);
		if(! g_path) {
			g_path = x.src.substr(0, x.src.indexOf(fname));
		}
		setGlobalParam( fname);
		setText();
//		setThumb( fname);
		setPoplink( fname);
	}
}

function setText() {
	var obj = document.getElementById('imgtitle');
	obj.style.backgroundColor = "#ffffff";
	var p_name = document.getElementById('stylename');
	p_name.innerHTML = g_stylename;
//	p_name.innerHTML = g_stylename + " (COLOR:" + g_color + ")";
	var p_fabric = document.getElementById('fabric');
	p_fabric.innerHTML = "FABRIC : "+ g_fabric + "<br />COLOR : " + g_color;
//	p_fabric.innerHTML = "FABRIC : "+ g_fabric;
}

function setPoplink( imgName) {
	var pophtml = imgName.replace( "_mainimg", "");
//	pophtml = "pop/" + pophtml.replace( "jpg", "html");
	pophtml = "./" + pophtml.replace( "jpg", "html");
	var a_pop = document.getElementById('apop');
	a_pop.setAttribute('href', pophtml);
	a_pop.style.backgroundColor = "#000000";
	a_pop.style.display = "block";
	a_pop.onclick = function() {
		openWindow( pophtml, null, 740, 660);
		return false;
	}
}

function setGlobalParam( imgName) {
	switch( imgName){
		//jacket
		case "1102w_mainimg_01.jpg":
			g_stylename = "#1102-W ENGINEERS' JACKET-W";
			g_color = "indigo";
			g_fabric = "8oz. Blue denim lined with chambray";
			break;
		case "1102l_mainimg_01.jpg":
			g_stylename = "#1102-L ENGINEERS' JACKET-L";
			g_color = "indigo";
			g_fabric = "8oz. Blue denim lined with moleskin";
			break;
		case "2102x_mainimg_01.jpg":
			g_stylename = "2102-X ENGINEERS' JACKET2-X";
			g_color = "stone";
			g_fabric = "10oz.cotton canvas";
			break;
		case "2102xw_mainimg_01.jpg":
			g_stylename = "#2102-XW ENGINEERS' JACKET2-XW";
			g_color = "black";
			g_fabric = "Pima cotton poplin";
			break;
		case "2102sb_mainimg_01.jpg":
			g_stylename = "#2102-SB SWEETBEAR";
			g_color = "grey";
			g_fabric = "Herringbone wool lined with stripe shirting";
			break;
		case "1151_mainimg_01.jpg":
			g_stylename = "#1151 MATTALINI2";
			g_color = "indigo";
			g_fabric = "8oz. Blue denim lined with chambray";
			break;
		case "1151w_mainimg_01.jpg":
			g_stylename = "#1151-W MATTALINI2-W";
			g_color = "black";
			g_fabric = "Pima cotton poplin";
			break;
		case "1190_mainimg_01.jpg":
			g_stylename = "#1190 CARLOS3";
			g_color = "black";
			g_fabric = "cotton twill lined with moleskin";
			break;
		case "1105r_mainimg_01.jpg":
			g_stylename = "#1105-R NAVY PARKA-R";
			g_color = "indigo";
			g_fabric = "Herringbone denim";
			break;
		case "1185s_mainimg_01.jpg":
			g_stylename = "#1185-S CRUZER-S";
			g_color = "khaki";
			g_fabric = "British medium weight cotton twill";
			break;
		case "1185w_mainimg_01.jpg":
			g_stylename = "#1185-W CRUZER-W";
			g_color = "black";
			g_fabric = "Pima cotton poplin";
			break;
		case "1185_mainimg_03.jpg":
			g_stylename = "1185 CRUZER";
			g_color = "navy";
			g_fabric = "Heavy weight wool";
			break;
		case "1191_mainimg_03.jpg":
			g_stylename = "#1191 EL RANCHERO";
			g_color = "sage";
			g_fabric = "Cotton bedford pique ";
			break;
/*
		case "1172_mainimg_01.jpg":
			g_stylename = "#1172 C-POST";
			g_color = "";
			g_fabric = "";
			break;
*/
		//vest
		case "1512_mainimg_02.jpg":
			g_stylename = "#1512 ROYAL TRAVELER";
			g_color = "grey";
			g_fabric = "Herringbone wool lined with hampton twill";
			break;
		case "1504_mainimg_01.jpg":
			g_stylename = "#1504 CRUZER VEST";
			g_color = "khaki";
			g_fabric = "9oz. Ripstop";
			break;
		case "1513_mainimg_01.jpg":
			g_stylename = "#1513 ROYAL CRUZ";
			g_color = "khaki";
			g_fabric = "9oz. Ripstop";
			break;
		//shirt
/*
		case "1294_mainimg_01.jpg":
			g_stylename = "#1294 1102SHIRT";
			g_color = "";
			g_fabric = "";
			break;
*/
		case "1295_mainimg_01.jpg":
			g_stylename = "#1295 C-POST3";
			g_color = "white";
			g_fabric = "Broadcloth shirting";
			break;
		case "1295w_mainimg_01.jpg":
			g_stylename = "#1295-W C-POST3-W";
			g_color = "white";
			g_fabric = "Broadcloth shirting";
			break;
		case "1296_mainimg_01.jpg":
			g_stylename = "#1296 ZIPPER2";
			g_color = "navy";
			g_fabric = "Lt. weight moleskin";
			break;
		case "1204r_mainimg_01.jpg":
			g_stylename = "#1204-R ARMY SHIRT-R";
			g_color = "indigo";
			g_fabric = "8oz. Blue denim";
			break;
		case "1279_mainimg_01.jpg":
			g_stylename = "#1279 CRUZER SHIRT";
			g_color = "navy";
			g_fabric = "Lt. weight moleskin";
			break;
		//pants
		case "2305_mainimg_01.jpg":
			g_stylename = "#2305 No.6 Five pocket -front";
			g_color = "indigo";
			g_fabric = "15oz. Organic blue denim";
			break;
		case "2305_mainimg_02.jpg":
			g_stylename = "#2305 No.6 Five pocket -back";
			g_color = "indigo";
			g_fabric = "15oz. Organic blue denim";
			break;
		case "2305_mainimg_03.jpg":
			g_stylename = "#2305 No.6 Five pocket -side";
			g_color = "indigo";
			g_fabric = "15oz. Organic blue denim";
			break;
		case "2305_mainimg_04.jpg":
			g_stylename = "#2305 No.6 Five pocket";
			g_color = "stone";
			g_fabric = "British medium weight cotton twill";
			break;
		case "2305_mainimg_05.jpg":
			g_stylename = "#2305 No.6 Five pocket";
			g_color = "sage";
			g_fabric = "British medium weight cotton twill";
			break;
		case "2308_mainimg_01.jpg":
			g_stylename = "#2308 No.7 Five pocket -front";
			g_color = "khaki";
			g_fabric = "British medium weight cotton twill";
			break;
		case "2308_mainimg_02.jpg":
			g_stylename = "#2308 No.7 Five pocket -side";
			g_color = "khaki";
			g_fabric = "British medium weight cotton twill";
			break;
/*
		case "2307_mainimg_01.jpg":
			g_stylename = "#2307 DELAWARE";
			g_color = "";
			g_fabric = "";
			break;
		case "2306_mainimg_01.jpg":
			g_stylename = "#2306 POST CHINO3";
			g_color = "";
			g_fabric = "";
			break;
		case "1374_mainimg_01.jpg":
			g_stylename = "#1374 MENPOLINI";
			g_color = "";
			g_fabric = "";
			break;
		case "bag_1960_mainimg_01.jpg":
			g_stylename = "#1960 POST TOTE";
			g_color = "";
			g_fabric = "";
			break;
*/
		default:
			break;
	}
	
}
