function format(data){
			var n = data.value
			
			// string&split
			n = new String(n)
			var p = n.split('.')
			
			// thousand
			if (data.thousand!==false){
				var l = p[0].length;
				var nn = '';
				for (var i=0; i<l; i++){
					var a = p[0].substring(l-1-i,l-i);
					if (i!=0 && i%3==0){ nn = data.thousand+nn; }
					nn = a + nn;
				}
				p[0]=nn
			}
			
			if (p[1]!=undefined){
				n = (data.fraction!==false)? p[0]+data.fraction+p[1] : p[0]+'.'+p[1]
			} else { n = p[0] }
			
			if(data.unit.position!==false){
				if (data.unit.position=='before'){ n = data.unit.format+n }
				if (data.unit.position=='after'){ n = n+data.unit.format }
			}
			return n
		}
jQuery(function($) {
	/* menu */
	$('ul.menu li').each(function(){
		var a = $(this).children('a')
		var txt = a.text()
		var s = $('<span class="first">'+txt+'</span><span class="second">'+txt+'</span>')
		a.css({'padding':0,'height':29,'width':185}).html(s)
		a.hover(function(){ $('span.first',this).animate({'margin-top':'-29px'},{duration: 200, queue: false}) },
			function(){ $('span.first',this).animate({'margin-top':'0px'},{duration: 600, queue: false}) })
	})
	
	$('form.validate').validate({errorMsgShow:false,alertTarget:'#errormsg',hideType:'button'})
	$('pre.code').each(function(){
		var c = $(this).html()
		$(this).text( c )
	})
	
	$('.otliam').each(function(){
		//$(this).css({'unicode-bidi': 'bidi-override', 'direction': 'rtl'})
		var val = $(this).text()
		var a = $('<a>')
		$(this).html(a.attr('href','mailto:'+val.split('').reverse().join('')).text(val.split('').reverse().join('')))
	})
	
	$('#gallery1').cycle()
	
	$('table#arak tr:even').addClass('even')
});