/*

This part was written exclusively for the sportsnight.net website.

*/

TIBthumbARRAY = new Array(86, 38, 47, 47, 68, 53, 53, 46, 50, 48, 41)
PILOTthumbARRAY = new Array(65, 57, 57, 47, 79, 44, 43, 57, 49, 60, 48, 49, 51, 51, 51, 42, 48, 47, 49, 90, 102, 105, 80, 91, 92, 80)
SEAONEthumbARRAY= new Array(146, 83, 85, 85, 93, 186, 42, 60, 48, 80, 81, 47, 81, 90, 84, 54, 84, 45, 45, 61, 63, 80, 75, 43, 43, 35, 42, 81, 49, 47, 60, 41, 42, 49, 81, 47, 81, 49, 42, 47, 42, 52, 81, 49, 47, 42, 47, 47, 81, 42, 57, 78, 87, 81, 90, 47, 48, 57, 46, 43, 73, 46, 41, 47, 48, 48, 47, 47,  81, 47, 48, 44, 49, 44)
SEATWOthumbARRAY= new Array(44, 51, 51, 50, 50, 58, 58, 58, 49, 94, 72, 73, 47, 78, 48, 48, 47, 62, 63, 62, 48, 63, 62, 63, 61, 62, 64, 64, 62, 63)
TVGUIDEthumbARRAY= new Array(42, 41, 43, 41, 41, 41, 77, 39, 37, 39, 36, 35)
MADthumbARRAY = new Array(93, 93, 93, 93)
BWthumbARRAY = new Array(93, 65, 47, 75, 78)
WALLthumbARRAY = new Array(60, 60, 60, 60, 60)
DUMMYthumbARRAY = new Array(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1)


DUMMYwidthARRAY = new Array(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1)
DUMMYheightARRAY = new Array(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1)

TIBwidthARRAY = new Array(360, 155, 200, 278, 1172, 500, 558, 114, 150,  216, 274)
TIBheightARRAY = new Array(250, 244, 255, 355, 1040, 569, 635, 150, 179, 272, 400)
PILOTwidthARRAY = new Array(374, 240, 240, 130, 200, 100, 123, 385, 110, 380, 117, 122, 127, 127, 127, 86, 91, 88, 89, 240, 313, 446, 244, 910, 917, 244)
PILOTheightARRAY = new Array(346, 254, 253, 167, 151, 136, 172, 406, 134, 378, 145, 149, 149, 150, 149, 124, 113, 112, 109, 160, 184, 255, 184, 600, 600, 184)
SEAONEwidthARRAY = new Array(429, 276, 320, 828, 432, 431, 580, 300, 271, 244, 226, 261, 360, 300, 830, 225, 820, 225, 583, 266, 128, 244, 250, 284, 583, 117, 580, 224, 184, 140, 100, 138, 583, 179, 224, 140, 224, 184, 583, 140, 583, 100, 224, 184, 140, 581, 140, 140, 224, 583, 654, 327, 289, 226, 280, 580, 350, 430, 581, 149, 203, 365, 135, 386, 371, 387, 578, 184, 224, 577, 389, 345, 140, 545)
SEAONEheightARRAY = new Array(176, 200, 225, 583, 278, 139, 830, 300, 336, 184, 168, 330, 266, 200, 593, 250, 583, 300, 778, 262, 121, 184, 200, 400, 821, 200, 830, 166, 224, 180, 100, 200, 830, 220, 166, 180, 166, 224, 830, 180, 830, 115, 166, 224, 180, 825, 180, 180, 166, 830, 683, 250, 200, 168, 187, 738, 440, 450, 750, 210, 168, 480, 200, 494, 461, 481, 743, 224, 166, 739, 490, 466, 180, 740)
SEATWOwidthARRAY = new Array(366, 134, 405, 128, 399, 393, 132, 438, 244, 717, 134, 360, 198, 320, 134, 288, 131, 134, 132, 360, 200, 134, 134, 360, 134, 360, 134, 360, 134, 360)
SEATWOheightARRAY = new Array(495, 158, 480, 154, 480, 407, 136, 450, 300, 459, 112, 296, 251, 246, 167, 360, 167, 129, 125, 346, 248, 128, 130, 345, 132, 346, 125, 338, 130, 345)
TVGUIDEwidthARRAY = new Array(123, 278, 344, 120, 278, 147, 150, 150, 150, 150, 150, 150)
TVGUIDEheightARRAY = new Array(175, 407, 480, 175, 407, 215, 117, 228, 244, 231, 250, 254)
MADwidthARRAY = new Array(768, 768, 768, 1507)
MADheightARRAY = new Array(990, 990, 990, 980)
BWwidthARRAY = new Array(300, 227, 311, 500, 1880)
BWheightARRAY = new Array(200, 208, 399, 400, 1441)
CELLPHONEwidthARRAY = new Array(240, 128, 128, 176, 172, 240, 160, 320)
CELLPHONEheightARRAY = new Array(260, 160, 128, 220, 220, 320, 190, 320)
WALLwidthARRAY = new Array(800, 1024, 1024, 1152, 1280, 1440, 1680)
WALLheightARRAY = new Array(600, 640, 768, 720, 800, 900, 1050)
CELLPHONEnames = new Array("Blackberry<BR><FONT SIZE=-1>240 x 260<\/FONT>", "LG Samsung<BR><FONT SIZE=-1>128 x 160<\/FONT>", "Nokia<BR><FONT SIZE=-1>128 x 128<\/FONT>", "Razr<BR><FONT SIZE=-1>176 x 220<\/FONT>", "Razr v3<BR><FONT SIZE=-1>172 x 220<\/FONT>", "Smartphones<BR><FONT SIZE=-1>240 x 320<\/FONT>", "Treo 600<BR><FONT SIZE=-1>160 x 190<\/FONT>", "Treo 650<BR><FONT SIZE=-1>320 x 320<\/FONT>")
WALLnames = new Array("Trio", "Rally", "Logo", "Stand_By", "One", "Television")

function drawThumbs(promoNum)

{

imgNum=0;
totalImg=0;
tableRows=0;
endTable=false;
cellNum=CELLPHONEnames.length;
wallSizes=WALLwidthARRAY.length;
wallNum=4;


if (promoNum==0) {
DUMMYthumbARRAY = TIBthumbARRAY;
DUMMYwidthARRAY = TIBwidthARRAY;
DUMMYheightARRAY = TIBheightARRAY;
totalImg= TIBthumbARRAY.length;
}
else if (promoNum==1) {
DUMMYthumbARRAY = PILOTthumbARRAY;
DUMMYwidthARRAY = PILOTwidthARRAY;
DUMMYheightARRAY = PILOTheightARRAY;
totalImg = PILOTthumbARRAY.length;
}

else if (promoNum==3) {
DUMMYthumbARRAY = SEAONEthumbARRAY;
DUMMYwidthARRAY = SEAONEwidthARRAY;
DUMMYheightARRAY = SEAONEheightARRAY;
totalImg = SEAONEthumbARRAY.length;
}
else if (promoNum==4) {
DUMMYthumbARRAY = SEATWOthumbARRAY;
DUMMYwidthARRAY = SEATWOwidthARRAY;
DUMMYheightARRAY = SEATWOheightARRAY;
totalImg = SEATWOthumbARRAY.length;
}
else if (promoNum==5) {
DUMMYthumbARRAY = TVGUIDEthumbARRAY;
DUMMYwidthARRAY = TVGUIDEwidthARRAY;
DUMMYheightARRAY = TVGUIDEheightARRAY;
totalImg = TVGUIDEthumbARRAY.length;
}
else if (promoNum==6) {
DUMMYthumbARRAY = MADthumbARRAY;
DUMMYwidthARRAY = MADwidthARRAY;
DUMMYheightARRAY = MADheightARRAY;
totalImg = MADthumbARRAY.length;
}
else if (promoNum==7) {
DUMMYthumbARRAY = BWthumbARRAY;
DUMMYwidthARRAY = BWwidthARRAY;
DUMMYheightARRAY = BWheightARRAY;
totalImg = BWthumbARRAY.length;
}
else if (promoNum==8) {
	DUMMYthumbARRAY = WALLnames;
	for (j=0; j<cellNum; j++) {
		DUMMYwidthARRAY[j] = CELLPHONEwidthARRAY[j];
		DUMMYheightARRAY[j] = CELLPHONEheightARRAY[j];
		}
	for (j=cellNum; j<(cellNum+wallSizes); j++) {
		DUMMYwidthARRAY[j] = WALLwidthARRAY[j-cellNum];
		DUMMYheightARRAY[j] = WALLheightARRAY[j-cellNum];
		}

}

tableRows= Math.ceil(totalImg/10);

document.write("<BR><TABLE VALIGN=TOP ALIGN=LEFT BORDER=0 CELLPADDING=3 CELLSPACING=3><TR><TH>Other Categories</TH></TR><TR><TD ALIGN=CENTER VALIGN=TOP><A HREF= \"index.html#topofpage\" onMouseOver=\"window.status=\'Featured Music\';return true\" onMouseOut=\"window.status=\' \';return true\" TARGET=\"middle\"><IMG SRC=\"music\/music_icon.JPG\" HEIGHT=60 WIDTH=84 ALT=\"Sports Night\"></A><BR><FONT SIZE=-1>Featured Music<BR>(17 songs)<\/FONT><\/TD><\/TR>");

if (promoNum != 0) {
document.write("<TR><TD ALIGN=CENTER VALIGN=TOP><A HREF= \"promo0.html\" onMouseOver=\"window.status=\'Team in Black Promo\';return true\" onMouseOut=\"window.status=\' \';return true\" TARGET=\"middle\"><IMG SRC=\"promo\/sn006a.JPG\" HEIGHT=60 WIDTH=53 ALT=\"Sports Night\"></A><BR><FONT SIZE=-1>Team in Black Promo<BR>(" + TIBthumbARRAY.length + " images)<\/FONT><\/TD><\/TR>");
}

if (promoNum != 1) {
document.write("<TR><TD ALIGN=CENTER VALIGN=TOP><A HREF= \"promo1.html\" onMouseOver=\"window.status=\'Pilot Promo\';return true\" onMouseOut=\"window.status=\' \';return true\" TARGET=\"middle\"><IMG SRC=\"promo\/sn104a.JPG\" HEIGHT=60 WIDTH=79 ALT=\"Sports Night\"><\/A><BR><FONT SIZE=-1>Pilot Promo<BR>(" + PILOTthumbARRAY.length + " images)<\/FONT><\/TD><\/TR>");
}

if (promoNum != 3) {
document.write("<TR><TD ALIGN=CENTER VALIGN=TOP><A HREF= \"promo3.html\" onMouseOver=\"window.status=\'Season One Promo\';return true\" onMouseOut=\"window.status=\' \';return true\" TARGET=\"middle\"><IMG SRC=\"promo\/sn302a.JPG\" HEIGHT=60 WIDTH=85 ALT=\"Sports Night\"><\/A><BR><FONT SIZE=-1>Season One Promo<BR>(" + SEAONEthumbARRAY.length + " images)<\/FONT><\/TD><\/TR>");
}

if (promoNum != 4) {
document.write("<TR><TD ALIGN=CENTER VALIGN=TOP><A HREF= \"promo4.html\" onMouseOver=\"window.status=\'Season Two Promo\';return true\" onMouseOut=\"window.status=\' \';return true\" TARGET=\"middle\"><IMG SRC=\"promo\/sn401a.JPG\" HEIGHT=60 WIDTH=51 ALT=\"Sports Night\"><\/A><BR><FONT SIZE=-1>Season Two Promo<BR>(" + SEATWOthumbARRAY.length + " images)<\/FONT><\/TD><\/TR>");
}

if (promoNum != 5) {
document.write("<TR><TR><TD ALIGN=CENTER VALIGN=TOP><A HREF= \"promo5.html\" onMouseOver=\"window.status=\'TV Guide\';return true\" onMouseOut=\"window.status=\' \';return true\" TARGET=\"middle\"><IMG SRC=\"promo\/sn505a.JPG\" HEIGHT=60 WIDTH=41 ALT=\"Sports Night\"><\/A><BR><FONT SIZE=-1>TV Guide<BR>(" + TVGUIDEthumbARRAY.length + " images)<\/FONT><\/TD><\/TR>");
}

if (promoNum != 6) {
document.write("<TR><TD ALIGN=CENTER VALIGN=TOP><A HREF= \"promo6.html\" onMouseOver=\"window.status=\'MAD Magazine\';return true\" onMouseOut=\"window.status=\' \';return true\" TARGET=\"middle\"><IMG SRC=\"promo\/sn600a.JPG\" HEIGHT=60 WIDTH=93 ALT=\"Sports Night\"><\/A><BR><FONT SIZE=-1>MAD Magazine<BR>(" + MADthumbARRAY.length + " images)<\/FONT><\/TD><\/TR>");
}

if (promoNum != 7) {
document.write("<TR><TD ALIGN=CENTER VALIGN=TOP><A HREF= \"promo7.html\" onMouseOver=\"window.status=\'Black \&amp; White\';return true\" onMouseOut=\"window.status=\' \';return true\" TARGET=\"middle\"><IMG SRC=\"promo\/sn704a.JPG\" HEIGHT=60 WIDTH=78 ALT=\"Sports Night\"><\/A><BR><FONT SIZE=-1>Black \&amp; White<BR>(" + BWthumbARRAY.length + " images)<\/FONT><\/TD><\/TR>");
}

if (promoNum != 8) {
document.write("<TR><TD ALIGN=CENTER VALIGN=TOP><A HREF= \"promo8.html\" onMouseOver=\"window.status=\'Wallpapers \&amp; Backgrounds\';return true\" onMouseOut=\"window.status=\' \';return true\" TARGET=\"middle\"><IMG SRC=\"promo\/Trio60x60.JPG\" HEIGHT=60 WIDTH=60 ALT=\"Sports Night\"><\/A><BR><FONT SIZE=-1>Wallpapers \&amp;<BR>Backgrounds<BR>(" + WALLnames.length + " varieties)<\/FONT><\/TD><\/TR>");
}

document.write("</TABLE>");

document.write("<TABLE VALIGN=TOP BORDER=0 CELLPADDING=3 CELLSPACING=3 BGCOLOR=#CCCCCC><TR><TH COLSPAN=5>");

if (promoNum==0){
document.write("Team in Black Promo");
} else if (promoNum==1) {
document.write("Pilot Promo");
} else if (promoNum==3) {
document.write("Season One Promo");
} else if (promoNum==4) {
document.write("Season Two Promo");
} else if (promoNum==5) {
document.write("TV Guide");
} else if (promoNum==6) {
document.write("MAD Magazine");
} else if (promoNum==7) {
document.write("Black &amp; White");
} else if (promoNum==8) {
document.write("Mobile Device Backgrounds");
}

document.write("<\/TH><\/TR><TR>");

if (promoNum < 8) {

for (j=0; j<tableRows; j++) {
	for (i=0; ((i<10) && (endTable==false)); i++) {
		imgNum= (j*10)+i;
		if (imgNum < totalImg) {
			document.write("<TD ALIGN=CENTER VALIGN=TOP><A HREF= \"promo\/sn" + promoNum + j + i +  ".JPG\" rel=\"lightbox\"><IMG SRC= \"promo\/sn" + promoNum + j + i + "a.JPG\" HEIGHT=60 WIDTH=" + DUMMYthumbARRAY[imgNum] + "BORDER=0 ALT=\"sn" + promoNum + j + i + ".JPG\" \/><\/A><BR><FONT SIZE=-1>sn" + promoNum + j + i + ".JPG<BR>" + DUMMYwidthARRAY[imgNum] + " x " + DUMMYheightARRAY[imgNum] + "<\/FONT><\/TD>");
		}
		else {
			document.write("<TD>&nbsp;</TD>");
		}

		if ((imgNum % 5) == 4) {
			document.write("<\/TR>");
			if (imgNum >= totalImg) {
				endTable= true;
			}
			else {
				document.write("<TR>");
			}
		}
	}
}
} else if (promoNum==8) {
	document.write("<TD COLSPAN=5 ALIGN=CENTER><FONT SIZE=-1>(links open a new window)<\/FONT><\/TD><\/TR><TR>");
	for (j=0; j<cellNum; j++) {
		document.write("<TD ALIGN=LEFT VALIGN=CENTER>" + CELLPHONEnames[j] + "<\/TD>");
		for (i=0; i<WALLnames.length; i++) {
			document.write("<TD><A HREF= \"promo\/" + DUMMYthumbARRAY[i] + DUMMYwidthARRAY[j] + "x" +  DUMMYheightARRAY[j] + ".JPG\" TARGET=\"mobileWin\"><IMG SRC= \"promo\/" + DUMMYthumbARRAY[i] + "60x60.JPG\" HEIGHT=60 WIDTH=60 BORDER=0 ALT=\"" + DUMMYthumbARRAY[i] + DUMMYwidthARRAY[j] + "x" +  DUMMYheightARRAY[j] + ".JPG\" \/><\/A></TD>");
		}
		document.write("<\/TR><TR>");
	}
	document.write("<TD ALIGN=CENTER COLSPAN=5><BR><BR><B>Buddy Icons<\/B><\/TD><\/TR><TR><TD>48 x 48<\/TD>");
	for (i=0; i<WALLnames.length; i++) {
		document.write("<TD ALIGN=CENTER VALIGN=CENTER><A HREF= \"promo\/" + DUMMYthumbARRAY[i] + "48x48.JPG\" rel=\"lightbox\"><IMG SRC= \"promo\/" + DUMMYthumbARRAY[i] + "48x48.JPG\" HEIGHT=48 WIDTH=48 BORDER=0 ALT=\"" + DUMMYthumbARRAY[i] + "48x48.JPG\" \/><\/A></TD>");
	}
	document.write("<\/TR>");
	document.write("<TR><TD ALIGN=CENTER COLSPAN=5><BR><BR><B>Wallpapers<\/B><\/TD><\/TR>");
	for ((j=(cellNum)); (j<(cellNum+wallSizes)); j++) {
		document.write("<TR><TD ALIGN=LEFT VALIGN=CENTER>" + DUMMYwidthARRAY[j] + " x " + DUMMYheightARRAY[j] + "<\/TD>");
		for (i=0; i<wallNum; i++) {
			document.write("<TD><A HREF= \"promo\/" + WALLnames[i] + DUMMYwidthARRAY[j] + "x" +  DUMMYheightARRAY[j] + ".JPG\" rel=\"lightbox\"><IMG SRC= \"promo\/" + WALLnames[i] + "60x60.JPG\" HEIGHT=60 WIDTH=60 BORDER=0 ALT=\"" + WALLnames[i] + "60x60.JPG\" \/><\/A><\/TD>");
		}
		if (wallNum < WALLnames.length) {
			for (i=wallNum; i<(WALLnames.length); i++) {
			document.write("<TD>&nbsp;<\/TD>");
			}
		}
		document.write("<\/TR>");
	}	
}
document.write("<\/TABLE>");
}