var rollImgPath = "";
var orgImgPath = "";
var initDone;
var rollExt = '.down';
var splitAr = new Array();
var iNArray = new Array();
var counter = 0;
var HoverArray = new Array();
var iNarrayOrgSrc = new Array();
var ImgContainer = new Array();

function initNavRollover(){
	if (document.images) {
		for(i=0; i<= document.images.length-1; i++){
			if(document.images[i].name != ""){
				thisOrgSrc = document.images[i].src;
				splitAr = thisOrgSrc.split("/");
				thisImgSrcName = splitAr[splitAr.length-1];
				if(document.images[i].name == thisImgSrcName){
					rollImgPath = thisOrgSrc.substr(0,thisOrgSrc.length-thisImgSrcName.length);
					HoverImgSrc = getHoverImg(thisImgSrcName);
					iNarrayOrgSrc[document.images[i].name] = document.images[i].src;
					HoverArray[document.images[i].name] = new Image;
					HoverArray[document.images[i].name].src = HoverImgSrc;
          ImgContainer[counter] = document.images[i].name;
          counter++;
				}//if
			}//if
		}//for
		initDone=true;
	} else {
		initDone=false;
	}//if
}//function

function getHoverImg(OrgImgSrc){
	thisImgTail = OrgImgSrc.substring(OrgImgSrc.length-4,OrgImgSrc.length);
	thisImgMain = OrgImgSrc.substring(0,OrgImgSrc.length-4);
	thisHoversrc = rollImgPath+thisImgMain+rollExt+thisImgTail;
	return thisHoversrc;
}

function place(name) {
	if (initDone) {document.images[name].src=HoverArray[name].src;} // if
}//function
function remake(name) {
	if (initDone) {document.images[name].src=iNarrayOrgSrc[name];} // if
}//function


function changeLanguage(comeFromUrl,Language){

  searchString = /\.(\D\D)\.html$/;
  replaceString = "." + Language + ".html"
  window.location.href = comeFromUrl.replace(searchString,replaceString);
}//function


function popimage(OrgImgName,ImgWidth,ImgHeight){
	maxWinWidth = ImgWidth+2;
	maxWinHeight = ImgHeight+2;
	imagesrc = OrgImgName;
	imageRef = "'"+"theImg"+"'";
  addOptions = ', scrollbars="no", menubar="no", status="no", resizable="no", toolbar="no"';
	var look = 'width=' + maxWinWidth + ', height=' + maxWinHeight + addOptions;
	popwin=window.open("","Zoom",look);
	popwin.document.open();
	popwin.document.write('<html><head><title>Zoom</title></head>');
	popwin.document.write('<body BGCOLOR="#ffffff" TOPMARGIN="0" leftmargin="0" marginheight="0" marginwidth="0">');
	popwin.document.write('<img src="'+imagesrc+'" onclick="window.close();" ALT="click to close" TITLE="click to close" NAME="theImg" BORDER="1" WIDTH="'+ImgWidth+'" HEIGHT="'+ImgHeight+'">');
	popwin.document.write('</body></HTML>');
	popwin.document.close();
}//function

