$(document).ready(function(){
	$('.overlay IMG').pngfix();
	
	
	/*
	
			eraser
	
	*/
	$('.eraser').each(function(){
		$(this).attr('original',$(this).val())
	});
	
	$('.eraser').focus(function(){
		if ($(this).val() == $(this).attr('original')) {
			$(this).val('');
		}
	}),
	
	$('.eraser').blur(function(){
		if ($(this).val() == '') {
			$(this).val($(this).attr('original'));
		}
	});
	
	
	
	/*
	
			menu
	
	*/
	$('A.expand').click(function(){
		if ($(this).parent().hasClass('nolink')) {
			if ($(this).parent().hasClass('active')) {
				$(this).parent().removeClass('active')
			} else {
				$(this).parent().addClass('active')
			}

			$(this).blur();
			return false;
		}
		
		return true;
	});
});


window.onload = function() {
	/*
	
			sIFR
	
	*/
	$('#center_content H1').flash(
			{ 
					src: '/swf/vag_rounded.swf', 
					flashvars: { 
							css: [
									'* { color: #000000; }',
									'a { color: #e62534; text-decoration: none; }',
									'a:hover { text-decoration: underline; }',
							].join(' ')
					},
					wmode: 'transparent'
			},
			{ version: 7 },
			function(htmlOptions) {
					htmlOptions.flashvars.txt = this.innerHTML;
					this.innerHTML = '<div>'+this.innerHTML+'</div>';
					var $alt = $(this.firstChild);
					htmlOptions.height = 23;
					htmlOptions.width = 400;
					$alt.addClass('alt');
					$alt.css('display','none');
					$(this)
							.addClass('flash-replaced')
							.prepend($.fn.flash.transform(htmlOptions));						
			}
	);
	
	$('#extra_column H2, #previous_next DIV').flash(
			{ 
					src: '/swf/vag_rounded.swf', 
					flashvars: { 
							css: [
									'* { color: #000000; }',
									'a { color: #000000; text-decoration: none; }',
									'a:hover { text-decoration: underline; }',
							].join(' ')
					},
					wmode: 'transparent'
			},
			{ version: 7 },
			function(htmlOptions) {
					htmlOptions.flashvars.txt = this.innerHTML;
					this.innerHTML = '<div>'+this.innerHTML+'</div>';
					var $alt = $(this.firstChild);
					htmlOptions.height = 23;
					htmlOptions.width = 107;
					$alt.addClass('alt');
					$alt.css('display','none');
					$(this)
							.addClass('flash-replaced')
							.prepend($.fn.flash.transform(htmlOptions));						
			}
	);
	
	$('P.character_browse SPAN').flash(
			{ 
					src: '/swf/vag_rounded.swf', 
					flashvars: { 
							css: [
									'* { color: #FFFFFF; text-align: center; }',
									'a { color: #FFFFFF; text-decoration: none; }',
							].join(' ')
					},
					wmode: 'transparent'
			},
			{ version: 7 },
			function(htmlOptions) {
					htmlOptions.flashvars.txt = this.innerHTML;
					this.innerHTML = '<div>'+this.innerHTML+'</div>';
					var $alt = $(this.firstChild);
					htmlOptions.height = 33;
					htmlOptions.width = $alt.width();
					$alt.addClass('alt');
					$alt.css('display','none');
					$(this)
							.addClass('flash-replaced')
							.prepend($.fn.flash.transform(htmlOptions));						
			}
	);
}
