arrPCHImages=new Array;

//---------------------------------------------------------------
function RegisterImage(pathGallery,id){  	
  var img=new Image();
  img.src=pathGallery + id + "_pco.jpg";
  arrPCHImages.push(img);
  img=new Image();
  img.src=pathGallery + id + "_pcw.jpg";
  arrPCHImages.push(img);
}
//---------------------------------------------------------------
function MouIn(id,showOriginal){
    
	if (showOriginal==-1){
		if (document.images[id].src.indexOf("_pco")>=0)
			showOriginal=1;
		else
			showOriginal=0;	
	}

    for (ix=0;ix<arrPCHImages.length;ix++){
	     if (arrPCHImages[ix].src.indexOf(id)>=0){
		 	 if (showOriginal){
			 	 if (arrPCHImages[ix].src.indexOf("_pcw")>=0)
				 	 break;
			 }
			 else{
			 	 if (arrPCHImages[ix].src.indexOf("_pco")>=0)
				 	 break;
			 }
		 }
	}

	document.images[id].src=arrPCHImages[ix].src;
}
//--------------------------------------------------------
function RegisterMultiImage(arrPaths){
for (ix=0;ix<arrPaths.length;ix++){
	var img=new Image();
	img.src=arrPaths[ix];
	arrPCHImages.push(img);
}
}
//--------------------------------------------------------
function SwitchMultiImage(arrPaths){

id="sample";
newIx=0;
for (ix=0;ix<arrPaths.length;ix++){
	 fnm=arrPaths[ix];
	 ixSl=fnm.lastIndexOf("/");
	 fnm=fnm.substr(ixSl+1);
	 
	 docSrc=document.images[id].src;
	 ixSl=docSrc.lastIndexOf("/");
	 docSrc=docSrc.substr(ixSl+1);

	 if (docSrc==fnm){
	 	 newIx=ix+1;
		 if (newIx>=arrPaths.length)
		 	 newIx=0;
		 break;
	 }
}

document.images[id].src=arrPaths[newIx];
}

//--------------------------------------------------------
function sDirE(preadd)						// rets String email addr
{
var arroba="@";
var v2="jttsoft";
var v3="com";
punt=".";

return preadd+arroba+v2+punt+v3;
}
//--------------------------------------------------------
function wDirE(preadd,post)							// Escriu addr
{
document.write(sDirE(preadd));
document.write(post);
}
//--------------------------------------------------------
function wAddr3(preadd,post,txtLinked)							// Escriu addr
{
document.write('<A href="mailto:');
document.write(sDirE(preadd));
document.write('"');
document.write(post);
document.write(">");
document.write(txtLinked);
document.write("</A>");
}
//--------------------------------------------------------
function wDirEL(preadd,post)						// Escriu tot el link sense tancar
{
document.write('<A href="mailto:');
document.write(sDirE(preadd));
document.write('"');
document.write(post);
document.write(">");
}
//--------------------------------------------------------
function wDir(preadd,cls)
{
if (cls=="")
    wDirEL(preadd,'');
else
    wDirEL(preadd,' class="'+cls+'"');

wDirE(preadd,"</A>");
}
