function openWin(url, target, id)
    {
        newwindow=window.open(url + '?pid=' + id,target);
    }
    function getItem(i)
    {       
       var url = this.document.location.pathname + '?pgid=' + i;
       this.document.location.href = document.location.protocol + url;
    }
function loadurl(dest, cap) {
 
 try {
 
 //MONO open source App Server for Unix/Linux to run .NET
  
   // Moz supports XMLHttpRequest. IE uses ActiveX. 
   // browser detction is bad. object detection works for any browser
   xmlhttp = window.XMLHttpRequest?new XMLHttpRequest():
  		new ActiveXObject("Microsoft.XMLHTTP");
  
 }
 catch (e) {
   // browser doesn't support ajax
   alert('nope')
 }
 
 // the xmlhttp object triggers an event everytime the status changes
 // triggered() function handles the events  
 xmlhttp.onreadystatechange = function(){
   // if the readyState code is 4 (Completed)
  // and http status is 200 (OK) we go ahead and get the responseText
  // other readyState codes:
  // 0=Uninitialised 1=Loading 2=Loaded 3=Interactive
  if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200)) {
    if(dest.search(/jpg/i) > -1){
    document.getElementById('mainblock').innerHTML =
    
    '<div style="background-color:beige; border:1px solid #808080;" ><span align="left" style="font-size:16px;font-weight:bold;font-family:Tahoma;">TENNIS.com Photo Gallery</span></div><br/><table align="center" style="border:1px solid #808080; background-color:Beige;"><tr><td>'+'<img src="'+dest+'""/></td></tr><tr><td align="center" width="400px;">'+cap+'</td></tr><tr><td align="center"><a href="javascript:history.go(0);">Go Back</a></td></tr></table>';
    //+'<div style="font-size:16px;font-style:Tahoma;font-weight:bold;">'+imagecap(item).text+'</div>'  
    } 
    else {
    //awef
      
    }
   }
 }
 // open takes in the HTTP method and url.
 xmlhttp.open("GET", dest);
 
 // send the request. if this is a POST request we would have
 // sent post variables: send("name=aleem&gender=male)
 // Moz is fine with just send(); but
 // IE expects a value here, hence we do send(null);
 xmlhttp.send(null);
 
}

//function __LoadSearchResult(args,context)
//{
//args=context+"&"+args;
//WebForm_DoCallback('Photo1',args,ICallBackHandler.DisplaySearchResult,context,ICallBackHandler.DisplaySearchError,false)
//}