Open link in new window using java script

how to make a code like this website (Samsung P1000 Galaxy Tab images )
there you can see the images when you click the image then the browser will open a new page , and when you click the image again the browser will close , does anybody know how to make!:rolleyes:

many thanks

On that page, the images are embedded in anchor tags (links) that fire an onclick event, which calls a function called ShowImg. That function opens a popup window, which contains more code to handle closing the popup when the image is clicked. Below is an example of the code used to create the popup:


function ShowImg(sImg)
{
	var URL;
	URL="showpic.php3?sImg="+sImg
	window.open(URL,'','status=1,scrollbars=1,width=830,height=720,resizable=1')
}

and the image tag is handled like this:


<a onclick='javascript:ShowImg("some/image.jpg"); return false' href="#"><img src="some/image.jpg" height="160"></a>

Personally, I think that there are better ways of doing this, but this is how the Samsung page does it.