




// JavaScript Document
/** start the slideshow, to be added to the onload event of the body tag
 * @param start_frame 
 *		- the index of the first frame. If the first slide has an id of "slide1", 
 * 			this would be the number 1
 * @param end_frame
 * 		- the last index. If you have 5 frames, this would be the number 5
 * @param delay
 *		- the time, in miliseconds, to delay between each slide, 1000 = 1 second.
 * 			there is a buffer of 850 miliseconds to ease transitions, the delay
 * 			is how long in between transitions.
 * 		
 */
function start_slideshow(start_frame, end_frame, delay) {
	setTimeout(switch_slides(start_frame,start_frame,end_frame, delay), delay);
}

function switch_slides(frame, start_frame, end_frame, delay) {
	return (function() {
		Effect.Fade('slide' + frame);
		if (frame == end_frame) { 
			frame = start_frame; 
		} else { 
			frame = frame + 1; 
		}
		setTimeout("Effect.Appear('slide" + frame + "');", 850);
		setTimeout(switch_slides(frame, start_frame, end_frame, delay), delay + 850);
	})
}

var Popup = {
  open: function(options)
  {
    this.options = {
      url: '#',
      width: 320,
      height: 264,
      name:"_blank",
      location:"no",
      menubar:"no",
      toolbar:"no",
      status:"no",
      scrollbars:"no",
      resizable:"no",
      left:"200",
      top:"200",
      normal:false
    }
    Object.extend(this.options, options || {});

    if (this.options.normal){
        this.options.menubar = "yes";
        this.options.status = "yes";
        this.options.toolbar = "yes";
        this.options.location = "yes";
    }

    this.options.width = this.options.width < screen.availWidth?this.options.width:screen.availWidth;
    this.options.height=this.options.height < screen.availHeight?this.options.height:screen.availHeight;
    var openoptions = 'width='+this.options.width+',height='+this.options.height+',location='+this.options.location+',menubar='+this.options.menubar+',toolbar='+this.options.toolbar+',scrollbars='+this.options.scrollbars+',resizable='+this.options.resizable+',status='+this.options.status
    if (this.options.top!="")openoptions+=",top="+this.options.top;
    if (this.options.left!="")openoptions+=",left="+this.options.left;
    window.open(this.options.url, this.options.name,openoptions );
    return false;
  }
}
