﻿var Text = Class.create();
Text.prototype = {
	initialize: function() {
//		this.sifr();
	},

//	sifr: function() {
//		if (!Prototype.Browser.IE6) {
//			var gotham = { src: Prototype.ApplicationPath + 'swf/gotham.swf' };
//			var gothamMedium = { src: Prototype.ApplicationPath + 'swf/gotham-medium.swf' };
//			var gothamThick = { src: Prototype.ApplicationPath + 'swf/gotham-thick.swf' };

//			sIFR.activate(gotham);
//			sIFR.activate(gothamThick);

//			sIFR.replace(gotham, {
//				selector: '#email h3',
//				css: '.sIFR-root { color: #373737; background: #FFFFFF; text-transform: uppercase; letter-spacing: 0.1; kerning: true; }',
//				wmode: 'transparent',
//				ratios: [8, 1.3, 9, 1.22, 10, 1.25, 11, 1.22, 12, 1.2, 18, 1.19, 21, 1.15, 22, 1.16, 30, 1.15, 40, 1.14, 52, 1.13, 85, 1.12, 88, 1.11, 90, 1.12, 98, 1.11, 99, 1.12, 1.11]
//			});

//			/* Headers */
//			sIFR.replace(gotham, {
//				selector: '#header h3, div.brand div.details h3, #rogerseller #extended h3, div.instructions h3, div.new-arrivals div.details h4, div.page h3, div.employment div.details h4.state',
//				css: '.sIFR-root { color: #FFFFFF; background: #373737; text-transform: uppercase; letter-spacing: 0.1; kerning: true; cursor: arrow }',
//				wmode: 'transparent',
//				onRelease: function() {
//					/* Have to do this because IE sucks at picking up the click event for sifr elements */
//					if (Prototype.Browser.IE) {
//						var header = $('header');
//						if (header) {
//							if ($('header').select('input').length > 0) {
//								header.select('h3')[0].hide();
//								header.select('input')[0].show();
//								header.select('input')[0].focus();
//							}
//						}
//					}
//				},
//				ratios: [8, 1.3, 9, 1.22, 10, 1.25, 11, 1.22, 12, 1.2, 18, 1.19, 21, 1.15, 22, 1.16, 30, 1.15, 40, 1.14, 52, 1.13, 85, 1.12, 88, 1.11, 90, 1.12, 98, 1.11, 99, 1.12, 1.11]
//			});


//			/* Product Header */
//			sIFR.replace(gotham, {
//				selector: 'div.product div.details h3',
//				css: '.sIFR-root { color: #FFFFFF; background: #373737; text-transform: uppercase; letter-spacing: -0.5; kerning: true; }',
//				wmode: 'transparent',
//				ratios: [8, 1.3, 9, 1.22, 10, 1.25, 11, 1.22, 12, 1.2, 18, 1.19, 21, 1.15, 22, 1.16, 30, 1.15, 40, 1.14, 52, 1.13, 85, 1.12, 88, 1.11, 90, 1.12, 98, 1.11, 99, 1.12, 1.11]
//			});

//			/* Shadowbox headers */

//			sIFR.replace(gotham, {
//				selector: '#welscad #extended h3, #video #extended h3',
//				css: '.sIFR-root { color: #373737; background: #FFFFFF; text-transform: uppercase; letter-spacing: 0.1; kerning: true; }',
//				wmode: 'transparent',
//				ratios: [8, 1.3, 9, 1.22, 10, 1.25, 11, 1.22, 12, 1.2, 18, 1.19, 21, 1.15, 22, 1.16, 30, 1.15, 40, 1.14, 52, 1.13, 85, 1.12, 88, 1.11, 90, 1.12, 98, 1.11, 99, 1.12, 1.11]
//			});


//			/* Selector brand names */

//			sIFR.replace(gothamMedium, { selector: '#selector #products h4',
//				css: [
//				'.sIFR-root { color: #FFFFFF; background: #373737; text-transform: uppercase; }',
//				'.sIFR-root a { color: #FFFFFF; background: #373737; text-decoration: none; letter-spacing: 0.1; kerning: true; margin: 0 37px 0 10px; }',
//				'.sIFR-root a:hover { color: #66FFCC; text-decoration: none; }'
//			],
//				wmode: 'transparent',
//				ratios: [8, 1.3, 9, 1.22, 10, 1.25, 11, 1.22, 12, 1.2, 18, 1.19, 21, 1.15, 22, 1.16, 30, 1.15, 40, 1.14, 52, 1.13, 85, 1.12, 88, 1.11, 90, 1.12, 98, 1.11, 99, 1.12, 1.11]
//			});


//			/* Headers */
//			sIFR.replace(gothamThick, {
//				selector: '#range h5',
//				css: '.sIFR-root { color: #373737; background: #FFFFFF; text-transform: uppercase; letter-spacing: 0.1; kerning: true; }',
//				wmode: 'transparent',
//				ratios: [8, 1.3, 9, 1.22, 10, 1.25, 11, 1.22, 12, 1.2, 18, 1.19, 21, 1.15, 22, 1.16, 30, 1.15, 40, 1.14, 52, 1.13, 85, 1.12, 88, 1.11, 90, 1.12, 98, 1.11, 99, 1.12, 1.11]
//			});


//			/*  Brand name links */
//			sIFR.replace(gotham, { selector: 'div.brands div span',
//				css: [
//				'.sIFR-root { color: #FFFFFF; background: #373737; text-transform: uppercase; }',
//				'.sIFR-root a { cursor: pointer; color: #FFFFFF; background: #373737; text-decoration: none; letter-spacing: 0.1; kerning: true; margin: 0 37px 0 10px; font-size: 12px; }',
//				'.sIFR-root a:hover { cursor: pointer; color: #66FFCC; text-decoration: none; }'
//			],
//				wmode: 'transparent',
//				ratios: [8, 1.3, 9, 1.22, 10, 1.25, 11, 1.22, 12, 1.2, 18, 1.19, 21, 1.15, 22, 1.16, 30, 1.15, 40, 1.14, 52, 1.13, 85, 1.12, 88, 1.11, 90, 1.12, 98, 1.11, 99, 1.12, 1.11]
//			});




//			var homeLinks = $$('#home li a var', 'div.promotions em');
//			for (var x = 0, y = homeLinks.length; x < y; x++) {
//				var link = homeLinks[x];
//				var rel = link.getAttribute('rel');
//				var textColourOff = '#999999';
//				var textColourOn = '#66FFCC';
//				var bgColourOff = '#FFFFFF';
//				var bgColourOn = '#FFFFFF';

//				if (!rel) {
//					rel = link.up().getAttribute('rel');
//				}

//				if (rel) {
//					var colours = rel.split(';');
//					textColourOff = colours[0];
//					textColourOn = colours[1];
//					bgColourOff = colours[2];
//					bgColourOn = colours[3];
//				}

//				sIFR.replace(gotham, { selector: '#' + ((link.up().id) ? link.up().id : link.immediateDescendants()[0].id),
//					css: [
//						'.sIFR-root { cursor: pointer; color: ' + textColourOff + '; background-color: ' + bgColourOff + '; text-decoration: none; text-transform: uppercase;}',
//						'.sIFR-root a { cursor: pointer; color: ' + textColourOff + '; background-color: ' + bgColourOff + '; text-decoration: none; text-transform: uppercase;}',
//						'.sIFR-root a:hover { cursor: pointer; color: ' + textColourOn + '; background-color: ' + bgColourOn + '; text-decoration: none;  text-transform: uppercase;}'
//					],
//					wmode: 'transparent',
//					ratios: [8, 1.3, 9, 1.22, 10, 1.25, 11, 1.22, 12, 1.2, 18, 1.19, 21, 1.15, 22, 1.16, 30, 1.15, 40, 1.14, 52, 1.13, 85, 1.12, 88, 1.11, 90, 1.12, 98, 1.11, 99, 1.12, 1.11]
//				});
//			}

//			/* Preserve custom anti-aliasing set in FLA */
//			sIFR.preserveAntiAlias = true;
//			sIFR.forceTextTransform = true;
//		}
//	},

	randomID: function(len) {
		var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
		var randomID = '';
		for (var i = 0; i < len; i++) {
			var rnum = Math.floor(Math.random() * chars.length);
			randomID += chars.substring(rnum, rnum + 1);
		}

		return randomID;
	}
};

var text;
Event.observe(document, 'dom:loaded', function() {
	text = new Text();
});

