var fileDialog;
var browser;
if (navigator.userAgent.indexOf("MSIE") >= 0) browser = "IE";

/*
 * @param  string  image  img
 */
function getActualDimension(image) {
	var run, mem, w, h, key = "actual";
	if ("naturalWidth" in image) {
		return {width: image.naturalWidth, height: image.naturalHeight};
	}
	if ("src" in image) {
		if (image[key] && image[key].src === image.src) {return  image[key];}
		if (document.uniqueID) {
			w = $(image).css("width");
			h = $(image).css("height");
		} else {
			mem = {w: image.width, h: image.height};
			$(this).removeAttr("width").removeAttr("height").css({width:"",  height:""});
			w = image.width;
			h = image.height;
			image.width  = mem.w;
			image.height = mem.h;
		}
		return image[key] = {width: w, height: h, src: image.src};
	}
	return {width: image.width, height: image.height};
}
function get_browser() {
	var browser = "";
	if(!jQuery.support.checkOn && jQuery.support.checkClone) {
		browser = "chrome,safari";
	} else if (jQuery.support.checkOn && jQuery.support.htmlSerialize && window.globalStorage) {
		browser = "firefox";
	} else if (jQuery.support.checkOn && jQuery.support.htmlSerialize && !window.globalStorage) {
		browser = "opera";
	} else if (!jQuery.support.htmlSerialize && jQuery.support.scriptEval) {
		browser = "IE9";
	} else if (!jQuery.support.opacity) {
		if (!jQuery.support.style) {
			if (typeof document.documentElement.style.maxHeight != "undefined") {
				browser = "IE7";
			} else {
				browser = "IE6";
			}
		} else {
			browser = "IE8";
		}
	}
	return (browser);
}

function tinymce_initialize(elm, w, h, style) {
	$().ready(function() {
		$('textarea'+elm).tinymce({
			script_url : '/jquery/tiny_mce/tiny_mce.js',
			theme : "advanced",
			width: w,
			height : h,
			language: "ja",
			plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,advlist",
			theme_advanced_buttons1 : "newdocument,|,cut,copy,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
			theme_advanced_buttons2 : "paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
			theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
			theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,inlinepopups",
			theme_advanced_toolbar_location : "top",
			theme_advanced_toolbar_align : "left",
			theme_advanced_statusbar_location : "bottom",
			theme_advanced_resizing : true,
			apply_source_formatting : true,
			convert_urls : false,
			content_css : style
		});
	});
}
function selectFile(param) {
	fileDialog = window.open('filedialog.php?'+param, 'fileDialog', 'width=920,height=600');
	fileDialog.focus();
}
function colorbox(em, title, html) {
	$(function(){
		$(em).colorbox({
			transition  :'elastic',
			speed	   : 500,
			overlayClose:true,
			title	   : title,
			html		: html
		});
	});
}
function getcity(param, path) {
	var Ajax_zipObject = false;
	if (window.XMLHttpRequest) {
		Ajax_zipObject = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		try {
			Ajax_zipObject = new ActiveXObject("Msxml2.XMLHTTP");
		} catch(e) {
			Ajax_zipObject = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	var Parameter = param.split(",");
	if (!param) {
		Parameter[0] = 'mailform';
		Parameter[1] = 'zip';
		Parameter[2] = 'pre';
		Parameter[3] = 'city';
		Parameter[4] = 'town';
	}
	var url = '';
	var zip = document.getElementById(Parameter[1]).value;
	if (!zip) {
		alert('Please enter postal code.');
		document.getElementById(Parameter[1]).focus();
		return;
	}
	url = path + '/trycms/php-bin/getcity.php?zip='+zip;
	var myDate = new Date;
	url += '&t='+myDate.getTime();
	if (!Ajax_zipObject) return;
	Ajax_zipObject.open('GET', url);
	Ajax_zipObject.send(null);
	Ajax_zipObject.onreadystatechange=function() {
		if (Ajax_zipObject.readyState==4
			&& Ajax_zipObject.status==200) {
			var Address = Ajax_zipObject.responseText.split(",");
			with(document) {
				getElementById(Parameter[1]).value=Address[0];
				getElementById(Parameter[2]).value=Address[1];
				getElementById(Parameter[3]).value=Address[2];
				getElementById(Parameter[4]).value=Address[3];
			}
		}
	}
}
function alertdialog(title, msg, icon, func) {
	if (!icon) icon = 'warning.png';
	document.getElementById('systemDialog').innerHTML=
	'<img src="/trycms/images/icon64/'+icon+'" style="float:left;margin-right:10px;">'+msg;
	$(function() {
		$('#systemDialog').dialog({
			title: title,
			resizable: false,
			width: 400,
			height:170,
			modal: true,
			show: 'blind',
			hide: 'explode',
			buttons: {
				Ok: function() {
					$(this).dialog('close');
					if (func) {
						func();
					}
				}
			}
		});
	});
}
function getAjaxText(url, obj, func, id, pw) {
	var AjaxObject = false;
	if (window.XMLHttpRequest) {
		AjaxObject = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		try {
			AjaxObject = new ActiveXObject("Msxml2.XMLHTTP");
		} catch(e) {
			AjaxObject = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	if (!AjaxObject) return;
	var myDate = new Date;
	if (!url.match(/\?/)) {
		url = url + '?';
	}
	url += '&t='+myDate.getTime();
	AjaxObject.open('GET', url, true, id, pw);
	AjaxObject.send(null);
	AjaxObject.onreadystatechange=function() {
		if (AjaxObject.readyState==4
			&& AjaxObject.status==200) {
			document.getElementById(obj).innerHTML = AjaxObject.responseText;
			if (func) {
				func();
			}
		}
	}
}
function GetWindowSize(){
	var wid = -1;
	var hei = -1;
	if(document.all){
		wid = $(window).width();
		hei = $(window).height();
	} else {
		wid = window.innerWidth;
		hei = window.innerHeight;
	}
	return[wid, hei];
}
function centering(obj, option) {
	var w = $(window).width();
	var h = $(window).height();
	if (option.match(/w/i)) {
		document.getElementById(obj).style.left = (w - $('#'+obj).width()) / 2 + 'px';
	}
	if (option.match(/h/i)) {
		document.getElementById(obj).style.top = (h - $('#'+obj).height()) / 2 + 'px';
	}
}
function openPrintwin(flag) {
	if (!printWindow || printWindow.closed) {
		if (flag) {
			printWindow=window.open('','printWindow','left=0,top=0,width=760,height=600,scrollbars=1,resizable=1');
		}
	} else {
		if (!flag) printWindow.close();
	}
}
function printwin(p) {
	var objid=document.getElementById('printdoc');
	var titleid=document.getElementById('printtitle');
	var DOC=objid.innerHTML;
	var DocTitle=titleid.innerHTML;
	if (!printWindow || printWindow.closed) {
		if (p) {
			printWindow=window.open('','printWindow','width=980,height=600,left=0,top=0,scrollbars=yes');
		} else {
			printWindow=window.open('','printWindow','width=720,height=600,left=0,top=0,scrollbars=yes');
		}
	}
	printWindow.document.open();
	printWindow.document.write("<html><head>\n");
	printWindow.document.write("<title>"+DocTitle+"</title>\n");
	printWindow.document.write("<link rel='stylesheet' href='/products/print.css' type='text/css'>\n");
	printWindow.document.write("</head><body>\n");
	printWindow.document.write(DOC);
	printWindow.document.write('\n</body></html>');
	printWindow.document.close();
	printWindow.print();
}
function getCookie(name) {
	var dc = document.cookie;
	var prefix = name + "=";
	var begin = dc.indexOf("; " + prefix);
	if (begin == -1) {
		begin = dc.indexOf(prefix);
		if (begin != 0) return null;
	} else {
		begin += 2;
		var end = document.cookie.indexOf(";", begin);
		if (end == -1) end = dc.length;
	}
	return unescape(dc.substring(begin + prefix.length, end));
}
function setCookie(name, value, expires, path, domain, secure) {
	/* expires = time
	var limit = new Date();
	limit.setTime(limit.getTime() + (1000 * 60 * 60 * expires));
	var curCookie = name + "=" + escape(value) +
		((expires) ? "; expires=" + limit.toGMTString() : "") +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		((secure) ? "; secure" : "");
	document.cookie = curCookie;
	*/
}

(function($){
	$.fn.myAccordion = function(option){
		// Param plugin
		var param = jQuery.extend({
			speed: "fast", // @param : low, medium, fast
			defautContent: 0 // @param : number
		}, option);
		$(this).each(function() {
			// var
			var $this = this;
			var $thisId = this.id;
			// Attribut un id a chaque declencheur
			$("#"+$thisId+" .myAccordion-declencheur").attr("id", function(arr){
				return $thisId+"-elem"+arr;
			})
			// Masque tous les content
			$("#"+$thisId+" .myAccordion-declencheur").next(".myAccordion-content").hide();
			// Ouvre le content par defaut
			$("#"+$thisId+" #myAccordion-elem"+option.defautContent).next(".myAccordion-content").show();
			$("#"+$thisId+" #myAccordion-elem"+option.defautContent).addClass("myAccordion-declencheur-actif");
			$("#"+$thisId+" #myAccordion-elem"+option.defautContent).next(".myAccordion-content").addClass("myAccordion-content-actif");
			// Action sur declencheur
			$("#"+$thisId+" .myAccordion-declencheur").click(function(){
				$("#"+$thisId+" .myAccordion-content-actif").hide(option.speed);
				$("#"+$thisId+" .myAccordion-content-actif").removeClass("myAccordion-content-actif");
				$("#"+$thisId+" .myAccordion-declencheur-actif").removeClass("myAccordion-declencheur-actif");
				var contentCourant = $(this).attr("id");
				$("#"+$thisId+" #"+contentCourant).next(".myAccordion-content").show(option.speed);
				$("#"+$thisId+" #"+contentCourant).addClass("myAccordion-declencheur-actif");
				$("#"+$thisId+" #"+contentCourant).next(".myAccordion-content").addClass("myAccordion-content-actif");
			});
		});
	}
})(jQuery);

if (browser) {
	(function($){$.fn.lavaLamp=function(o){o=$.extend({fx:"linear",speed:500,click:function(){}},o||{});return this.each(function(){var b=$(this),noop=function(){},$back=$('<li class="back"><div class="left"></div></li>').appendTo(b),$li=$("li",this),curr=$("li.current",this)[0]||$($li[0]).addClass("current")[0];$li.not(".back").hover(function(){move(this)},noop);$(this).hover(noop,function(){move(curr)});$li.click(function(e){setCurr(this);return o.click.apply(this,[e,this])});setCurr(curr);function setCurr(a){$back.css({"left":a.offsetLeft+"px","width":a.offsetWidth+"px"});curr=a};function move(a){$back.each(function(){$(this).dequeue()}).animate({width:a.offsetWidth,left:a.offsetLeft},o.speed,o.fx)}})}})(jQuery);
} else {
	(function($) {
	$.fn.lavaLamp = function(o) {
		o = $.extend({ fx: "linear", speed: 500, click: function(){} }, o || {});

		return this.each(function(index) {

			var me = $(this), noop = function(){},
				$back = $('<li class="back"><div class="left"></div></li>').appendTo(me),
				$li = $(">li", this), curr = $("li.current", this)[0] || $($li[0]).addClass("current")[0];

			$li.not(".back").hover(function() {
				move(this);
			}, noop);

			$(this).hover(noop, function() {
				move(curr);
			});

			$li.click(function(e) {
				setCurr(this);
				return o.click.apply(this, [e, this]);
			});

			setCurr(curr);

			function setCurr(el) {
				$back.css({ "left": el.offsetLeft+"px", "width": el.offsetWidth+"px" });
				curr = el;
			};

			function move(el) {
				$back.each(function() {
					$.dequeue(this, "fx"); }
				).animate({
					width: el.offsetWidth,
					left: el.offsetLeft
				}, o.speed, o.fx);
			};

			if (index == 0){
				$(window).resize(function(){
					$back.css({
						width: curr.offsetWidth,
						left: curr.offsetLeft
					});
				});
			}

		});
	};
})(jQuery);
}

/** jquery.color.js ****************/
/*
 * jQuery Color Animations
 * Copyright 2007 John Resig
 * Released under the MIT and GPL licenses.
 */

(function(jQuery){

	// We override the animation for all of these color styles
	jQuery.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){
		jQuery.fx.step[attr] = function(fx){
			if ( fx.state == 0 ) {
				fx.start = getColor( fx.elem, attr );
				fx.end = getRGB( fx.end );
			}
			if ( fx.start )
				fx.elem.style[attr] = "rgb(" + [
					Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0),
					Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0),
					Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0)
				].join(",") + ")";
		}
	});

	// Color Conversion functions from highlightFade
	// By Blair Mitchelmore
	// http://jquery.offput.ca/highlightFade/

	// Parse strings looking for color tuples [255,255,255]
	function getRGB(color) {
		var result;

		// Check if we're already dealing with an array of colors
		if ( color && color.constructor == Array && color.length == 3 )
			return color;

		// Look for rgb(num,num,num)
		if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
			return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])];

		// Look for rgb(num%,num%,num%)
		if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
			return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];

		// Look for #a0b1c2
		if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
			return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];

		// Look for #fff
		if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
			return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];

		// Otherwise, we're most likely dealing with a named color
		return colors[jQuery.trim(color).toLowerCase()];
	}

	function getColor(elem, attr) {
		var color;

		do {
			color = jQuery.curCSS(elem, attr);

			// Keep going until we find an element that has color, or we hit the body
			if ( color != '' && color != 'transparent' || jQuery.nodeName(elem, "body") )
				break;

			attr = "backgroundColor";
		} while ( elem = elem.parentNode );

		return getRGB(color);
	};

	// Some named colors to work with
	// From Interface by Stefan Petre
	// http://interface.eyecon.ro/

	var colors = {
		aqua:[0,255,255],
		azure:[240,255,255],
		beige:[245,245,220],
		black:[0,0,0],
		blue:[0,0,255],
		brown:[165,42,42],
		cyan:[0,255,255],
		darkblue:[0,0,139],
		darkcyan:[0,139,139],
		darkgrey:[169,169,169],
		darkgreen:[0,100,0],
		darkkhaki:[189,183,107],
		darkmagenta:[139,0,139],
		darkolivegreen:[85,107,47],
		darkorange:[255,140,0],
		darkorchid:[153,50,204],
		darkred:[139,0,0],
		darksalmon:[233,150,122],
		darkviolet:[148,0,211],
		fuchsia:[255,0,255],
		gold:[255,215,0],
		green:[0,128,0],
		indigo:[75,0,130],
		khaki:[240,230,140],
		lightblue:[173,216,230],
		lightcyan:[224,255,255],
		lightgreen:[144,238,144],
		lightgrey:[211,211,211],
		lightpink:[255,182,193],
		lightyellow:[255,255,224],
		lime:[0,255,0],
		magenta:[255,0,255],
		maroon:[128,0,0],
		navy:[0,0,128],
		olive:[128,128,0],
		orange:[255,165,0],
		pink:[255,192,203],
		purple:[128,0,128],
		violet:[128,0,128],
		red:[255,0,0],
		silver:[192,192,192],
		white:[255,255,255],
		yellow:[255,255,0]
	};

})(jQuery);
function easing() {
	/** jquery.easing.js ****************/
	/*
	 * jQuery Easing v1.1 - http://gsgd.co.uk/sandbox/jquery.easing.php
	 *
	 * Uses the built in easing capabilities added in jQuery 1.1
	 * to offer multiple easing options
	 *
	 * Copyright (c) 2007 George Smith
	 * Licensed under the MIT License:
	 *   http://www.opensource.org/licenses/mit-license.php
	 */
	jQuery.easing={easein:function(x,t,b,c,d){return c*(t/=d)*t+b},easeinout:function(x,t,b,c,d){if(t<d/2)return 2*c*t*t/(d*d)+b;var a=t-d/2;return-2*c*a*a/(d*d)+2*c*a/d+c/2+b},easeout:function(x,t,b,c,d){return-c*t*t/(d*d)+2*c*t/d+b},expoin:function(x,t,b,c,d){var a=1;if(c<0){a*=-1;c*=-1}return a*(Math.exp(Math.log(c)/d*t))+b},expoout:function(x,t,b,c,d){var a=1;if(c<0){a*=-1;c*=-1}return a*(-Math.exp(-Math.log(c)/d*(t-d))+c+1)+b},expoinout:function(x,t,b,c,d){var a=1;if(c<0){a*=-1;c*=-1}if(t<d/2)return a*(Math.exp(Math.log(c/2)/(d/2)*t))+b;return a*(-Math.exp(-2*Math.log(c/2)/d*(t-d))+c+1)+b},bouncein:function(x,t,b,c,d){return c-jQuery.easing['bounceout'](x,d-t,0,c,d)+b},bounceout:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b}},bounceinout:function(x,t,b,c,d){if(t<d/2)return jQuery.easing['bouncein'](x,t*2,0,c,d)*.5+b;return jQuery.easing['bounceout'](x,t*2-d,0,c,d)*.5+c*.5+b},elasin:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b},elasout:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b},elasinout:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b},backin:function(x,t,b,c,d){var s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b},backout:function(x,t,b,c,d){var s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},backinout:function(x,t,b,c,d){var s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b},linear:function(x,t,b,c,d){return c*t/d+b}};
}
function translation() {
	var transword=$('#transword').val();
	var from=$('#from_lang').text();
	var to;
	if (from.indexOf('ja') >=0) {
		from='ja';
		to='en';
	} else {
		from='en';
		to='ja';
	}
	google.language.translate(transword, from, to, function(result){
		document.getElementById("trans").innerHTML = result.translation;
	});
}
function changelang() {
	var str=$('#from_lang').text();
	$('#from_lang').text( $('#to_lang').text() );
	$('#to_lang').text(str);
}
var timelag = 0;
function set_timezone(timezone, area) {
	timelag = timezone;
	$('#clock_area').text(area);
	analog_clock();
}
function analog_clock() {
	today = new Date();
	var h = today.getHours() + timelag;
	if (h < 0) h += 24;
	var m = today.getMinutes();
	var s = today.getSeconds();
	var ma = 'AM';
	if (h >= 12) ma = 'PM';
	$('#second_hand').rotate(s*6);
	$('#min_hand').rotate(m*6)+(s/10);
	$('#hour_hand').rotate(30*h+m/2);
	$('#clock_ma').text(ma);
	$('#clock_h').text(h);
	$('#clock_m').text(m);
	$('#clock_s').text(s);
	delete today;
	setTimeout("analog_clock()",1000);
}
$(document).ready(function(){ $('body').append('<div id="systemDialog"></div>'); });
window.sprintf || (function() {
	var _BITS = { i: 0x8011, d: 0x8011, u: 0x8021, o: 0x8161, x: 0x8261, X: 0x9261, f: 0x92, c: 0x2800, s: 0x84 },
	_PARSE = /%(?:(\d+)\$)?(#|0)?(\d+)?(?:\.(\d+))?(l)?([%iduoxXfcs])/g;
	window.sprintf = _sprintf;

	function _sprintf(format) {
		function _fmt(m, argidx, flag, width, prec, size, types) {
			if (types === "%") { return "%"; }
			var v = "", w = _BITS[types], overflow, pad;
			idx = argidx ? parseInt(argidx) : next++;
			w & 0x400 || (v = (av[idx] === void 0) ? "" : av[idx]);
			w & 3 && (v = (w & 1) ? parseInt(v) : parseFloat(v), v = isNaN(v) ? "": v);
			w & 4 && (v = ((types === "s" ? v : types) || "").toString());
			w & 0x20  && (v = (v >= 0) ? v : v % 0x100000000 + 0x100000000);
			w & 0x300 && (v = v.toString(w & 0x100 ? 8 : 16));
			w & 0x40  && (flag === "#") && (v = ((w & 0x100) ? "0" : "0x") + v);
			w & 0x80  && prec && (v = (w & 2) ? v.toFixed(prec) : v.slice(0, prec));
			w & 0x6000 && (overflow = (typeof v !== "number" || v < 0));
			w & 0x2000 && (v = overflow ? "" : String.fromCharCode(v));
			w & 0x8000 && (flag = (flag === "0") ? "" : flag);
			v = w & 0x1000 ? v.toString().toUpperCase() : v.toString();
			if (!(w & 0x800 || width === void 0 || v.length >= width)) {
				pad = Array(width - v.length + 1).join(!flag ? " " : flag === "#" ? " " : flag);
				v = ((w & 0x10 && flag === "0") && !v.indexOf("-"))
				? ("-" + pad + v.slice(1)) : (pad + v);
			}
			return v;
		}
		var next = 1, idx = 0, av = arguments;
		return format.replace(_PARSE, _fmt);
	}
})();
function layerShow(id) {
	var obj = document.getElementById(id);
	if (obj.style.display=='block') {
		obj.style.display='none';
	} else {
		obj.style.display='block';
	}
}

