// JavaScript Document
var switchImg = Class.create();

switchImg.prototype = {

    initialize: function(img1,img2,img3, imgloc, caption) {
		//alert(imgloc)
        this.img1   = img1;
		this.img2   = img2;
		this.img3   = img3;
		this.imgloc = imgloc;
		this.caption = caption;
		this.doaction(this.img1,this.img2,this.img3, this.imgloc, this.caption)
		
    },

    doaction: function(e,f,g, image, caption) {
        
		$(e).removeClassName($(e).className);
		$(f).removeClassName($(f).className);
		$(g).removeClassName($(g).className);
		$(e).addClassName('item-on');
		$(f).addClassName('item-off');
		$(g).addClassName('item-off');
		var picId = $(e).id.split('-'); 
		//alert(picId[1]);
		$('storyPic').innerHTML = "<a href=\"/Business/wireStory?id=" + picId[1] +"\"> <img src=\"" + image + "\" style=\"margin-left: 0px; margin-top: 0px;\" alt=\"" + caption + "\" title=\"\" border=\"0\" height=\"240\" width=\"320\"></a>";
    }

}