// JavaScript Document
function writeLangLink() {
	pathis=location.pathname;
	//document.write(pathis+"<br>");
	
	new_array = pathis.split("/");
	subdirectory=new_array[1]; // 4 is a guess, try others
	//document.write("subdirectory="+subdirectory);
	temppath = location.protocol + "//" + location.host;
	startIndex = 1; 
	
	if (subdirectory != "espanol"){ // if other languages, do a case, with english as "else"
		temppath = temppath + "/espanol";
		//alert("english");
		linkText = "espaņol";
		linkIcn = "<img src=\"/img/icn_flag_mex.gif\" alt=\"Espaņol\" border=0>";
	}
	else { 
		//alert("spanish");
		startIndex = 2; 
		linkText = "english";
		linkIcn = "<img src=\"/img/icn_flag_usa.gif\" alt=\"English\" border=0>";
	}
	
	for (var i = startIndex; i < new_array.length; i++)
		temppath = temppath + "/" + new_array[i];
		
	//document.write("<br>"+temppath);
	new_array = null;
	
	linkBegin = "<a href=\""+temppath+"\" class=\"printLinks\" >";
	linkEnd = "</a>";
	
	document.write(linkBegin+linkIcn+linkEnd  + " " + linkBegin+linkText+linkEnd);
}
