// JavaScript Document

function websn_writeImage(img,Namechamp)
 {
 //opener.Namechamp.value=TopPath+'/'+img;
/* if (img.charAt(0)=='/')
 {
 img=img.substring(1,img.length)
}*/
 if (img.charAt(0)=='/')
 {
 img=img.substring(1,img.length);
 }
 
 if (img.charAt(0)!='.')
 {
 img='../images/'+img;
 }

 myelems=opener.document.getElementsByName(Namechamp)
 myelems[0].value=img;
 window.close();
}

// handle mouseover event on the buttons
function btnMouseover(el) {
  with (el.style) {
	borderLeft = "1px solid buttonhighlight";
	borderRight = "1px buttonface outset";
	borderTop = "1px solid buttonhighlight";
	borderBottom = "1px solid buttonshadow";
	background = "buttonface";
	padding = "1px";
  }
}
//handle mouseout event on the buttons
function btnMouseout(el) {
  with (el.style) {
    background = "buttonface";
	border = "1px solid buttonface";
	padding = "1px";
  }
}
// handle mousedown event on the buttons
function btnMousedown(el) {
  with (el.style) {
    borderLeft = "1 solid buttonshadow";
	borderRight = "1 solid buttonhighlight";
	borderTop = "1 solid buttonshadow";
	borderBottom = "1 solid buttonhighlight";
	paddingTop = "2px";
	paddingLeft = "2px";
	paddingBottom = "0px";
	paddingRight = "0px";
	backgroundColor = "buttonhighlight";
  }
}
// handle mouseup event on the buttons
function btnMouseup(el) {
  with (el.style) {
    borderLeft = "1px solid buttonhighlight";
	borderRight = "1px buttonface outset";
	borderTop = "1px solid buttonhighlight";
	borderBottom = "1px solid buttonshadow";
	background = "buttonface"
	padding = "1px";
  }
}
function PreviewImage (img, inImg)
{
	var vImg = new Image(); 
	
	if ((inImg.search(".gif")!=-1)||(inImg.search(".jpg")!=-1)||(inImg.search(".gpeg")!=-1)||(inImg.search(".ico")!=-1))
	{   

		vImg.src=inImg;
		img.src = vImg.src.replace('file://', '');
	}				
	delete vImg;
	return ;

}
