﻿// JScript File

Event.observe(window, 'load', function() {
  $$("div.partMedia > a").each(
    function(s) {
      Event.observe(s, 'click', function(e){Event.stop(e);});
    }
  )
});

var cnt=0;
var size = "400/300/";
    
function showWindow(startPoint, domain, pic, caption) {   
      picCode = "<img src=\"" + domain + size + pic + "\">";
      picCode += "<br /><span>" + caption + "</span>";
      picCode += "<a href=\"" + domain + pic + "\" style=\"float: right;\">(full size)</a>";
      
      var win = new Ext.Window({
         animateTarget: startPoint,
         constrain: false,
         draggable: false,
         title:"Detail Shot",
         header:true,
         closable: true,
         autoScroll:false,
         modal:true,
         html:picCode,
         width:"400px",
         height:"300px",
         x:"250px",
         y:"150px"
      });
      win.show();
   }   

	  var iWin;
            function popOutIframe(e){
                Event.stop(e);

                
		var IFCode = "<iframe src='" +  this.href + "?hostname=" + window.location.hostname +
                               "' style='width: 350px; height: 380px; border: 0px solid #ffffff; overflow-x: hidden; overflow-y: auto; '></iframe>";
     iWin = new Ext.Window({
         constrain: false,
         draggable: false,
         title:this.innerHTML,
         header:true,
         closable: true,
         autoScroll:false,
         modal:true,
         html:IFCode ,
         width:"364px",
         height:"380px",
         x:"250px",
         y:"150px"
      });

      iWin.show();

            }
            
//PicHolder.Attributes["onmouseover"] = "updateImg(" + MainId + ",this);";
   function updateImg(TargetId, imgPath, bigpath)
   {
     var mainImg = $(TargetId);
     mainImg.src = imgPath;
     mainImg.setAttribute("onclick",bigpath);
   }

            function iframeClose(asdf){
		iWin.hide();
                $$('#holder a').invoke('hide');
                var thankyoup = document.createElement('p');
                    thankyoup.appendChild(document.createTextNode('Thank you for your contribution'));
    
                $('holder').appendChild(thankyoup);
                    
                setTimeout(removePaddA, 5000);
            }
            
            function removePaddA(){
                $$('#holder p').invoke('remove');
                $$('#holder a').invoke('show');
            }
        
            $$('#holder a').invoke('observe', 'click', popOutIframe);
