// JavaScript Document

//samarind Image Load
	
function ViewPicture(img){
	//Load
  foto1= new Image();
  foto1.src=(img);
  
  LoadImage(img);
}

function LoadImage(img){
	//Control
  if((foto1.width!=0)&&(foto1.height!=0)){
    openImage(img);
  }
  else{
	  //function
    //strFunction="LoadImage('"+img+"')";
    //interval=setTimeout(strFunction,20); //interval
    //openImage(img);
    
    //we don't have an image size .. so just open to a default size
    imagewidth=foto1.width+700+50;
  	imageheight=foto1.height+500+100;
  	windowsize ="width="+imagewidth+",height="+imageheight;
  	//window
    strWindow=window.open("imagewindow.html?"+img,"",windowsize);
    
  }
}
function openImage(img){
	//sizes 
  imagewidth=foto1.width+50;
  imageheight=foto1.height+100;
  windowsize ="width="+imagewidth+",height="+imageheight;
  //window
   strWindow=window.open("imagewindow.html?"+img,"",windowsize);
}