// Default image sizes (when not resized);
var imgWidth = 772;
var imgHeight = 600;
var imgOffset = 1;

function layerObject(id, left, top, visibility) {
	if (is.ie5||is.ns6){
		this.obj = document.getElementById(id).style;
		this.obj.left = left;
		this.obj.top = top;
		this.obj.visibility = visibility;
		return this.obj;
	}
	else if(is.ie4) {
		this.obj = document.all[id].style;
		this.obj.left = left;
		this.obj.top = top;
		this.obj.visibility = visibility;
		return this.obj;
	}
	else if(is.ns4) {
		this.obj = document.layers[id];
		this.obj.left = left;
		this.obj.top = top;
		this.obj.visibility = visibility;
		return this.obj;
	}  
}

function layerSetup() {
	backgroundLyr = new layerObject('backgroundLayer', 0,0,'visible');
}

function findSize() {
	if(is.ns4 || is.ns6) {
		available_width = innerWidth;
		available_height = innerHeight;
		layerSetup();
	} 
	else if(is.ie4 || is.ie5) {
		available_width = document.body.clientWidth;
		available_height = document.body.clientHeight;
	layerSetup();
	}
	resizeMaps();
	displayInfoBlock("none");
}

function winResize() {
	if(is.ns4 || is.ns6 || is.ie4 || is.ie5) {
		history.go(0);
	}
}

function resizeMaps() {
	var yRectT = 165;
	var yRectB = 195;
	var yCircA = 230;
	var yCircB = 155;

	var m1_left = 150;
	var m1_right = 335; // 335;
	var m2_cX = 175;
	var m3_cX = 300;
	var s1_cX = 425;
	var s2_left = 380; // 380;
	var s2_right = 445;
	var a1_left = 495;
	var a1_right = 625;
	var a2_cX = 640;

	var infoLeft = 120;
	var infoTop = 300;
	var infoWidth = 560;
	var infoHeight = 120;

	scrWidth = document.body.clientWidth;
	scrHeight = document.body.clientHeight;
	imgOffsetX = (scrWidth / imgWidth);
	imgOffsetY = (scrHeight / imgHeight);

	yRectT = yRectT * imgOffsetY;
	yRectB = yRectB * imgOffsetY;
	yCircA = yCircA * imgOffsetY;
	yCircB = yCircB * imgOffsetY;

	m1_left = m1_left * imgOffsetX;
	m1_right = m1_right * imgOffsetX;
	m2_cX = m2_cX * imgOffsetX;
	m3_cX = m3_cX * imgOffsetX;
	s1_cX = s1_cX * imgOffsetX;
	s2_left = s2_left * imgOffsetX;
	s2_right = s2_right * imgOffsetX;
	a1_left = a1_left * imgOffsetX;
	a1_right = a1_right * imgOffsetX;
	a2_cX = a2_cX * imgOffsetX;

	laundrymarket1.coords 	= (m1_left + "," + yRectT + "," + m1_right + "," + yRectB);
	laundrymarket2.coords 	= (m2_cX + "," + yCircA + ",20");
	laundrymarket3.coords 	= (m3_cX + "," + yCircA + ",20");
	solar1.coords 		= (s1_cX + "," + yCircA + ",20");
	solar2.coords 		= (s2_left + "," + yRectT + "," + s2_right + "," + yRectB);
	abs1.coords 		= (a1_left + "," + yRectT + "," + a1_right + "," + yRectB);
	abs2.coords 		= (a2_cX + "," + yCircB + ",20");

	infoLeft = infoLeft * imgOffsetX;
	infoTop = infoTop * imgOffsetY;
	infoWidth = infoWidth * imgOffsetX;
	infoHeight = infoHeight * imgOffsetY;
	infobox.style.left = infoLeft;
	infobox.style.top = infoTop;
	infobox.style.width = infoWidth;
	infobox.style.height = infoHeight;
}

function displayInfoBlock(link) {
	// display ABS info.
	if (link == "a") {
		infobox.innerHTML = 
			"<p class='info_title'>ABS Laundry Business Solutions</p>" +
			"<p class='info_text'>ABS is the leader in Laundry Information Systems, worldwide. On a daily base, over 250 laundry units in more than 20 countries are using ABS applications, supporting 17 languages.<br>&nbsp;</p>" +
			"<p class='info_text'>Please visit our site <u>www.ABSlbs.com</u> to find out what services or applications ABS can offer to you.<br>&nbsp;</p>" +
	//		"<p class='info_text'>If you're looking for a non-virtual place to meet? You can find us at the <b>Clean Show</b> on booth #647.<br>&nbsp;</p>" +
			"";
		infobox.style.display = "";
	}
	// display Laundry Market info.
	if (link == "l") {
		infobox.innerHTML = 
			"<p class='info_title'>Laundry Market</p>" +
			"<p class='info_text'>The Laundry Market™, with its services targets the suppliers of the laundry industry. But even more important than that; It targets the <b><i><u>International Laundry Industry itself</u></i></b>.<br>&nbsp;</p>" + 
			"<p class='info_text'>When you have something to sell to the laundry industry or to a <b><u>laundry colleague</b></u>, new or used, than this is the opportunity to offer your products. If you have a used washing machine or number of (used) garments ...<br>&nbsp;</p>" +
			"<p class='info_text'><center><b><i><u>The Laundry Market™ is the place to be!</u></b></i></center></p>" +
			"";
		infobox.style.display = "";
	}
	// display Solar info.
	if (link == "s") {
		infobox.innerHTML = 
			"<p class='info_title'>Solar</p>" +
			"<p class='info_text'>Solar™ is the low cost but highly ranked <b><u>Garment Tracking</u></b> application of ABS. This Windows® 2000 user interface is the best available in the market today.<br>&nbsp;</p>" +
			"<p class='info_text'>Now a <b><u>Mat Handling and Tracking</u></b> module is also available.<br>&nbsp;</p>" +
			"<p class='info_text'>Together with DataMars (RFID chips) and leading suppliers of Industrial Mats, this application has been developed ...<br>&nbsp;</p>" +
			"<p class='info_text'><center><b><i><u>...so you may expect a lot for a little!</u></b></i></center></p>" +
			"";
		infobox.style.display = "";
	}
	// display No info.
	if (link == "none") {
		infobox.style.display = "none";
	}
}

