var start=location.search;
var j= start.substring(2,1);
var imgClk;

x = parseInt(window.screen.width) / 2 - 320;  // the number 175 is the exact half of the width of the pop-up and so should be changed according to the size of the pop-up
y = parseInt(window.screen.height) / 2 - 250;  // the number 67 is the exact half of the height of the pop-up and so should be changed according to the size of the pop-up



if( j != 'u')
{
	if(start.length==3)
	{
	var j=start.substr(2,2);
	var x=start.substr(1,1);
	j=x+j;
	};
}

// This defines what to do when an image is clicked on 
function GetParam(name)
{
  var start=location.search.indexOf("?"+name+"=");
  if (start<0) start=location.search.indexOf("%26"+name+"=")+2;
  if (start<0) return '';
  start += name.length+2;
  var end=location.search.indexOf("%26",start)-1;
  if (end<0) end=location.search.length;
  var result=location.search.substring(start,end);
  var result='';
  for(var i=start;i<=end;i++) {
    var c=location.search.charAt(i);
    result=result+(c=='+'?' ':c);
  }
  return unescape(result);
}

function image_click(clicks)
{
imgClk = clicks;
if(clicks==0){document.images['large'].src=image0.src;}
if(clicks==1){document.images['large'].src=image1.src;}
if(clicks==2){document.images['large'].src=image2.src;}
if(clicks==3){document.images['large'].src=image3.src;}
if(clicks==4){document.images['large'].src=image4.src;}
if(clicks==5){document.images['large'].src=image5.src;}
}

function showWindow(path)
{ 
	CW=window.open('popup.htm?'+imgClk+'%26'+'path1='+path ,'mywindow','width=600,height=460','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbar=yes,resizable=yes');
CW.moveTo(x,y);
}
function showImg()
{
	
//alert(GetParam('path1'));
	path=GetParam('path1')

		
	if( j != 'u')
		document.main.src = "images/"+path+j+".jpg";
	else
		document.main.src = "images/"+path+"1.jpg";
}