var image_dir = "images/";
var ba_type = "N";
var ba_type2 = "1";
var ba_max = 30;
var maxImages = 10;
var sAltTag = new Array(maxImages);
var sImages = new Array(maxImages);
var sImgCnt = 0;
var winh = 0;
for (j=0; j<maxImages; j++)
{
	sAltTag[j] = "Alt Tag";
	sImages[j] = "photo.jpg";
}

var bwidth = 800;
var bheight = 600;
var swidth = 0;
var sheight = 0;

var ba_img = null;
var ba_img_hl = null;
var ba_img_sel = null;

var ba_img = new Array(ba_max);
var ba_img_hl = new Array(ba_max);
var ba_img_sel = new Array(ba_max);
var ba_img_src = new Array(ba_max); 
var ba_img_name = new Array(ba_max); 
var ba_name_txt = new Array(ba_max); 
var ba_altname = new Array(ba_max); 
var ba_href_link = new Array(ba_max); 
var ba_href_bef = new Array(ba_max); 
var ba_href_aft = new Array(ba_max); 
var ba_width = new Array(ba_max); 
var ba_height = new Array(ba_max); 
var ba_border = new Array(ba_max); 
var ba_class = new Array(ba_max); 
var ba_td_class_hl = new Array(ba_max); 
var ba_td_class = new Array(ba_max); 
var ba_td_align = new Array(ba_max); 
var ba_td_valign = new Array(ba_max);
var ba_td_width = new Array(ba_max);

var thisImg = 0;

function setDivTab(iimn2, iimw2, iimh2, ibg, ibgc)
{
	var ist = "";
	var isbg = "";
	var isbgc = "";
	var ismn = "";
	var ismw = "";
	var ismh = "";

	if (iimn2 != "") { ismn = iimn2; }
	if (iimw2 != "") { ismw = iimw2; }
	if (iimh2 != "") { ismh = iimh2; }
	if (ibg != "") { isbg = ibg; }
	if (ibgc != "") { isbgc = ibgc; }
	
	ist = "<table";
	ist = ist + " width=\"100%\"";
	ist = ist + " height=\"100%\"";
	ist = ist + " cellspacing=\"0\"";
	ist = ist + " cellpadding=\"0\""
	if (isbgc != "") { ist = ist + " bgcolor=\"" + isbgc + "\""; }
	else if (isbg != "") { ist = ist + " background=\"" + isbg + "\""; }
	ist = ist + ">";
	ist = ist + "<tr><td>";
	ist = ist + setIH(ismn, ismw, ismh);
	ist = ist + "</td></tr>";
	ist = ist + "</td></tr></table>";
	
//	alert("ist = " + ist);
	document.write(ist);
}

function setIH(iimn, iimw, iimh)
{
var ims = "";
var imn = "images/blank.gif";
var imw = "44";
var imh = document.body.scrollHeight;
if (iimn != "") { imn = iimn }
if (iimw != "") { imw = iimw }
if (iimh != "") { imh = iimh }
// var imh = document.body.offsetHeight-20;
// var imh = window.innerHeight;
// var imh = screen.availHeight;
// var imh = window.outerHeight;
// var imh = document.body.clientHeight;
// var imh = document.body.scrollTop;
// var imh = winh;
// var imh = document.body.scrollTop+document.body.offsetHeight;
// alert("height = " + imh);
ims = "<img src=\"" + imn + "\"";
ims = ims + " width=\"" + imw + "\"";
ims = ims + " height=\"" + imh + "\"";
ims = ims + ">";
return ims;
}

clrButtonValues();

function setButtonMainValues(img_dir, b_max, b_type, b_type2)
{
	if (img_dir == "")
	{
		img_dir = "images/";
	}
	image_dir = img_dir;
	
	ba_type = "N";
	if (b_type == "d" || b_type == "D")
	{
		ba_type = "D";
	}
	
	if (b_type == "a" || b_type == "A")
	{
		ba_type = "A";
	}
	
	if (b_type == "c" || b_type == "C")
	{
		ba_type = "C";
	}
	
	ba_type2 = b_type2;

	if (b_max == 0)
	{	
		b_max = 10;
	}
	ba_max = b_max;
}

function setButtonValues(b_num, b_img_src, b_img_src_hl, b_img_src_sel, b_img_name, b_name_txt, b_altname, b_href_link, b_href_bef, b_href_aft, b_width, b_height, b_border, b_class, b_td_class_hl, b_td_class, b_td_align, b_td_valign, b_td_width)
{
	var i = b_num;
	
	if (i == 0)
	{
		clrButtonValues();
	}
	
	if (b_img_name != "")
	{
		ba_img_name[i] = b_img_name; 
	}
	if (b_name_txt != "")
	{
		ba_name_txt[i] = b_name_txt; 
	}
	if (b_altname != "")
	{
		ba_altname[i] = b_altname; 
	}
	if (b_href_link != "")
	{
		ba_href_link[i] = b_href_link; 
	}
	if (b_href_bef != "")
	{
		ba_href_bef[i] = b_href_bef; 
	}
	if (b_href_aft != "")
	{
		ba_href_aft[i] = b_href_aft; 
	}
	if (b_width != 0)
	{
		ba_width[i] = b_width; 
	}
	if (b_height != 0)
	{
		ba_height[i] = b_height; 
	}
	if (b_border != "")
	{
		ba_border[i] = b_border; 
	}
	if (b_class != "")
	{
		ba_class[i] = b_class; 
	}
	if (b_td_class_hl != "")
	{
		ba_td_class_hl[i] = b_td_class_hl; 
	}
	if (b_td_class != "")
	{
		ba_td_class[i] = b_td_class; 
	}
	if (b_td_align != "")
	{
		ba_td_align[i] = b_td_align; 
	}
	if (b_td_valign != "")
	{
		ba_td_valign[i] = b_td_valign;
	}
	if (b_td_width != "")
	{
		ba_td_width[i] = b_td_width;
	}
	
	if (b_img_src != "")
	{
		ba_img[i] =  new Image(ba_width[i],ba_height[i]);
		ba_img[i].src = image_dir + b_img_src;
	}
	if (b_img_src_hl != "")
	{
		ba_img_hl[i] =  new Image(ba_width[i],ba_height[i]);
		ba_img_hl[i].src = image_dir + b_img_src_hl;
	}
	if (b_img_src_sel != "")
	{
		ba_img_sel[i] =  new Image(ba_width[i],ba_height[i]);
		ba_img_sel[i].src = image_dir + b_img_src_sel;
	}
}

function clrButtonValues()
{
	for (var i=0; i<ba_max; i++)
	{
		ba_img[i] = null;
		ba_img_hl[i] = null;
		ba_img_sel[i] = null;
		ba_img_src[i] = image_dir + "imgname" + i + ".gif"; 
		ba_img_name[i] = "imgname" + i; 
		ba_name_txt[i] = "Button " + i; 
		ba_altname[i] = "Alt Button Name " + i; 
		ba_href_link[i] = "#"; 
		ba_href_bef[i] = 0; 
		ba_href_aft[i] = 0; 
		ba_width[i] = 0; 
		ba_height[i] = 0; 
		ba_border[i] = "0"; 
		ba_class[i] = "bclass"; 
		ba_td_class_hl[i] = "btdclasshl"; 
		ba_td_class[i] = "btdclass"; 
		ba_td_align[i] = " "; 
		ba_td_valign[i] = " ";
		ba_td_width[i] = "";
	}
}

function dispAllButtons(but_hl)
{
	for (var i=0; i<ba_max; i++)
	{
		dispEachButton(but_hl, i);
	}
}

function dispEachButton(but_hl, butnum)
{
	var bhtm = "";
	var i = butnum;
	
	if (ba_type == "D")
	{
		bhtm = bhtm + "<tr>";
	}
	
	if (ba_type == "A" || ba_type == "D")
	{
		bhtm = bhtm + createTdStartTag(but_hl, i);
	}
	
	bhtm = bhtm + addSpaces("1", ba_href_bef[i]);
	if (ba_href_link[i] == "##")
	{
		bhtm = bhtm + ba_name_txt[i];
	}
	else
	{
		bhtm = bhtm + createHrefTag(but_hl, i);
	}
	bhtm = bhtm + addSpaces("1", ba_href_aft[i]);

	if (ba_type == "A" || ba_type == "D")
	{
		bhtm = bhtm + "</td>";
	}
	
	if (ba_type == "D")
	{
		bhtm = bhtm + "</tr>";
	}
	
//	alert("bhtm = " + bhtm);
	document.write(bhtm);
}

function addSpaces(nswitch, nspaces)
{
	var bspaces = "";
	
	if (nspaces < 1)
	{
		return bspaces;
	}
	
	if (nswitch = "1")
	{
		for (var i=0; i<nspaces; i++)
		{
			bspaces = bspaces + "&nbsp;";
		}
	}
	else
	{
		bspaces = bspaces + "<img src=images/blank.gif width=" + nspaces + "height=1 border=0>";
	}
	
	return bspaces;
}

function createTdStartTag(but_hl, butnum)
{
	var i = butnum;
	var tdt = "";
	
	tdt = tdt + "<td";
	tdt = tdt + " align=\"" + ba_td_align[i] + "\"";
	tdt = tdt + " valign=\"" + ba_td_valign[i] + "\"";
//	if (but_hl == i)
//	{
//		tdt = tdt + " class=\"" + ba_td_class_hl[i] + "\"";
//	}
//	else
//	{
		tdt = tdt + " class=\"" + ba_td_class[i] + "\"";
//	}
	if (ba_td_width[i] != "")
	{
		tdt = tdt + " width=" + ba_td_width[i];
	}
	tdt = tdt + ">";
	
//	alert("tdt = " + tdt);
	return tdt;
}

function createHrefTag(but_hl, butnum)
{
	var i = butnum;
	var hreft = "";
	
	hreft = hreft + "<a";
	hreft = hreft + " href=\"" + ba_href_link[i] + "\"";
	
	if (ba_type2 == "3" && ba_img[i] != null)
	{
		if (but_hl == i)
		{
			hreft = hreft + " onmouseover=\"hiLite('" + ba_img_name[i] + "','ba_img_hl[" + i + "]')\"";
			hreft = hreft + " onmouseout=\"hiLite('" + ba_img_name[i] + "','ba_img_hl[" + i + "]')\"";
		}
		else
		{
			hreft = hreft + " onmouseover=\"hiLite('" + ba_img_name[i] + "','ba_img_hl[" + i + "]')\"";
			hreft = hreft + " onmouseout=\"hiLite('" + ba_img_name[i] + "','ba_img[" + i + "]')\"";
		}
	}
	hreft = hreft + ">";
	
	if (ba_img[i] == null)
	{
		if (but_hl == i)
		{
			hreft = hreft + "<img src=\"" + image_dir + "red_3squares.jpg\" border=\"0\">&nbsp;&nbsp;&nbsp;";
		}
		hreft = hreft + ba_name_txt[i];
	}
	else
	{
		hreft = hreft + createImgTag(i);
	}

	hreft = hreft + "</a>";
	
//	alert("hreft = " + hreft);
	return hreft;
}

function createImgTag(butnum)
{
	var imgt = "";
	var i = butnum;
	
	imgt = imgt + "<img";
	imgt = imgt + " name=\"" + ba_img_name[i] + "\"";
	imgt = imgt + " src=\"" + ba_img[i].src + "\"";
	imgt = imgt + " width=\"" + ba_width[i] + "\""; 
	imgt = imgt + " height=" + ba_height[i] + "\"";
	imgt = imgt + " alt=\"" + ba_altname[i] + "\"";
	imgt = imgt + " border=\"" + ba_border[i] + "\"";
	imgt = imgt + " class=\"" + ba_class[i] + "\"";
	imgt = imgt + " hspace=\"0\" vspace=\"0\"";
	imgt = imgt + ">";
	
//	alert("imgt = " + imgt);
	return imgt;
}

function sizeImg2(iimg, iname, ialt, iwidth, iheight, ialign, ivspace, ihspace, iclass, iborder)
{
	swidth = screen.width;
    sheight = screen.height;

	var pwidth = (swidth / bwidth) * iwidth;
	var pheight = (sheight / bheight) * iheight;
	var vimg = "";

//	alert("pwidth = " + pwidth + ", pheight = " + pheight);
	
	vimg = "<img ";
	vimg = vimg + " src=\"" + iimg + "\"";
	vimg = vimg + " name=\"" + iname + "\"";
	vimg = vimg + " alt=\"" + ialt + "\"";
	vimg = vimg + " width=\"" + pwidth + "\"";
	vimg = vimg + " height=\"" + pheight + "\"";
	vimg = vimg + " align=\"" + ialign + "\"";
	vimg = vimg + " vspace=\"" + ivspace + "\"";
	vimg = vimg + " hspace=\"" + ihspace + "\"";
	vimg = vimg + " class=\"" + iclass + "\"";
	vimg = vimg + " border=\"" + iborder + "\"";
	vimg = vimg + ">";

//	vimg = vimg + "<br><br>screen size is " + swidth + " x " + sheight;
//	vimg = vimg + "<br>img size is " + pwidth + " x " + pheight;
//	vimg = vimg + "&nbsp;normal img size is " + iwidth + " x " + iheight;
//	alert("screen size is " + swidth + " x " + sheight);
//	alert("screen perc is " + pwidth + " x " + pheight);
	
//	alert("vimg = " + vimg);

	document.write(vimg);
}

function validate(string) {
    if (!string) return false;
    var Chars = "0123456789";

    for (var i = 0; i < string.length; i++) {
       if (Chars.indexOf(string.charAt(i)) == -1)
          return false;
    }
    return true;
} 

function dispImgSizes(img1, img2, img3, img4, iialign, iialt)
{
	swidth = screen.width;
    sheight = screen.height;
	var vimg = "";
	var iimg = "";
	var ialt = "Randy's Unique Catering Photo";
	var ialign = "";
	var iborder = "0";
	var iname = "logoi";
	
	if (iialign != "")
	{
		ialign = iialign;
	}

	if (iialt != "")
	{
		ialt = iialt;
	}

	if (swidth > 1400)
	{
		iimg = img4;
	}
	else if (swidth > 1200)
	{
		iimg = img3;
	}
	else if (swidth > 1000)
	{
		iimg = img2;
	}
	else
	{
		iimg = img1;
	}
	
	vimg = "<img ";
	vimg = vimg + " src=\"" + iimg + "\"";
	vimg = vimg + " name=\"" + iname + "\"";
	vimg = vimg + " alt=\"" + ialt + "\"";
	vimg = vimg + " align=\"" + ialign + "\"";
	vimg = vimg + " border=\"" + iborder + "\"";
	vimg = vimg + ">";

//	alert("vimg = " + vimg);
	document.write(vimg);
}

function sizeFont(iclass, isize, isize800, itcolor, iweight, ifamily, itxtdec, istyle, ibgcolor)
{
	swidth = screen.width;
    sheight = screen.height;

	var sfont = "";
	var psize = 10;
	var iweight2 = 0;

//	if (isize != 0) psize = (swidth / bwidth) * isize;
	if (isize != 0) psize = isize;
	if (iclass == "") iclass = "dclass01";
	if (itcolor == "") itcolor = "black";
	if (ifamily == "") ifamily = "Arial";
	if (iweight == "") iweight = "normal";
	if (itxtdec == "") itxtdec = "none";
	
	if (validate(iweight))
	{	
		if (swidth > 1400)
		{
			iweight2 = parseInt(iweight,10);
			iweight2 = iweight2 + 0;
			iweight = iweight2;
		}
		else if (swidth > 1200)
		{
			iweight2 = parseInt(iweight,10);
			iweight2 = iweight2 + 0;
			iweight = iweight2;
		}
		else if (swidth > 1000)
		{
			iweight2 = parseInt(iweight,10);
			iweight2 = iweight2 + 0;
			iweight = iweight2;
		}
	}
		
	if (swidth < 1000 && isize800 > 0)
	{
		psize = isize800;
	}
	
//	alert("psize = " + psize);
	
//	alert("iweight = " + iweight);
	
	sfont = "<style>";
	sfont = sfont + " ." + iclass + " {";
	sfont = sfont + " color : " + itcolor + ";";
	sfont = sfont + " font-family : " + ifamily + ";";
	sfont = sfont + " font-size : " + psize + "pt;";
	sfont = sfont + " font-weight : " + iweight + ";";
	sfont = sfont + " text-decoration : " + itxtdec + ";";
	sfont = sfont + " font-style : " + istyle + ";";
	sfont = sfont + " background-color : " + ibgcolor + ";";
	sfont = sfont + " }";
	sfont = sfont + " </style>";
	
//	alert("sfont = " + sfont);
	
	document.write(sfont);
}

function newSlide(direction, slideImg, imgCt, begImg, imgsuf) 
{
	var imgMax = imgCt;
	if (imgsuf == "")
	{
		imgsuf = "jpg";
	}
	
	if (begImg == 0)
	{
		imgMax = imgCt - 1;
	}
	
	if (thisImg < begImg)
	{
		thisImg = begImg;
	}
	
	if (document.images) 
	{
		thisImg = thisImg + direction
		if (thisImg < begImg) 
		{
			thisImg = imgMax;
		}
		if (thisImg > imgMax) 
		{
			thisImg = begImg;
		}
		document.slideshow.src = image_dir + slideImg + thisImg + "." + imgsuf;
		document.slideshow.usemap = "#nextprev";
//		document.slideshow.alt = ba_altname[thisImg];
//		alert("slideshow = " + document.slideshow.src);
	}
}

function rotatePics(imgBegName, imgStart, imgCnt, showImg, imgSuf, imgAlt)
{
	swidth = screen.width;
    sheight = screen.height;
	var iwidth = 0;
	var iheight = 0;
	var icoords1 = "";
	var icoords2 = "";
	var swname = "";

	thisImg = imgStart;
	if (swidth > 1200)
	{
		iwidth = 433;
		iheight = 500;
		icoords1 = "27, 452, 169, 482";
		icoords2 = "317, 452, 408, 482";
		swname = "_1280_";
	}
	else if (swidth > 1000)
	{
		iwidth = 325;
		iheight = 375;
		icoords1 = "20, 340, 120, 386";
		icoords2 = "195, 340, 299, 386";
		swname = "_1024_";
	}
	else
	{
		iwidth = 212;
		iheight = 245;
		icoords1 = "17, 220, 85, 238";
		icoords2 = "157, 220, 203, 238";
		swname = "_800_";
	}
	
//	swname = "";
	imgBegName = imgBegName + swname;
	
	if (showImg == "TRUE")
	{
//    	document.write(createImgTag(0, imgStart));
		document.write("<br>");
	}

	var mapc = "";
	mapc = mapc + "<map name=\"nextprev\">";
	mapc = mapc + "<area shape=\"rect\" coords=\"" + icoords1 + "\"";
	mapc = mapc + " href=\"javascript:newSlide(-1, \'" + imgBegName + "\', " + imgCnt + ", " + imgStart + ", \'" + imgSuf + "\')\">";
	mapc = mapc + "<area shape=\"rect\" coords=\"" + icoords2 + "\"";
	mapc = mapc + " href=\"javascript:newSlide(1, \'" + imgBegName + "\', " + imgCnt + ", " + imgStart + ", \'" + imgSuf + "\')\">";
	mapc = mapc + "</map>";
//	alert("mapc = " + mapc);
	document.write(mapc);
	
	var imgc = "";
	imgc = imgc + "<img ";
	imgc = imgc + "src=\"images/" + imgBegName + imgStart + "." + imgSuf + "\" ";
	imgc = imgc + "border=\"0\" ";
	imgc = imgc + "name=\"slideshow\" "; 
	imgc = imgc + "alt=\"" + imgAlt + "\" ";
	imgc = imgc + "usemap=\"#nextprev\" ";
	imgc = imgc + "width=\"" + iwidth + "\" ";
	imgc = imgc + "height=\"" + iheight + "\" ";
	imgc = imgc + ">";
//	alert("imgc = " + imgc);
	document.write(imgc + "<br>");
/*	
	document.write("<a href=\"javascript:newSlide(-1, \'" + imgBegName + "\', " + imgCnt + ", " + imgStart + ", \'" + imgSuf + "\')\">");
	document.write("[Previous]");
	document.write("</a>&nbsp;&nbsp;");
	document.write("<a href=\"javascript:newSlide(1, \'" + imgBegName + "\', " + imgCnt + ", " + imgStart + ", \'" + imgSuf + "\')\">");
	document.write("[Next]");
	document.write("</a>");
*/

/*	
	document.write("<table cellpadding=0 cellspacing=0 width=\"100%\">");
	document.write("<tr>");
	document.write("<td align=left>");
	document.write("<a href=\"javascript:newSlide(-1, \'" + imgBegName + "\', " + imgCnt + ", " + imgStart + ", \'" + imgSuf + "\')\">");
	document.write("<img src=\"images/btnt_previous.gif\" border=\"0\">");
	document.write("</a>");
	document.write("</td>");
	document.write("<td align=right>");
	document.write("<a href=\"javascript:newSlide(1, \'" + imgBegName + "\', " + imgCnt + ", " + imgStart + ", \'" + imgSuf + "\')\">");
	document.write("<img src=\"images/btnt_next.gif\" border=\"0\">");
	document.write("</a>");
	document.write("</td>");
	document.write("</tr>");
	document.write("</table>");
*/

}
function sizeFontDtl(iclass, isize, itcolor, iweight, ifamily, itxtdec, inc)
{
	var swidth = screen.width;
    var sheight = screen.height;

	var sfont = "";
	var psize = 10;
	var iweight2 = 0;

//	if (isize != 0) psize = (swidth / bwidth) * isize;
	if (isize != 0) psize = isize;
	if (iclass == "") iclass = "dclass01";
	if (itcolor == "") itcolor = "black";
	if (ifamily == "") ifamily = "Arial";
	if (iweight == "") iweight = "normal";
	if (itxtdec == "") itxtdec = "none";
	
//	psize=10;
//	if (validate(iweight))
//	{	
		if (swidth > 1350)
		{
			psize = psize + inc + 2;
		}
		else if (swidth > 1200)
		{
			psize = psize + inc + 1;
		}
		else if (swidth > 1000)
		{
			psize = psize + inc;
		}
//		else if (swidth > 800)
//		{
//			iweight = "bold";
//		}
//	}
	
//	alert("iweight = " + iweight);
	
	sfont = "<style>";
	sfont = sfont + " ." + iclass + " {";
	sfont = sfont + " color : " + itcolor + ";";
	sfont = sfont + " font-family : " + ifamily + ";";
	sfont = sfont + " font-size : " + psize + "pt;";
	sfont = sfont + " font-weight : " + iweight + ";";
	sfont = sfont + " text-decoration : " + itxtdec + ";";
	sfont = sfont + " }";
	sfont = sfont + " </style>";
	
//	alert("sfont = " + sfont);
	
	document.write(sfont);
}

function sizeImg(iimg, iname, ialt, iwidth, iheight, ialign, ivspace, ihspace)
{
	var swidth = screen.width;
    var sheight = screen.height;

//	var pwidth = (swidth / bwidth) * iwidth;
//	var pheight = (sheight / bheight) * iheight;
	var pwidth = iwidth;
	var pheight = iheight;
	var vimg = "";

	if (swidth > 1200)
	{
		pwidth = 450;
		pheight = 300;
	}
	else if (swidth > 1000)
	{
		pwidth = 340;
		pheight = 225;
	}

	vimg = "<img ";
	vimg = vimg + " src=\"" + iimg + "\"";
	vimg = vimg + " name=\"" + iname + "\"";
	vimg = vimg + " alt=\"" + ialt + "\"";
	vimg = vimg + " width=\"" + pwidth + "\"";
	vimg = vimg + " height=\"" + pheight + "\"";
	vimg = vimg + " align=\"" + ialign + "\"";
	vimg = vimg + " vspace=\"" + ivspace + "\"";
	vimg = vimg + " hspace=\"" + ihspace + "\"";
	vimg = vimg + ">";

//	vimg = vimg + "<br><br>screen size is " + swidth + " x " + sheight;
//	vimg = vimg + "<br>img size is " + pwidth + " x " + pheight;
//	vimg = vimg + "&nbsp;normal img size is " + iwidth + " x " + iheight;
//	alert("screen size is " + swidth + " x " + sheight);
//	alert("screen perc is " + pwidth + " x " + pheight);
	
//	alert("vimg = " + vimg);

	document.write(vimg);
}

function writeSpaces(nspaces)
{
	var cspaces = "";
	for (var i=0; i<nspaces; i++)
	{
		cspaces = cspaces + "&nbsp;";
	}
	document.write(cspaces);
}

/*************************************************************************
  This code is from Dynamic Web Coding at http://www.dyn-web.com/
  Copyright 2001-3 by Sharon Paine 
  See Terms of Use at http://www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/

function initImgRotation() {
  // create rotating image objects here 
  // arguments: image name, rotation speed
  var rotator1 = new rotateImgObj('img1',4000);
  
  // add the images to rotate into that image object  
  /*
  if (icnt == 1)
  {
  	rotator1.addImages("weddings_photo_0.jpg","weddings_photo_1.jpg","weddings_photo_2.jpg","weddings_photo_3.jpg");
  }
  else if (icnt == 2)
  {
	rotator1.addImages("holiday_photo_0.jpg","holiday_photo_1.jpg","holiday_photo_2.jpg","holiday_photo_3.jpg");
  }
  else if (icnt == 3)
  {
    rotator1.addImages("corpevents_photo_0.jpg","corpevents_photo_1.jpg","corpevents_photo_2.jpg");
  }
  else if (icnt == 4)
  {
    rotator1.addImages("summer_photo_0.jpg");
  }
  */
  
  rotator1.addImages();
  	
  rotator1.rotate();
  
  rotateImgObj.start();  
}

// If all the images you wish to display are in the same location, you can specify the path here 
rotateImgObj.imagesPath = "images/";

// no need to edit code below 
/////////////////////////////////////////////////////////////////////
rotateImgObjs = []; // holds all rotating image objects defined
// constructor 
function rotateImgObj(nm,s) {
  this.speed=s; this.ctr=0; this.timer=0; 
  var cper = 1;
  
  if (document.images[nm] != null)
  {
	  if (screen.width > 1200)
	  {
		  cper = 1;
	  }
	  else if (screen.width > 1000)
	  {
		cper = .75;
	  }
	  else
	  {
		cper = .40;
	  }
	var awidth = document.images[nm].width;
	var aheight = document.images[nm].height;
//	alert("bef width = " + awidth);
//	alert("bef height = " + aheight);
	document.images[nm].width = (awidth * cper);
	document.images[nm].height = (aheight * cper);
//	document.images[nm].alt = sAltTag;
//	alert("width = " + document.images[nm].width);
//	alert("height = " + document.images[nm].height);
  this.imgObj = document.images[nm]; // get reference to the image object
  this.index = rotateImgObjs.length; rotateImgObjs[this.index] = this;
  this.animString = "rotateImgObjs[" + this.index + "]";
  }
}

rotateImgObj.prototype = {
  addImages: function() { // preloads images
    this.imgObj.imgs = [];
    for (var i=0; i<sImgCnt; i++) {
      this.imgObj.imgs[i] = new Image();
      this.imgObj.imgs[i].src = rotateImgObj.imagesPath + sImages[i];
      this.imgObj.imgs[i].alt = sAltTag[i];
    }
  },
/*
rotateImgObj.prototype = {
  addImages: function() { // preloads images
    this.imgObj.imgs = [];
    for (var i=0; i<arguments.length; i++) {
      this.imgObj.imgs[i] = new Image();
      this.imgObj.imgs[i].src = rotateImgObj.imagesPath + arguments[i];
      this.imgObj.imgs[i].alt = sAltTag[i];
    }
  },
 */

  rotate: function() {
    if (this.ctr < this.imgObj.imgs.length-1) this.ctr++;
    else this.ctr = 0;
    this.imgObj.src = this.imgObj.imgs[this.ctr].src;
    this.imgObj.alt = this.imgObj.imgs[this.ctr].alt;
  }
}

// sets up rotation for all defined rotateImgObjs
rotateImgObj.start = function() {
  for (var i=0; i<rotateImgObjs.length; i++) 
    rotateImgObjs[i].timer = setInterval(rotateImgObjs[i].animString + ".rotate()", rotateImgObjs[i].speed);                     
}

