document.write('<link href="/suisai/common/style/item.css" rel="stylesheet" type="text/css" media="all" />');

jQuery.fn.initScrollPane = function(){
	var settings = {"scrollbarWidth":14};
	jQuery('div#howtoScroll').jScrollPane(settings);
}

jQuery(function(){
	var howtoAreaY = '60px';
	jQuery("div#howtoInner h2 img").each(function(){		
		this.oSrc = this.src;
		this.rSrc = this.oSrc.replace(/(\.gif|\.jpg|\.png)/, "_2" + "$1");
		istRollOver.preloadImage(this.rSrc);
		
		jQuery(this).bind('click', function(){
			this.src = this.rSrc;
			jQuery('div#howtoArea').css('zIndex', '999');
			var elem = (document.getElementById('elementsPink')) ? 'div#elementsPink' : 'div#elementsBlue';
			jQuery(elem).css('zIndex', '99');
			jQuery('div#elementsPink, div#elementsBlue, div#commentPink, div#commentBlue').css('zIndex', '99');
			if(parent != "undefined"){parent.closeBtnHide();}
			var c_y = jQuery('div#howtoArea').offset().top;
			howtoAreaY = (c_y == 60) ? '564px' : '60px';
			jQuery('div#howtoArea').animate({
				top:howtoAreaY
			}, 400,
			function(){
				if(parent != "undefined" && jQuery('div#howtoArea').offset().top == 564){
					parent.closeBtnShow();
					jQuery('div#howtoInner h2 img').each(function(){
						this.src = this.oSrc;
					});
				}else{
					jQuery.fn.initScrollPane();
				}
			});
		});
	});
	var elementsY = '60px';
	jQuery('div#elemntInner h2 img').each(function(){
		
		this.oSrc = this.src;
		this.rSrc = this.oSrc.replace(/(\.gif|\.jpg|\.png)/, "_2" + "$1");
		istRollOver.preloadImage(this.rSrc);
		
		jQuery(this).bind('click', function(){
			this.src = this.rSrc;
			var elem = (document.getElementById('elementsPink')) ? 'div#elementsPink' : 'div#elementsBlue';
			jQuery(elem).css('zIndex', '999');
			jQuery('div#howtoArea, div#commentPink, div#commentBlue').css('zIndex', '99');
			if(parent != "undefined"){parent.closeBtnHide();}
			
			var c_y = jQuery(elem).offset().top;
			elementsY = (c_y == 60) ? '564px' : '60px';
			jQuery(elem).animate({
				top:elementsY
			}, 400,
			function(){
				if(parent != "undefined" && jQuery(elem).offset().top == 564){
					parent.closeBtnShow();
					jQuery('div#elemntInner h2 img').each(function(){
						this.src = this.oSrc;
					});
				}
			});
		});
	});
	var elements02Y = '60px';
	jQuery('div#commentInner h2 img').each(function(){
		
		this.oSrc = this.src;
		this.rSrc = this.oSrc.replace(/(\.gif|\.jpg|\.png)/, "_2" + "$1");
		istRollOver.preloadImage(this.rSrc);
		
		jQuery(this).bind('click', function(){
			this.src = this.rSrc;
			var elem = (document.getElementById('commentPink')) ? 'div#commentPink' : 'div#commentBlue';
			jQuery(elem).css('zIndex', '999');
			jQuery('div#howtoArea, div#elementsPink, div#elementsBlue').css('zIndex', '99');
			if(parent != "undefined"){parent.closeBtnHide();}
			
			var c_y = jQuery(elem).offset().top;
			elements02Y = (c_y == 60) ? '564px' : '60px';
			jQuery(elem).animate({
				top:elements02Y
			}, 400,
			function(){
				if(parent != "undefined" && jQuery(elem).offset().top == 564){
					parent.closeBtnShow();
					jQuery('div#commentInner h2 img').each(function(){
						this.src = this.oSrc;
					});
				}
			});
		});
	});
});

