// JavaScript Document

// Fix anchor background flickering in IE6
try {
	document.execCommand('BackgroundImageCache', false, true);
} catch(e) {}

// Setup DHTML elements
$(document).ready(function() {  
	$('a[name]').each( function () {
		$(this).attr('id', $(this).attr('name') ).removeAttr('name');
	});
	$('#search_scope').selectbox();
	$('.store_search_form .submit').css({'display':'none'});
	$('.scrollpane').jScrollPane({scrollbarWidth:14,scrollbarMargin:0,showArrows:true,dragMinHeight:20,dragMaxHeight:20,alwaysOn:true,printFriendly:true});
	$('a[rel="popup"]').click( function() {
        window.open( $(this).attr('href'), '', 'toobar=0, resizable=1,scrollbars=1' );
        return false;
    });
	$('a[rel="external"]').click( function() {
        window.open( $(this).attr('href') );
        return false;
    });
	$('a.top').click( function() {
		$('.scrollpane')[0].scrollTo(0);
		return false;
	});
	$('a#navs_mail_friend').tooltip({
		bodyHandler: function() {
			return 'Coming Soon';
		},
		showURL:false,delay:0
	});
	$('a.fancybox').fancybox();
	$('a.fancygame1').fancybox({frameWidth:800,frameHeight:510,wrapperPrefix:"game_"});
	$('a.fancygame2').fancybox({frameWidth:800,frameHeight:510,wrapperPrefix:"game_"});
	$('a.fancygame3').fancybox({frameWidth:800,frameHeight:380,wrapperPrefix:"game_"});
});
$(window).load(function() {
	// recalculate scroll pane size AFTER images fully loaded
	$('.scrollpane').jScrollPane({scrollbarWidth:14,scrollbarMargin:0,showArrows:true,dragMinHeight:20,dragMaxHeight:20,alwaysOn:true,printFriendly:true});
	if (location.hash) {
		$('.scrollpane')[0].scrollTo(location.hash);
	}
});

// Place flash object
swfobject.embedSWF("../swf/en/kids.swf", "banner", "1004", "170", "8.0.0", "../swf/expressInstall.swf", {}, {menu:"false",wmode:"transparent"});
