jQuery(function(){
	if (jQuery.cookie('style1') != null) {
		var size = jQuery.cookie('style1');
		var cssurl = jQuery("#jstyle1").attr('href');	//ex) abc.css or abc_s.css
		var newcssurl = jstyle_makecssname(cssurl,size);
		jQuery("#jstyle1").attr({href:newcssurl});
		mojisize(size);
	}
});
function jstyle1(cssurl,size) {
	var newcssurl = jstyle_makecssname(cssurl,size);
	jQuery('#jstyle1').attr({href:newcssurl});
	jQuery.cookie('style1',size,{expires:60,path:'/'});
	mojisize(size);
}
function jstyle_makecssname(cssurl,size) {
	var cssurl2 = cssurl.substr(0, cssurl.lastIndexOf('.'));	//ex) abc or abc_s
	var last2ch = '';
	if (cssurl2.length >= 2) {
		last2ch = cssurl2.substr(cssurl2.length - 2,2);	//ex) _s
	}
	if (last2ch == '_s' || last2ch == '_m' || last2ch == '_l') {
		cssurl2 = cssurl2.substr(0,cssurl2.length - 2);	//2•¶Žšˆø‚­	//ex) abc
	}
	var newcssurl = cssurl2.substr(0, cssurl.lastIndexOf('.')) + '_' + size + '.css';
	return newcssurl;
}
function mojisize(size) {
	if (size == 's') {
		jQuery('.mojisizes').attr('style','color:red');
		jQuery('.mojisizem').attr('style','color:white');
		jQuery('.mojisizel').attr('style','color:white');
	} else if (size == 'm') {
		jQuery('.mojisizes').attr('style','color:white');
		jQuery('.mojisizem').attr('style','color:red');
		jQuery('.mojisizel').attr('style','color:white');
	} else if (size == 'l') {
		jQuery('.mojisizes').attr('style','color:white');
		jQuery('.mojisizem').attr('style','color:white');
		jQuery('.mojisizel').attr('style','color:red');
	}
}

