

function writeAddress(path) {
		document.write("<a href=\"mailto:contact@christele-lefay.net\">" );
		document.write("<img alt=\"\" ");
		document.write("src=\"" + path + "\"  height=\"19\" width=\"209\" border=\"0\">");
		document.write("</a>");
}

		
function writeLabel(no, pathpainting, pathlabel, nooftd) {
		if (!pathpainting) pathpainting = "./";
		if (!pathlabel) pathlabel = "../../";
		if (!nooftd) nooftd = 0;
		var info = getInfo(no, getLanguage());
		document.write("<tr>");
		document.write("<td height=\"10\">");
		document.write("</td></tr>");
	 	document.write("<tr>");
	 	for (i=0; i < nooftd; i++) document.write("<td></td>");
	 	document.write("<td>");
		document.write("<a href=\"javascript:show('" + no + "','" + pathpainting + "')\">" );
		document.write("<img title=\"");
		document.write(info);
		document.write("\" alt=\"");
		document.write(info);
		document.write("\" ");
		document.write("src=\"" + pathlabel + "image/common/label.gif\"  height=\"10\" width=\"15\" border=\"0\">");
		document.write("</a></td>");
		document.write("</tr>");
}
		
function getTitleAttr(no) {
	var info = getInfo(no, getLanguage());
	return info;
}

function show(obj, path) {
	var attributs = "menubar=no,resizable=yes,toolbar=no,width=" + getWidth(obj) + ",height=" + getHeight(obj) + ",scrollbars=no";
	var win = open(path + "l-"+obj+".html",obj,attributs);
	win.focus();
}	
			
function getWidth(no) {
	var width = "100";
	nu=Number(no);
	if (desc[nu]!=null) width = desc[nu][0];
	w = 120 + Number(width);
	return w;	
} 

function getHeight(no) {
	var height = "100";
	nu=Number(no);
	if (desc[nu]!=null) height = desc[nu][1];
	h = 120 + Number(height);
	return h;
}
function writeInfo(no) {
	if ((window.opener != null)&& 
		(window.opener.parent != null)) {
		document.write(getInfo(no,getLanguage(window.opener),1));
	} else {
		document.write(getInfo(no, getLanguage(),1));
	}
}

function getLanguage(w) {
	var lang="en";
	if (w==null) w= window;
	var d = w.parent.document.images;
	for (i=0; i < d.length; i++) {
		if (d[i].name == "language") {
			lang=d[i].title;
		}
	}
	return lang;
}

function getInfo(no, lang, accent) {
	var info  = "";
	var nu = Number(no);
	if (accent==null) accent = 0;
	//info =  nu + " - ";
	if (desc[nu]!=null) {
		// titre
		info += getTitle(nu, lang, accent);
		//year
		info += ". " + desc[nu][3];
		//technic
		info += ". " + getTechnic(desc[nu][8], lang, accent);
		//dimension
		info += ". " + desc[nu][2] ;
		//sold 
	
		if (desc[nu][4] == 1) info +=  ". " + getSold(nu, lang, accent);
	}
	return info;
}

function getTitle(nu, lang, accent) {
	var title = "Sans titre";
	if(lang=="en") {
		title = "Untitled";
	}
	if(lang=="de") {
		title = "Ohne Titel";	
	}
	if (accent && (desc[nu][6] != "")) { 
		title = desc[nu][6];
	} else if (desc[nu][5] != "") { 
		title = desc[nu][5];
	}
	if ( desc[nu][7] != "") { 
		title = title + " - " + desc[nu][7];
	}
	return title;
}

function getSold(nu, lang, accent) {
	var sold  = "Collection Particuliere";
	if (accent) sold = "Collection Particuli&egrave;re"
	if(lang=="en") {
		sold  = "Sold";
	}
	if(lang=="de") {
		sold  = "Privatsammlung"
	}
	return sold;
}

function getTechnic(no, lang, accent) {
	var nu = Number(no);
	var t  = tech[nu][0];	
	if (accent && (tech[nu][1] != "")) t = tech[nu][1];	
	if(lang=="en") {
		t = tech[nu][2];	
	}
	if(lang=="de") {
		t = tech[nu][3];	
	}
	return t;
}


