var skincats=[
"Featured Skins",
"Animals & Nature",
"Places & Landscapes",
"Business & Money",
"Sports",
"Astrology",
"Classic/ Utility",
"Favorite Gadgets",
"Textures",
"Patriotic",
"Kids and Cartoons",
"Decorative",
"Seasonal"
];

var akpath="../";
var skinpagesize=8;
var skinhost="http:\/\/components.viewpoint.com/search/skins/";

// featured skins
var skincat1=[
"featured_wonderland.jpg;winterwonderland_v2.exe;325;142;9,101,136,125;Oh the weather outside is frightful, but the toolbar is so delightful and since you've no place else to go, let it search! Let It Search! Let It Search!",
"featured_charmssnowflakes.jpg;charmssnowflakes_v2.exe;325;138;9,101,136,125;A cool tool in cool blue, just for you. Celebrate the season with some fashionable flakes!",
"featured_astrology.jpg;v2_skins.html?catid=6&page=1;325;145;9,106,136,130;What's your sign? Get your horoscopes delivered right to you every day with our new Astrology Toolbar.  Receive daily, weekly and monthly forecasts within your toolbar from our renowned astrologer."
];

var skincat2=[
"butterfly.jpg;butterfly_v2.exe;343;55;Butterfly;Float like a Butterfly. (355k)",
"underwater.jpg;underwater_v2.exe;343;55;Underwater;Dive right in, Chum! (421k)",
"sun_flowers.jpg;sunflowers_v2.exe;343;60;Sun Flowers;Summer Blossoms in Blue & Yellow. (397k)"
];

var skincat3=[
"honolulu.jpg;honolulu_v2.exe;343;60;Honolulu;Aloha From Hawaii. (482k)",
"lasvegas.jpg;lasvegas_v2.exe;343;60;Las Vegas;Searching Las Vegas. (302k)",
"losangeles.jpg;losangeles_v2.exe;343;60;Los Angeles;Hooray for the Toolbar. (297k)",
"newyork.jpg;newyork_v2.exe;343;60;New York;Toolbar That Never Sleeps. (532k)",
"seattle.jpg;seattle_v2.exe;343;60;Seattle;Searching In Seattle. (464k)",
"desert_sunset.jpg;desertsunset_v2.exe;343;60;Desert Sunset;Soothing Sand and Sun. (362k)",
"ocean_sunset.jpg;oceansunset_v2.exe;343;60;Ocean Sunset;Warm Summer Evening. (352k)"
];

var skincat4=[
"fifty_dollar_bill.gif;money_50_v2.exe;343;50;Fifty Dollar Bill;Show Me the Money. (421k)"
];

var skincat5=[
"football_bluered.jpg;football_bluered_v2.exe;343;71;Football - Blue & Red;Patriot-ic! (426k)",
"football_blackyellow.jpg;football_blackyellow_v2.exe;343;69;Football - Black & Yellow;Saint’ly! (414k)",
"football_bluesilver.jpg;football_silverblue_v2.exe;343;69;Football - Silver & Blue;Ride ‘Em! (412k)",
"football_blueorange.jpg;football_orangeblue_v2.exe;343;69;Football - Orange & Blue;Bucking B’s (412k)",
"football_purpleyellow.jpg;football_purplegold_v2.exe;343;69;Football - Purple & Gold;For the Raves! (412k)",
"football_brownorange.jpg;football_brownorange_v2.exe;343;69;Football - Brown & Orange;Best Location In The Nation (414k)",
"surfer.gif;surf_v2.exe;343;56;Surfer;Cool Surfin'(429k)",
"basketball_green_yellow.jpg;bball_greenyellow_v2.exe;343;48;Basketball - Green & Yellow;Raining Threes (392k)",
"basketball_blue_orange.jpg;bball_blueorange_v2.exe;343;48;Basketball - Blue & Orange;YESSSSSS! (392k)",
"basketball_purple_gold.jpg;bball_purpleyellow_v2.exe;343;48;Basketball - Purple & Gold;Show Time (391k)",
"basketball_red_black.jpg;bball_redblack_v2.exe;343;48;Basketball - Red & Black;Flaming (391k)"
];

var skincat6=[
"horoscopearies.jpg;horoscopearies_v2.exe;343;64;Aries (Mar. 21 - April 20);Energetic and Enthusiastic (308k)",
"horoscopetaurus.jpg;horoscopetaurus_v2.exe;343;64;Taurus (Apr. 21 - May 21);Persevering and Patient (308k)",
"horoscopegemini.jpg;horoscopegemini_v2.exe;343;64;Gemini (May 22 - June 20);Imaginative and Inventive (310k)",
"horoscopecancer.jpg;horoscopecancer_v2.exe;343;64;Cancer (June 21 - July 22);Committed and Caring (307k)",
"horoscopeleo.jpg;horoscopeleo_v2.exe;343;64;Leo (July 23 - Aug 22);Powerful and Proud (307k)",
"horoscopevirgo.jpg;horoscopevirgo_v2.exe;343;64;Virgo (Aug. 23 - Sept. 23);Helpful and Humane (309k)",
"horoscopelibra.jpg;horoscopelibra_v2.exe;343;64;Libra (Sept. 24 - Oct. 23);Charming and Communicative (306k)",
"horoscopescorpio.jpg;horoscopescorpio_v2.exe;343;64;Scorpio (Oct. 24 - Nov. 22);Passionate and Persistent (307k)",
"horoscopesagittarius.jpg;horoscopesagittarius_v2.exe;343;64;Sagittarius (Nov. 23 - Dec. 21);Sensual and Spiritual (309k)",
"horoscopecapricorn.jpg;horoscopecapricorn_v2.exe;343;64;Capricorn (Dec 22 - Jan. 20);Diligent and Driven (307k)",
"horoscopeaquarius.jpg;horoscopeaquarius_v2.exe;343;64;Aquarius (Jan. 21 - Feb. 19);Logical and Loyal (308k)",
"horoscopepisces.jpg;horoscopepisces_v2.exe;343;64;Pisces (Feb. 20 - Mar. 20);Compassionate and Creative (306k)"
];

var skincat7=[
"classic_colors.jpg;classic_colors_v2.exe;343;48;Classic Colors;New and Improved! (337k)",
"crayon_box.jpg;crayon_colors_v2.exe;343;49;Crayon Box;Va Va Va Vibrant Colors (335k)"
]

var skincat8=[
"design_tribute_gold.jpg;dsgn_trib_gold_v2.exe;343;47;Design Tribute - Gold;Good As Gold (265k)",
"design_tribute_green.jpg;dsgn_trib_green_v2.exe;343;47;Design Tribute - Green;Green Machine (265k)",
"design_tribute_pink.jpg;dsgn_trib_pink_v2.exe;343;47;Design Tribute - Pink;In The Pink (271k)",
"design_tribute_silver.jpg;dsgn_trib_silver_v2.exe;343;47;Design Tribute - Silver;Silver Lining (268k)",
"design_tribute.gif;dsgn_trib_blue_v2.exe;343;47;Design Tribute - Blue;Ode to the 'Pod' (266k)"
];

var skincat9=[
"wood.jpg;wood_v2.exe;343;60;Wood;Ingrained Toolbar. (502k)"
];

var skincat10=[
"liberty.jpg;liberty_v2.exe;343;60;Liberty;For The Free and The Brave. (337k)"
];

var skincat11=[
"davy_jones.jpg;davy_jones_v2.exe;343;55;Davy Jones;Look Out For That Shark! (638k)"
];

var skincat12=[
"charms_stars.jpg;charmsstars_v2.exe;343;55;Charms - Stars;Star Player (351k)",
"charms_hearts.jpg;charmshearts_v2.exe;343;55;Charms - Hearts;I Heart You (323k)",
"charms_flowers.jpg;charmsflowers_v2.exe;343;55;Charms - Flovers;Pretty in Pink (363k)",
"charms_clovers.jpg;charmsclovers_v2.exe;343;55;Charms - Clovers;Luck of the Toolbar (340k)",
"charms_snowflakes.jpg;charmssnowflakes_v2.exe;343;55;Charms - Snowflakes;Shiver Me Toolbar (312k)"
];
var skincat13=[
"christmassleigh.jpg;christmassleigh_v2.exe;343;81;SANTA’S SEARCHING!;You Sleigh Me (569k)",
"christmasbells.jpg;christmasjinglebells_v2.exe;343;81;JINGLE BELLS;Ring a ding ding (558k)",
"winterwonderland.jpg;winterwonderland_v2.exe;343;81;TOOLBAR WONDERLAND;Let it search (523k)",
"christmasgifts.jpg;christmasgifts_v2.exe;343;81;CHRISTMAS BOOTY;Presents under your toolbar (556k)",
"wintersnowsanta.jpg;wintersnowsanta_v2.exe;343;81;Jolly Ol’ Toolbar;Sleigh me! (486k)",
"christmas.jpg;christmas_v2.exe;343;64;Christmas Color;Look out for that mistletoe! (516k)",
"chanukah.jpg;chanukah_v2.exe;343;64;Chanukah Celebration;A Toolbar Festival of Lights (403k)",
"thanksgiving.jpg;thanksgiving_v2.exe;343;64;Thanksgiving Special;Toolbar A’Plenty (681k)",
"autumnleaves.jpg;autumnleaves_V2.exe;343;64;Autumn Leaves;Leaving summer behind (491k)",
"autumntreehouse.jpg;autumntreehouse_V2.exe;343;62;Autumn Tree House;Watch the season fall (884k)",
"halloween.jpg;halloween_v2.exe;343;64;Halloween;Mysterious and Spooky (761k)"
];

buildCategories=function(){
	var code="";
	for(var i=0;i<skincats.length;i++){
		if(skincats[i]!=""){
			code+="<option value=\""+(i+1)+"\""
			if(i==skincatid-1)
				code+=" selected";
			code+=">"+skincats[i]+"</option>";
		}
	}
	document.write(code);
}

downloadskin=function(p){
	if(toolbarok)
		top.location=skinhost+p;
	else
		alert("Toolbar and Skins are for Windows, Internet Explorer only.");
}

var grayseparator="<tr><td class=\"separator\"></td></tr>";
buildskinpanel=function(){
	var mycode="<table border=\"0\" width=\""+(skincatid==1?325:345)+"\" height=\""+(skincatid==1?"":528)+"\" cellspacing=\"0\" cellpadding=\"0\">";
	if(skincatid==1){
		mycode+="<tr><td valign=\"top\"><img src=\"images/s.gif\" width=\"1\" height=\"9\"><br>"+
			  "Personalize the look and feel of your toolbar with visual themes that allow you to express who you are."+
			//"Personalize the look and feel of your toolbar with visual themes that allow you to express who you are.  Halloween vs. Horoscope - which skin will you choose?"+
			//"Personalize the look and feel of your toolbar with visual themes, that allow you to express who you are. Keep checking back, this site is updated every two weeks. Next Skin Delivery: 10/18/04"+
			"<br><img src=\"images/s.gif\" width=\"1\" height=\"9\"></td></tr>";
		for(var i=0;i<skincat1.length;i++){
			mycode+="<tr><td height=\"160\"><img src=\""+akpath+"images/skins/"+skincat1[i].split(";")[0]+"\" border=\"0\" width=\""+skincat1[i].split(";")[2]+"\" height=\""+skincat1[i].split(";")[3]+"\" usemap=\"#fs"+i+"\"></td></tr>";
				if(skincat1[i].split(";")[1].indexOf(".exe")!=-1)
					mycode+="<map name=\"fs"+i+"\"><area shape=\"rect\" coords=\""+skincat1[i].split(";")[4]+"\" href=\"javascript:downloadskin('"+skincat1[i].split(";")[1]+"')\"></map>";
				else
					mycode+="<map name=\"fs"+i+"\"><area shape=\"rect\" coords=\""+skincat1[i].split(";")[4]+"\" href=\""+skincat1[i].split(";")[1]+"\"></map>";
			if(i!=skincat1.length-1)
				mycode+=grayseparator;

		}
	}
	else{
		mycode+="<tr><td valign=\"top\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td><img src=\"../images/s.gif\" width=\"1\" height=\"18\"></td></tr>";
		if(skincatid==6)
			mycode+="<tr><td height=\"30\" valign=\"middle\"><b>For entertainment purposes only.</b></td></tr>";
		var catholder=new Array();
		for(var i=0;i<eval("skincat"+skincatid+".length");i++){
			catholder[i]=eval("skincat"+skincatid+"[i]");
		}
		if(catholder.length>0){
			var iupto=((0+skinpagesize*(page-1))+skinpagesize);
			iupto=iupto<catholder.length?iupto:catholder.length;
			for(var i=(0+skinpagesize*(page-1));i<iupto;i++){
				mycode+="<tr><td height=\"122\"><b>"+catholder[i].split(";")[4]+"</b>&nbsp;&nbsp;"+(skincatid==6?"<br>":"")+catholder[i].split(";")[5]+"<br>";
					if(catholder[i].split(";")[1].indexOf(".exe")!=-1)
						mycode+="<a href=\"javascript:downloadskin('"+catholder[i].split(";")[1]+"')\"><img src=\""+akpath+"images/skins/"+catholder[i].split(";")[0]+"\" width=\""+catholder[i].split(";")[2]+"\" border=\"0\" height=\""+catholder[i].split(";")[3]+"\" vspace=\"3\"><br>";
					else
						mycode+="<a href=\""+catholder[i].split(";")[1]+"\"><img src=\""+akpath+"images/skins/"+catholder[i].split(";")[0]+"\" width=\""+catholder[i].split(";")[2]+"\" border=\"0\" height=\""+catholder[i].split(";")[3]+"\" vspace=\"3\"><br>";
				mycode+="<img src=\"../images/buttons/download_71x18.gif\" border=\"0\" width=\"71\" height=\"18\" vspace=\"2\"></a></td></tr>";
				if(i!=iupto-1)
					mycode+=grayseparator;
			}
		}
		mycode+="</table></td></tr>";
	}
	mycode+="</table>";
	if(skincatid!=1){
		if(catholder.length>skinpagesize)
			mycode+="<div align=\"right\" style=\"margin-right:25px\"><b>"+pagepanel(catholder.length)+"</b></div>";
		else
			mycode+="<div>&nbsp;</div>";
	}
	document.write(mycode);
}

pagepanel=function(l){
	var totalpages=l%skinpagesize==0?l/skinpagesize:Math.floor(l/skinpagesize)+1;
	var pagecode=page>1?"<a href=\"v2_skins.html?catid="+skincatid+"&page="+(page-1)+"\" style=\"text-decoration:none\" class=\"orange\"><</a>&nbsp;":"";
	for(var i=1;i<=totalpages;i++){
		if(i!=page)
			pagecode+="<a href=\"v2_skins.html?catid="+skincatid+"&page="+i+"\" class=\"orange\">"+i+"</a>&nbsp;";
		else
			pagecode+=i+"&nbsp;";
	}
	if(page!=totalpages)
		pagecode+="<a href=\"v2_skins.html?catid="+skincatid+"&page="+(page+1)+"\" style=\"text-decoration:none\" class=\"orange\">></a>";
	return pagecode;
}