// Advanced Random Images Start
// Copyright 2001-2002 All rights reserved, by Paul Davis - www.kaosweaver.com
// Modified April 4, 2007 by T. Pietrosanti for tempriteheating.com (property of Mestek, Inc.)
function randImg( pageURL )
{
	var j, d = "", l = "", m = "", p = "", q = "", z = "", KW_ARI = new Array()
	
	switch( pageURL )
	{
		case "/index.asp":
			KW_ARI[KW_ARI.length] =
				'index/rotate/2.jpg?&width=760&height=186&alt=Temprite%20Solutions&title=Temprite%20Solutions';
			KW_ARI[KW_ARI.length] =
				'index/rotate/1.jpg?&width=760&height=186&alt=Temprite%20Solutions&title=Temprite%20Solutions';
			KW_ARI[KW_ARI.length] =
				'index/rotate/3.jpg?&width=760&height=186&alt=Temprite%20Solutions&title=Temprite%20Solutions';
			KW_ARI[KW_ARI.length] =
				'index/rotate/4.jpg?&width=760&height=186&alt=Temprite%20Solutions&title=Temprite%20Solutions';
			KW_ARI[KW_ARI.length] =
				'index/rotate/5.jpg?&width=760&height=186&alt=Temprite%20Solutions&title=Temprite%20Solutions';
			KW_ARI[KW_ARI.length] =
				'index/rotate/6.jpg?&width=760&height=186&alt=Temprite%20Solutions&title=Temprite%20Solutions';
			KW_ARI[KW_ARI.length] =
				'index/rotate/7.jpg?&width=760&height=186&alt=Temprite%20Solutions&title=Temprite%20Solutions';
			KW_ARI[KW_ARI.length] =
				'index/rotate/8.jpg?&width=760&height=186&alt=Temprite%20Solutions&title=Temprite%20Solutions';
		break;
		
		case "/aboutus.asp":
			KW_ARI[KW_ARI.length] =
				'about/rotate/2.jpg?&width=760&height=186&alt=Temprite%20Solutions&title=Temprite%20Solutions';
			KW_ARI[KW_ARI.length] =
				'about/rotate/1.jpg?&width=760&height=186&alt=Temprite%20Solutions&title=Temprite%20Solutions';
			KW_ARI[KW_ARI.length] =
				'about/rotate/3.jpg?&width=760&height=186&alt=Temprite%20Solutions&title=Temprite%20Solutions';
			KW_ARI[KW_ARI.length] =
				'about/rotate/4.jpg?&width=760&height=186&alt=Temprite%20Solutions&title=Temprite%20Solutions';
			KW_ARI[KW_ARI.length] =
				'about/rotate/5.jpg?&width=760&height=186&alt=Temprite%20Solutions&title=Temprite%20Solutions';
			KW_ARI[KW_ARI.length] =
				'about/rotate/6.jpg?&width=760&height=186&alt=Temprite%20Solutions&title=Temprite%20Solutions';
		break;
		
		case "/contactus.asp":
			KW_ARI[KW_ARI.length] =
				'contact/main1.jpg?&width=760&height=186&alt=Temprite%20Solutions&title=Temprite%20Solutions';
		break;
		
		case "/privacy.asp":
			KW_ARI[KW_ARI.length] =
				'start/privacymain.jpg?&width=760&height=125&alt=Temprite%20Solutions&title=Temprite%20Solutions';
		break;
		
		case "/architects.asp":
			KW_ARI[KW_ARI.length] =
				'start/archmain.gif?&width=760&height=125&alt=Temprite%20Solutions&title=Temprite%20Solutions';
		break;
		
		case "/application.asp":
			KW_ARI[KW_ARI.length] =
				'applic/mainImage.jpg?&width=760&height=125&alt=Temprite%20Solutions&title=Temprite%20Solutions';
		break;
		
		case "/reps.asp":
			KW_ARI[KW_ARI.length] =
				'reps/repsMain.jpg?&width=758&height=176&alt=Temprite%20Solutions&title=Temprite%20Solutions';
		break;
		
		case "/repsDetail.asp":
			KW_ARI[KW_ARI.length] =
				'reps/repsMain.jpg?&width=758&height=176&alt=Temprite%20Solutions&title=Temprite%20Solutions';
		break;
		
		case "/developer.asp":
			KW_ARI[KW_ARI.length] =
				'start/devmain.jpg?&width=760&height=125&alt=Temprite%20Solutions&title=Temprite%20Solutions';
		break;
		
		case "/cocacola.asp":
			KW_ARI[KW_ARI.length] =
				'news/main.jpg?&width=760&height=186&alt=Temprite%20Solutions&title=Temprite%20Solutions';
		break;
		
		case "/ato.asp":
			KW_ARI[KW_ARI.length] =
				'products/type/ATOsub.jpg?&width=760&height=125&alt=Temprite%20Solutions&title=Temprite%20Solutions';
		break;
		
		case "/dfs.asp":
			KW_ARI[KW_ARI.length] =
				'products/type/DFSmain.jpg?&width=760&height=125&alt=Temprite%20Solutions&title=Temprite%20Solutions';
		break;
		
		case "/ifs.asp":
			KW_ARI[KW_ARI.length] =
				'products/type/IFSmain.jpg?&width=760&height=125&alt=Temprite%20Solutions&title=Temprite%20Solutions';
		break;
		
		case "/products.asp":
			KW_ARI[KW_ARI.length]='products/headersRandom/2.jpg?&width=758&height=176';
			KW_ARI[KW_ARI.length]='products/headersRandom/4.jpg?&width=758&height=176';
			KW_ARI[KW_ARI.length]='products/headersRandom/1.jpg?&width=758&height=176';
			KW_ARI[KW_ARI.length]='products/headersRandom/3.jpg?&width=758&height=176';
			KW_ARI[KW_ARI.length]='products/headersRandom/5.jpg?&width=758&height=176';
			KW_ARI[KW_ARI.length]='products/headersRandom/6.jpg?&width=758&height=176';
			KW_ARI[KW_ARI.length]='products/headersRandom/7.jpg?&width=758&height=176';
			KW_ARI[KW_ARI.length]='products/headersRandom/8.jpg?&width=758&height=176';
		break;
	}
	
	if( KW_ARI.length > 0 )
	{
		j = parseInt( Math.random() * KW_ARI.length );
		j = (isNaN(j)) ? 0 : j;
		
		document.write("<tr>\n");
		document.write("	<td colspan=\"2\" align=\"center\">\n")
		
		if( KW_ARI[j].indexOf('?') == -1 )
		{
			document.write("<img src='" + KW_ARI[j] + "'>");
		}
		else
		{
			nvp = KW_ARI[j].substring( KW_ARI[j].indexOf('?') + 2 ).split('&');
			
			for( var i = 0; i < nvp.length; i++ )
			{
				sub=nvp[i].split('=');
				switch(sub[0])
				{
					case 'link':
						l = "<a href='" + unescape(sub[1]) + "'>";
						p = "</a>";
					break;
					
					case 'target':
						q = " target='" + unescape(sub[1]) + "'";
					break;
					
					default:
						m += " " + sub[0] + "='" + unescape(sub[1]) + "'";
					break;
				}
			}
			
			z  = (l != "") ? ((q != "") ? l.substring( 0, l.length-1 ) + q + ">" : l) : "";
			z += "<img src='" + KW_ARI[j].substring( 0, KW_ARI[j].indexOf('?') ) + "'" + m + ">" + p;
			
			document.write(z);
		}
		
		document.write("	</td>\n");
		document.write("<tr>\n")
	}
}
// Advanced Random Images End
