function createMenu(root){
	$(".menu li a").each(function(){
		
		if($(this).hasClass('selected')){
			$(this).css({
				background: 'url('+ root +'/public/menu.php?selected&txt=' + escape($(this).find('span').text()) + ') no-repeat left top',
				height: 100
			});
			$(this).append('<img src="'+ root +'/public/blank.php?selected&txt=' + escape($(this).find('span').text()) + '">');
		} else {
			$(this).css({
				background: 'url('+ root +'/public/menu.php?txt=' + escape($(this).find('span').text()) + ') no-repeat left top',
				height: 100
			});
			$(this).append('<img src="'+ root +'/public/blank.php?txt=' + escape($(this).find('span').text()) + '">');
		}
	});
	$('h2').each(function(){
		
		if($(this).hasClass('selected')){
			$(this).css({
				backgroundColor: '#FFFFFF',
				backgroundImage: 'url('+ root +'/public/menu.php?txt=' + escape($(this).find('span').text()) + '&active&main)',
				backgroundRepeat: 'no-repeat',
				backgroundPosition: 'left top'
			});
		} else {
			$(this).css({
				backgroundColor: '#FFFFFF',
				backgroundImage: 'url('+ root +'/public/menu.php?txt=' + escape($(this).find('span').text()) + '&main)',
				backgroundRepeat: 'no-repeat',
				backgroundPosition: 'left top'
			});
		}
	});
}

function isiPad(){
    return (navigator.platform.indexOf("iPad") != -1);
}

if(isiPad()){
	var myScroll;
	function loaded() {
		myScroll = new iScroll('maincontent');
	}
	document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
	document.addEventListener('DOMContentLoaded', loaded, false);
}
