/* Mouse Overs */
var imgDir = "images";
var imgFrom = 1;
var imgTo = 6;
var imgName = "menu";
var imgExt = ".gif"

function preload(imgSrc, lang) {
	if (document.images) {
	eval(imgSrc+'_off = new Image()');
	var src = imgDir + "/" + lang + "/" + imgSrc + "_off"  + imgExt;
	eval(imgSrc + '_off.src = "' + src + '"');
	
	eval(imgSrc+'_on = new Image()');
	var src = imgDir + "/" + lang + "/" + imgSrc + "_on" + imgExt;
	eval(imgSrc + '_on.src = "' + src + '"');
	}
}

function switchMenu(imgNr, imgStatus) {
	if (document.images) {
		// switch off active menu if switching on other menu
		currImg = imgName + menuOn;
		currImgObj = currImg + "_off";
		if (imgStatus == "on" && document.images[currImg]) {
			document.images[currImg].src = eval(currImgObj+".src");
		};

		image = imgName + imgNr;
		imgObj = image + "_" + imgStatus;
		if (document.images[image]){
			document.images[image].src = eval(imgObj+".src");
		} else {
			alert ("image not found");
		}

		// switch on active menu if switching off other menu
		currImg = imgName + menuOn;
		currImgObj = currImg + "_on";
		if (imgStatus == "off" && document.images[currImg]) {
			document.images[currImg].src = eval(currImgObj+".src");
		};

	}
}

function doPreload(lang) {
	for (i=imgFrom; i<=imgTo; i++) {
		preload(imgName + i, lang);
	}
} 

/* status bar */
function s(txt) {
	window.status = txt;
	return true;
} 

function rollRows(objRow,state) {
				if (state == 'ovr') { sColor = '#D5E2EA'; }
				else { sColor = '#F9FBFC'; }
				objRow.bgColor = sColor;
}

function rollRows2(objRow,state) {
				if (state == 'ovr') { sColor = '#F9FBFC'; }
				else { sColor = 'white'; }
				objRow.bgColor = sColor;
}

	/*
	picture displayer
	*/

/*
	function Picture(name, title, width, height){
		this.path = "images/galerie/" + name + ".jpg";
		this.title = title;
		this.width = width;
		this.height = height;
		this.name = name;
	}

	var pictures = new Array(
		new Picture ("foto_01","",300,225),
		new Picture ("foto_02","",300,225),
		new Picture ("foto_03","",300,225),
		new Picture ("foto_04","",300,225),
		new Picture ("foto_05","",300,225),
		new Picture ("foto_06","",300,225),
		new Picture ("foto_07","",225,300),
		new Picture ("foto_08","",300,225),
		new Picture ("foto_09","",300,225),
		new Picture ("foto_10","",300,225),
		new Picture ("foto_11","",300,225),
		new Picture ("foto_12","",300,225),
		new Picture ("foto_13","",300,225),
		new Picture ("foto_14","",300,225),
		new Picture ("foto_15","",300,225)
	);
*/

	function showPicture(filename, width, height, artikl){
		var left = xClientWidth()/2 - width/2 - 5;
		var top = 100;
		var path = "images/photo/" + filename;
		props = "menubar=no,status=no,toolbar=no,directories=no,scrollbars=no,resizable=no,top=" + top + ",left=" + left + ",width=" + (width +20) + ",height=" + (height + 20);
		
		newWin = window.open('',name,props);
		newDoc = newWin.document;
		newDoc.open();
		
		var page = "<html><head><title>EASTMOP - " + artikl + "</title></head>";
		page += "<link href=\"css/main.css\" rel=\"styleSheet\" type=\"text/css\"/>";
		page += "<body leftmargin=\"10\" topmargin=\"10\" marginheight=\"10\" marginwidth=\"10\" bgcolor=\"white\">";
/*
		page += "<table width=\"" + (width - 40) + "\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"><tr>";
		page += "<td width=\"20%\" bgcolor=\"#d84d53\"><img src=\"../images/spacer.gif\" border=\"0\" width=\"1\" height=\"3\" alt=\"\"></td>";
		page += "<td width=\"20%\" bgcolor=\"#009EDB\"><img src=\"../images/spacer.gif\" border=\"0\" width=\"1\" height=\"3\" alt=\"\"></td>";
		page += "<td width=\"20%\" bgcolor=\"#4CA27F\"><img src=\"../images/spacer.gif\" border=\"0\" width=\"1\" height=\"3\" alt=\"\"></td>";
		page += "<td width=\"20%\" bgcolor=\"#FFDA4F\"><img src=\"../images/spacer.gif\" border=\"0\" width=\"1\" height=\"3\" alt=\"\"></td>";
		page += "<td width=\"20%\" bgcolor=\"#737381\"><img src=\"../images/spacer.gif\" border=\"0\" width=\"1\" height=\"3\" alt=\"\"></td>";
		page += "</tr></table>";
*/		
		page += "<div align=\"center\"><img src=\"" + path + "\"  width=\"" + width + "\"  height=\"" + height + "\" alt=\"" + artikl + "\" hspace=\"0\" vspace=\"0\"></div>";
/*
		page += "<table width=\"" + (width - 40) + "\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"><tr>";
		page += "<td width=\"20%\" bgcolor=\"#d84d53\"><img src=\"../images/spacer.gif\" border=\"0\" width=\"1\" height=\"3\" alt=\"\"></td>";
		page += "<td width=\"20%\" bgcolor=\"#009EDB\"><img src=\"../images/spacer.gif\" border=\"0\" width=\"1\" height=\"3\" alt=\"\"></td>";
		page += "<td width=\"20%\" bgcolor=\"#4CA27F\"><img src=\"../images/spacer.gif\" border=\"0\" width=\"1\" height=\"3\" alt=\"\"></td>";
		page += "<td width=\"20%\" bgcolor=\"#FFDA4F\"><img src=\"../images/spacer.gif\" border=\"0\" width=\"1\" height=\"3\" alt=\"\"></td>";
		page += "<td width=\"20%\" bgcolor=\"#737381\"><img src=\"../images/spacer.gif\" border=\"0\" width=\"1\" height=\"3\" alt=\"\"></td>";
		page += "</tr></table>";
*/
		page += "</body></html>";
		newDoc.write(page);
		newDoc.close();
		newWin.focus();
	}
