function makeWin(imsrc, ww, wh) {
    ww=ww+25; wh=wh+50;
    w1=window.open('','w1','width='+ww+',height='+wh+',status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes');
    w1.document.open();
    w1.document.write("<html><head><title>Image Zoom<\/title><META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\"><META HTTP-EQUIV=\"Expires\" CONTENT=\"-1\"><\/head>");
    w1.document.write("<body bgcolor='#FFFFFF' text='#000000' leftmargin=2 topmargin=10><p align=center>");
    w1.document.write("<a href=javascript:close();><img border=0 title=\"Click to Close\" alt=\"Click to Close\" name=theimg src=" + imsrc + "></a><br>");
    w1.document.write("<a href=\"javascript:window.close();\"><font size=1 face=tahoma color=#000000>close window<\/font><\/a><\/body><\/html>");
    w1.focus();
};

////////////////////////////////////////////////
//	IMAGE PAGE MOUSEOVER SCRIPT
////////////////////////////////////////////////
function prepImages(id) {
	if (document.getElementById){
		var div=document.getElementById(id);
		var orig=document.getElementById('mainimg')?document.getElementById('mainimg'):null;
		var origsrc=orig.getAttribute('src')?orig.getAttribute('src'):null;
		var links=div.getElementsByTagName('A');
		if (orig!=null) orig.parentNode.setAttribute('href','');
		for (var i=0;i<links.length;i++){
			links[i].onmouseover=function (){orig.setAttribute('src',this.getAttribute('href'));};
			links[i].onmouseout=function (){orig.setAttribute('src',origsrc);};
		}
	}
}

/////////////////////////////////////////////////
//	HOME PAGE IMAGE ROTATING SCRIPTS
/////////////////////////////////////////////////
//	global limiting var for use in checkImageLimit
var imgLimit=0;
//	init rotating script after div#preload.
function rotateHomeImage(t) {
	// check for t, if no t default to 4000 milliseconds.
	t=(t!=null)? t: 4000;
	// get the target image
	var img0=document.getElementById('img0').firstChild;
	// get the images that are to be rotated
	var pre=document.getElementById('preloaded').getElementsByTagName('IMG');
	// get the number of images that are to be rotated
	imgLimit=pre.length;
	// get a random number and check to make sure its within the bounds of the limit.
	var rand=checkImageLimit(Math.round((Math.random(1)+Math.random())*10));
	// change the image.
	img0.setAttribute('src',pre.item(rand-1).getAttribute('src'));
	//window.status = 'image number: '+rand+' path: '+img0.getAttribute('src');
	// wait t milliseconds default should be about 4000
	setTimeout('rotateHomeImage('+t+')',t);
}
// make sure that the random integer is within the number of available images.
function checkImageLimit(n){
	while (n>imgLimit){
		n=n-3;
	}
	if (n<1){
		n=1;
	}
	return n;
}
//	end rotating image scripts
///////////////////////////////////////////////////

///////////////////////////////////////////////////
//	TESTIMONIALS JS
///////////////////////////////////////////////////
var uniqueArr = new Array();
var y;
function testimonials(classname,showtotal,arrayName){
	if(showtotal > arrayName.length)
		showtotal = arrayName.length;
	
	for(var i=0; i < showtotal; i ++){
		y = Math.ceil(Math.random()*arrayName.length);
		uniqueArr[i] = arrayName[y-1];
		arrayName.splice(y-1,1);
	}
	
	document.write("<ul class=\""+ classname +" clear\">");
	for(var i = 0; i < showtotal; i++){
		document.write("<li>");
		document.write(uniqueArr[i]);
		document.write("</li>");
	}
	document.write("</ul>");
}

//	end testimonials js
////////////////////////////////////////////////////