
// 'stacks' is the Stacks global object.
// All of the other Stacks related Javascript will 
// be attatched to it.
var stacks = {};


// this call to jQuery gives us access to the globaal
// jQuery object. 
// 'noConflict' removes the '$' variable.
// 'true' removes the 'jQuery' variable.
// removing these globals reduces conflicts with other 
// jQuery versions that might be running on this page.
stacks.jQuery = jQuery.noConflict(true);

// Javascript for stacks_in_899_page21
// ---------------------------------------------------------------------

// Each stack has its own object with its own namespace.  The name of
// that object is the same as the stack's id.
stacks.stacks_in_899_page21 = {};

// A closure is defined and assigned to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for referring
// to this object from elsewhere.
stacks.stacks_in_899_page21 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
//Sliding Panel Top script



var jsp = jQuery.noConflict();
(function (jQuery) {
	jsp.fn.SPbutton_stacks_in_899_page21 = function (options) 
	{
		jsp(this).html('<div id="SPbutton_stacks_in_899_page21"></div><div id="SPBlock_stacks_in_899_page21"></div>');
		
		jsp('div#SPbutton_stacks_in_899_page21').toggle(function () 
		{
			//
			
			jsp(this).animate({"marginTop": "-=2px"},"fast");
			jsp('#SPBlock_stacks_in_899_page21').animate({"marginTop": "-=0px"},"fast");
			jsp(this).animate({"marginTop": "+=50"},"slow");
			jsp('#SPBlock_stacks_in_899_page21').animate({"marginTop": "+=50"},"slow");
            
            jsp('#SPBlock_stacks_in_899_page21').css({'cursor' : 'default'}).click(function (e) {e.stopPropagation();});
			// Make active
			
		},
		function () 
		{
			jsp('#SPBlock_stacks_in_899_page21').animate({"marginTop": "-=50"},"slow");
			jsp(this).animate({"marginTop": "-=50"},"slow").animate({"marginTop": "+=2px"},"fast");
                       
			// active
			
             
		});//toggle
        
            //Link on body
             
	}
})(jQuery);

	jQuery(function(){
		jsp('body').append('<div id="SlidingPanel_stacks_in_899_page21"></div>');
		jsp('#SlidingPanel_stacks_in_899_page21').SPbutton_stacks_in_899_page21();
		jsp('#SPBlock_stacks_in_899_page21').html( jsp('#SlidingPanelContent_stacks_in_899_page21').html() );
		jsp('#SPbutton_stacks_in_899_page21').html( jsp('#button_stacks_in_899_page21').html() );
		jsp('#SlidingPanelContent_stacks_in_899_page21').remove();
		jsp('#button_stacks_in_899_page21').remove();
		var oldheight = jsp('#SPBlock_stacks_in_899_page21').height();
		var newheight = oldheight - 2;
		jsp('#SPBlock_stacks_in_899_page21').height( newheight ); 
        jsp('#SPBlock_stacks_in_899_page21').addClass('SlidingPanelTop');
                
        //Button settings
                
        var newwidth = jsp('#SPbutton_stacks_in_899_page21').outerWidth();
        jsp('#SPbutton_stacks_in_899_page21').css({'left': '50%', 'marginLeft': '-' + (newwidth / 2) + 'px'});
        var contentwidth = jsp('#SPBlock_stacks_in_899_page21').outerWidth();
        
        
        //Content settings
        
        
                
        //Add Color and transparency
        jsp("<div class='SPBlock2_stacks_in_899_page21'></div>").prependTo("#SPBlock_stacks_in_899_page21");
        jsp("<div class='SPBlock3_stacks_in_899_page21'></div>").prependTo("#SPBlock_stacks_in_899_page21");
        jsp(".SPBlock3_stacks_in_899_page21").css({'background-color': '#666666', 'opacity': '0.70', 'min-height': '100%', 'min-width': '100%', 'position': 'absolute', 'top': '0', 'z-index': '-3'});
    });
	

//Open Panel
OpenSP5 = function(MyPanel) {jsp('#SPbutton_stacks_in_899_page21').addClass('action_stacks_in_899_page21');
    if( jsp('#SPbutton_stacks_in_899_page21').hasClass('action_stacks_in_899_page21') )
        {
            jsp('.action_stacks_in_899_page21').click();
            jsp('#SPbutton_stacks_in_899_page21').removeClass('action_stacks_in_899_page21');
        }
}; 

//GLOBAL IE FIXES
//IE6 fix
if($.browser.msie && $.browser.version=="6.0"){
    $(document).ready(function() {
        jsp("#SPbutton_stacks_in_899_page21").css({'position': 'absolute'});
    });
}    
if (jQuery.browser.msie && jQuery.browser.version > 6) {  
    $(document).ready(function() {
        jsp("#SPBlock_stacks_in_899_page21").css({'position': 'absolute', 'z-index': '10539'});
    });
} 

	return stack;
})(stacks.stacks_in_899_page21);


// Javascript for stacks_in_25_page21
// ---------------------------------------------------------------------

// Each stack has its own object with its own namespace.  The name of
// that object is the same as the stack's id.
stacks.stacks_in_25_page21 = {};

// A closure is defined and assigned to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for referring
// to this object from elsewhere.
stacks.stacks_in_25_page21 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
/* Flex EZ Button Stack by RWExtras v1.0.1 */
/* Copyright (C) 2011 by RWExtras (http://rwextras.com) */
jQuery(document).ready(function() {
var bg1 = $('<img />').attr('src', 'files/ez_sprites/bgsprite1.png');
var bg2 = $('<img />').attr('src', 'files/ez_sprites/bgsprite2.png');
var $ezlink = jQuery('.ezbutton_stacks_in_25_page21 .ez_middle a');
var $leftside = jQuery('.ezbutton_stacks_in_25_page21 .ez_left');
var $rightside = jQuery('.ezbutton_stacks_in_25_page21 .ez_right');
var $middle = jQuery('.ezbutton_stacks_in_25_page21 .ez_middle');
if($ezlink.length == 0 ) {
	jQuery('.ezbutton_stacks_in_25_page21 > span').wrapAll('<a href="#"></a>');
	$middle.html('Add link...');
	} else {
	$middle.html($ezlink.html());
	jQuery('.ezbutton_stacks_in_25_page21 > span').wrapAll($ezlink.html(''));
	$ezlink.remove();
}
switch ('center'){
case 'left':
jQuery('.ezbutton_stacks_in_25_page21').css('margin-left','0');
break;
case 'right':
jQuery('.ezbutton_stacks_in_25_page21').css('margin-right','0');
break;
default :
jQuery('.ezbutton_stacks_in_25_page21').css('margin','0 auto');
}
var $shift = ('square' == 'square')?22:0;
var $left = -$shift;
var $right = -$shift - 10;
var $bg_top = - (1 -1)*76;
var $hov_top = - (3 -1)*76;
var $bg_topm = $bg_top - 38;
var $hov_topm = $hov_top - 38;
jQuery('.ezbutton_stacks_in_25_page21 a > span').addClass('ezbg');
$middle.css({'width':210 - 20 + 'px','background-position': '0px ' + $bg_topm + 'px'});
$leftside.css({'background-position': $left + 'px ' + $bg_top + 'px'});
$rightside.css({'background-position': $right + 'px ' + $bg_top + 'px'});
jQuery('.ezbutton_stacks_in_25_page21').fadeIn(1*200);
jQuery('.ezbutton_stacks_in_25_page21').hover(function(){
jQuery('.ezbutton_stacks_in_25_page21 a > span').removeClass('ezbg').addClass('ezhover');
$middle.css({'background-position': '0px ' + $hov_topm + 'px'});
$leftside.css({'background-position': $left + 'px ' + $hov_top + 'px'});
$rightside.css({'background-position': $right + 'px ' + $hov_top + 'px'});
},function(){
jQuery('.ezbutton_stacks_in_25_page21 a > span').removeClass('ezhover').addClass('ezbg');
$middle.css({'background-position': '0px ' + $bg_topm + 'px'});
$leftside.css({'background-position': $left + 'px '+ $bg_top + 'px'});
$rightside.css({'background-position': $right + 'px '+ $bg_top + 'px'});
});
});
/* End of Flex EZ Button Stack */
	return stack;
})(stacks.stacks_in_25_page21);


// Javascript for stacks_in_806_page21
// ---------------------------------------------------------------------

// Each stack has its own object with its own namespace.  The name of
// that object is the same as the stack's id.
stacks.stacks_in_806_page21 = {};

// A closure is defined and assigned to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for referring
// to this object from elsewhere.
stacks.stacks_in_806_page21 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
jQuery(document).ready(function(e){
	jQuery('#signUpstacks_in_806_page21wrapper button#cancelBut').click(function(e) {
		if (fade=='fade') {
			jQuery('#signUpstacks_in_806_page21wrapper').stop().fadeOut(200, function() {
				jQuery(this).hide;
				jQuery('a.showSU').show();
				});
			
			e.preventDefault();
		}
		
	});
	
	jQuery('a.showSU').click(function(e) {
		if (fade=='fade') {
			jQuery('#signUpstacks_in_806_page21wrapper #contact_form').show();
			jQuery('#signUpstacks_in_806_page21wrapper').stop().fadeIn(200);
			jQuery('a.showSU').css('display', 'none');
		}
		e.preventDefault();
	});
	
	

	jQuery("#signUpstacks_in_806_page21wrapper button#submitBut").click(function(e) {
		var firstname=jQuery('#signUpstacks_in_806_page21wrapper input#firstname').val();
		var lastname=jQuery('#signUpstacks_in_806_page21wrapper input#lastname').val();
		var email=jQuery('#signUpstacks_in_806_page21wrapper input#email').val();
		if ((firstname=='') || (lastname=='') || (email=='')) {
			alert('All fields are required');
			return false;
		}
		
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		
	   if(reg.test(email) == false) {
	      alert('Please enter a valid mail address');
	      return false;
	   }
		jQuery(this).attr('disabled', 'disabled');
		
		jQuery('#submitBut').add('#cancelBut').fadeOut(200, function() {
			jQuery('#signUpstacks_in_806_page21wrapper #process').fadeIn();
		});
		
		var list="news";
		var dataString = 'lastname='+ lastname + '&email=' + email + '&firstname=' + firstname + '&cmd=subscribe&list=' + list +'&resptype=simple';  
		jQuery.ajax({  
			type: "POST",  
			url: "http://www.ookina-hako.com/elston_mlm/lm.php",  
			data: dataString,  
			success: function() {
				jQuery('#signUpstacks_in_806_page21wrapper #contact_form').stop().fadeOut(500, function() {
					jQuery('#signUpstacks_in_806_page21wrapper #message').fadeIn(500).delay(5000).fadeOut(500, function() {
						jQuery('#signUpstacks_in_806_page21wrapper').stop().fadeOut(500);
					});
				}); 
				
			}  
		});
	
	return false;
	});
	
	
	
	var layout='horizontal';
	if (layout=='vertical') {
			jQuery('#signUpstacks_in_806_page21wrapper').css({
				'position': 'absolute',
				'top': '-5000px',
				'display': 'block'
			});
		var theMaxLabelWidth=0;
		jQuery('#signUpstacks_in_806_page21wrapper #myForm label').each(function() {
			var theTmpInputWidth=jQuery(this).outerWidth();
			if (theTmpInputWidth>theMaxLabelWidth) {
				theMaxLabelWidth=theTmpInputWidth;
			}
		});
		jQuery('#signUpstacks_in_806_page21wrapper').css({
			'position': 'static',
			'top': 'auto',
			'display': 'none'
		});
		
		
		var margLeft=theMaxLabelWidth+6+'px';
		jQuery('#signUpstacks_in_806_page21wrapper #myForm input').css('margin-bottom', '6px').after('<br>');
		
		jQuery('#signUpstacks_in_806_page21wrapper button#submitBut').css({
			'margin-left': margLeft,
			'margin-top': '10px'
			});
		jQuery('#signUpstacks_in_806_page21wrapper label').css({
			'display': 'inline-block',
			'width': theMaxLabelWidth
		});
		jQuery('#signUpstacks_in_806_page21wrapper input').css({
			'margin-right': '0'
		});
	}
	else {
		jQuery('#signUpstacks_in_806_page21wrapper label').css({
			'display': 'inline'
		});
	}
	var fade='fade';
		if (fade=='nofade') {
			jQuery('#signUpstacks_in_806_page21wrapper').css('display', 'block');
		}
	var bg_color = $('#stacks_in_806_page21').css('background-color'); 
	if (bg_color) { 
		$('#stacks_in_806_page21').css({'background-color': 'transparent'});     
		$('#stacks_in_806_page21 form').css({'background-color': bg_color });   
	}
	/*var theColor = $('#stacks_in_806_page21').css('color'); 
	if (theColor) { 
		$('#stacks_in_806_page21').css({'color': 'transparent'});     
		$('#stacks_in_806_page21 form').css({'color': theColor });   
	}*/
	var move='false';
	if (move=='true') {
		jQuery('#SUMove').append(jQuery('#signUpstacks_in_806_page21wrapper'));
	}
	
    return;
});
	return stack;
})(stacks.stacks_in_806_page21);


// Javascript for stacks_in_37_page21
// ---------------------------------------------------------------------

// Each stack has its own object with its own namespace.  The name of
// that object is the same as the stack's id.
stacks.stacks_in_37_page21 = {};

// A closure is defined and assigned to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for referring
// to this object from elsewhere.
stacks.stacks_in_37_page21 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
(function($){ 
	var current_pos = "outside";
	$(document).ready(function(){
        var expand = function(){
			current_pos = "inside";
            $('#stacks_in_37_page21 .expand').fadeOut(100,function(){
                $('#stacks_in_37_page21 .shrink').fadeIn(100, function(){
                    $('#stacks_in_37_page21 .content_hidden').slideDown(500);
					if(current_pos == "outside"){
						$('#stacks_in_37_page21 .content_hidden').hide();
						$('#stacks_in_37_page21 .shrink').hide();
						$('#stacks_in_37_page21 .expand').show();
					}
                });
            });
        };
        var shrink = function(){
			current_pos = "outside"
            $('#stacks_in_37_page21 .content_hidden').slideUp(500, function(){
                $('#stacks_in_37_page21 .shrink').fadeOut(100,function(){
                	$('#stacks_in_37_page21 .expand').fadeIn(100);
					if(current_pos == "inside"){
						$('#stacks_in_37_page21 .content_hidden').show();
						$('#stacks_in_37_page21 .shrink').show();
						$('#stacks_in_37_page21 .expand').hide();
						
					}
            	});
            });
        };
        
		$('#stacks_in_37_page21 .expand').click(expand);
        if(false){
            $('#stacks_in_37_page21 .content_expander').mouseenter(expand);
            $('#stacks_in_37_page21 .content_expander').mouseleave(shrink);
			//$('#stacks_in_37_page21 .content_expander').mouseout(shrink);
        }
		
		$('#stacks_in_37_page21 .shrink').click(shrink);
		

	});
	
})(jQuery);
	return stack;
})(stacks.stacks_in_37_page21);


// Javascript for stacks_in_39_page21
// ---------------------------------------------------------------------

// Each stack has its own object with its own namespace.  The name of
// that object is the same as the stack's id.
stacks.stacks_in_39_page21 = {};

// A closure is defined and assigned to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for referring
// to this object from elsewhere.
stacks.stacks_in_39_page21 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
/* Flex EZ Button Stack by RWExtras v1.0.1 */
/* Copyright (C) 2011 by RWExtras (http://rwextras.com) */
jQuery(document).ready(function() {
var bg1 = $('<img />').attr('src', 'files/ez_sprites/bgsprite1.png');
var bg2 = $('<img />').attr('src', 'files/ez_sprites/bgsprite2.png');
var $ezlink = jQuery('.ezbutton_stacks_in_39_page21 .ez_middle a');
var $leftside = jQuery('.ezbutton_stacks_in_39_page21 .ez_left');
var $rightside = jQuery('.ezbutton_stacks_in_39_page21 .ez_right');
var $middle = jQuery('.ezbutton_stacks_in_39_page21 .ez_middle');
if($ezlink.length == 0 ) {
	jQuery('.ezbutton_stacks_in_39_page21 > span').wrapAll('<a href="#"></a>');
	$middle.html('Add link...');
	} else {
	$middle.html($ezlink.html());
	jQuery('.ezbutton_stacks_in_39_page21 > span').wrapAll($ezlink.html(''));
	$ezlink.remove();
}
switch ('center'){
case 'left':
jQuery('.ezbutton_stacks_in_39_page21').css('margin-left','0');
break;
case 'right':
jQuery('.ezbutton_stacks_in_39_page21').css('margin-right','0');
break;
default :
jQuery('.ezbutton_stacks_in_39_page21').css('margin','0 auto');
}
var $shift = ('square' == 'square')?22:0;
var $left = -$shift;
var $right = -$shift - 10;
var $bg_top = - (1 -1)*76;
var $hov_top = - (3 -1)*76;
var $bg_topm = $bg_top - 38;
var $hov_topm = $hov_top - 38;
jQuery('.ezbutton_stacks_in_39_page21 a > span').addClass('ezbg');
$middle.css({'width':210 - 20 + 'px','background-position': '0px ' + $bg_topm + 'px'});
$leftside.css({'background-position': $left + 'px ' + $bg_top + 'px'});
$rightside.css({'background-position': $right + 'px ' + $bg_top + 'px'});
jQuery('.ezbutton_stacks_in_39_page21').fadeIn(1*200);
jQuery('.ezbutton_stacks_in_39_page21').hover(function(){
jQuery('.ezbutton_stacks_in_39_page21 a > span').removeClass('ezbg').addClass('ezhover');
$middle.css({'background-position': '0px ' + $hov_topm + 'px'});
$leftside.css({'background-position': $left + 'px ' + $hov_top + 'px'});
$rightside.css({'background-position': $right + 'px ' + $hov_top + 'px'});
},function(){
jQuery('.ezbutton_stacks_in_39_page21 a > span').removeClass('ezhover').addClass('ezbg');
$middle.css({'background-position': '0px ' + $bg_topm + 'px'});
$leftside.css({'background-position': $left + 'px '+ $bg_top + 'px'});
$rightside.css({'background-position': $right + 'px '+ $bg_top + 'px'});
});
});
/* End of Flex EZ Button Stack */
	return stack;
})(stacks.stacks_in_39_page21);


// Javascript for stacks_in_42_page21
// ---------------------------------------------------------------------

// Each stack has its own object with its own namespace.  The name of
// that object is the same as the stack's id.
stacks.stacks_in_42_page21 = {};

// A closure is defined and assigned to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for referring
// to this object from elsewhere.
stacks.stacks_in_42_page21 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
/* Flex EZ Button Stack by RWExtras v1.0.1 */
/* Copyright (C) 2011 by RWExtras (http://rwextras.com) */
jQuery(document).ready(function() {
var bg1 = $('<img />').attr('src', 'files/ez_sprites/bgsprite1.png');
var bg2 = $('<img />').attr('src', 'files/ez_sprites/bgsprite2.png');
var $ezlink = jQuery('.ezbutton_stacks_in_42_page21 .ez_middle a');
var $leftside = jQuery('.ezbutton_stacks_in_42_page21 .ez_left');
var $rightside = jQuery('.ezbutton_stacks_in_42_page21 .ez_right');
var $middle = jQuery('.ezbutton_stacks_in_42_page21 .ez_middle');
if($ezlink.length == 0 ) {
	jQuery('.ezbutton_stacks_in_42_page21 > span').wrapAll('<a href="#"></a>');
	$middle.html('Add link...');
	} else {
	$middle.html($ezlink.html());
	jQuery('.ezbutton_stacks_in_42_page21 > span').wrapAll($ezlink.html(''));
	$ezlink.remove();
}
switch ('center'){
case 'left':
jQuery('.ezbutton_stacks_in_42_page21').css('margin-left','0');
break;
case 'right':
jQuery('.ezbutton_stacks_in_42_page21').css('margin-right','0');
break;
default :
jQuery('.ezbutton_stacks_in_42_page21').css('margin','0 auto');
}
var $shift = ('square' == 'square')?22:0;
var $left = -$shift;
var $right = -$shift - 10;
var $bg_top = - (1 -1)*76;
var $hov_top = - (5 -1)*76;
var $bg_topm = $bg_top - 38;
var $hov_topm = $hov_top - 38;
jQuery('.ezbutton_stacks_in_42_page21 a > span').addClass('ezbg');
$middle.css({'width':210 - 20 + 'px','background-position': '0px ' + $bg_topm + 'px'});
$leftside.css({'background-position': $left + 'px ' + $bg_top + 'px'});
$rightside.css({'background-position': $right + 'px ' + $bg_top + 'px'});
jQuery('.ezbutton_stacks_in_42_page21').fadeIn(1*200);
jQuery('.ezbutton_stacks_in_42_page21').hover(function(){
jQuery('.ezbutton_stacks_in_42_page21 a > span').removeClass('ezbg').addClass('ezhover');
$middle.css({'background-position': '0px ' + $hov_topm + 'px'});
$leftside.css({'background-position': $left + 'px ' + $hov_top + 'px'});
$rightside.css({'background-position': $right + 'px ' + $hov_top + 'px'});
},function(){
jQuery('.ezbutton_stacks_in_42_page21 a > span').removeClass('ezhover').addClass('ezbg');
$middle.css({'background-position': '0px ' + $bg_topm + 'px'});
$leftside.css({'background-position': $left + 'px '+ $bg_top + 'px'});
$rightside.css({'background-position': $right + 'px '+ $bg_top + 'px'});
});
});
/* End of Flex EZ Button Stack */
	return stack;
})(stacks.stacks_in_42_page21);



