	var handlerSwapImage = function SwapImage_Callback(str) {
      if(str.errorCode!=0){
        window.status= str.errorCode + ' ' + str.responseText;
       }   else {
   		   document.getElementById('mainphotodiv').innerHTML = str.responseText;
      }
  	}

	function SwapImage(pid,setid)
	{
   // alert(pid & " " & setid);
		document.getElementById('mainphoto').src = 'images/loading.gif';
    if(   typeof(document.getElementById('mainphoto').align)=='object' ){
		  document.getElementById('mainphoto').align = 'absmidddle';
		}
    	//document.getElementById('mainphotodiv').innerHTML = 'Loading...';
    	new Ajax.Updater('mainphotodiv','ajaxPhoto.php?pid='+pid+'&setid='+setid+'', { method:'get', asynchronous:true,  onSuccess:handlerSwapImage });

	}
