var RockCity = {};
RockCity.initHotbuttons = function() {
	var hotbuttons = $$('.hotbutton, .hotbuttonRight, .hotbuttonWithPadding, .hotbuttonRightWithPadding');
	for (var i = 0; i < hotbuttons.length; i++) {
		img = hotbuttons[i];
		aTag = null;
		if (img.parentNode.href != null) {
			aTag = $(img.parentNode);
		}
		else {
			aTag = new Element('a', {
				href:'#'
			});
			img.insert({before:aTag});
			aTag.insert(img);
		}
		title = img.title;
		alt = img.alt;
		if (img.hasClassName('hotbuttonRight')) {
			aTag.addClassName('hotbuttonContainerRight');
		}
		else if (img.hasClassName('hotbuttonWithPadding')) {
			aTag.addClassName('hotbuttonWithPaddingContainer');
		}
		else if (img.hasClassName('hotbutton')) {
			aTag.addClassName('hotbuttonContainer');
		}
		else if (img.hasClassName('hotbuttonRightWithPadding')) {
			aTag.addClassName('hotbuttonRightWithPaddingContainer');
		}
		img.addClassName('hotbuttonItem');
		aTag.insert('<img class="hotbuttonItem hotbuttonOverlay" src="/images/hotButtonOverlay.png" />');
		var fileNameArray = aTag.href.split('/');
		if (fileNameArray.length) {
			var fileName = fileNameArray[fileNameArray.length-1];
			var extensionArray = fileName.split('.');
			var extension = extensionArray[extensionArray.length-1];
			if (extension == 'flv') {
				aTag.href = '/videoPlayer.php?fileName=' + fileName;
			}
		}
		overlay = aTag.select('img')[1];
		overlay.title = title;
		overlay.alt = alt;
		
		if (i == 0) {
			aTag.style.marginLeft = '0';
		}
	};
	if (Papercut.vIE() == 6) {
		DD_belatedPNG.fix('.hotbuttonOverlay');
	}
}
Papercut.vIE = function(){return (navigator.appName=='Microsoft Internet Explorer')?parseFloat((new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})")).exec(navigator.userAgent)[1]):-1;}
Event.observe(window, 'load', RockCity.initHotbuttons);