text:
Stoner wins World Championship in all Honda podium
Repsol Honda's Casey Stoner has clinched the 2011 MotoGP World Championship title 2011 with a superb victory in the Australian Grand Prix, in front of 43,880 spectators who cheered him on his way to his ninth win of the season and the first World title for Honda in the 800cc era.
Andrea Dovizioso, third, returned to the podium for the first time since Brno, and Dani Pedrosa, fourth, just missed out after four podiums in a row. Honda occupied the top four spots today in Phillip Island with Stoner, Simoncelli, Dovizioso and Pedrosa.
With Jorge Lorenzo out of the race due to his injury sustained in warm up this morning, Stoner needed just 10 points to be crowned Champion, but he remained loyal to his style and secured his fifth consecutive win at Phillip Island within the first seven laps, after he managed to pull away and took an advantage of seven seconds from the rest of the field.
With the dominance of Stoner up front, the excitement moved to the group of Simoncelli, Dovizioso and Pedrosa in the fight for the podium and remained undetermined until the end when the rain came with four laps to the checkered flag . At that time, Andrea was three seconds ahead of Dani and caught Simoncelli, with whom he has fought for second place until the last lap.
Today Honda also claimed their 60th Constructor's World Title and with the Rider's Title in Stoners' hands, Andrea Dovizioso and Dani Pedrosa maintain their fight for third place in the Championship. The Italian remains third, now four points ahead of Dani who is in fourth place.
Casey Stoner:
"I don't think anyone could plan things to happen better than they have today! The race was incredibly difficult, the conditions we're very tough. I built up an early lead as I saw the rain coming in, but I wasn't sure if it would hit us. I basically ran into a wall of rain, there wasn't any warning at the back part of the circuit and I came into the last turn and the rain started hard. I nearly lost control and thought for sure I was going to end up in the gravel. I managed to control it and maintain the gap to everyone and thankfully bring it home for the win, but it was a little bit nerve-racking for sure. I'm really sorry that Jorge had the accident this morning, he's great competitor and I think if he'd been here racing today things might not have turned out the way they have, I hope his operation goes well and he's back racing as soon as he feels fit. I can't thank everyone enough, my team, Repsol, all our sponsors, everyone that has worked so hard all year, thank you!"
Andrea Dovizioso:
"It was a difficult race as we expected, this track is very tricky, as are the weather conditions. To return on the podium and arrive in front of Dani here at Phillip Island is a very good result for us and it was our target before getting here. I think we could have even finished in second position but when Dani overtook me in the middle of the race we lost contact with Simoncelli, then I retook the position when the rain came, but on the final lap I didn't have enough grip to push hard in the last few corners. Anyway we are still fighting for the third place in the Championship and I'm sure Dani will be strong in the last two races, but we will try to do our best until the end. Casey has had an amazing season, he is the fastest rider at the moment, so congratulations to him for the title."
Dani Pedrosa:
"It's been very tough today, I didn't feel comfortable throughout the weekend and the race didn't start in the best way either. I had a problem with the wind at the start, I almost lost balance and I had to put the left foot on the floor at the same time as the red light went out, so I had a bad start. The first few laps were not so good, then I recovered slightly, I overtook Andrea and fought with him but the front tyre was finished in the last laps. When I tried to pull away I was loosing the front, so I couldn't keep him behind and then the rain arrived. It's not been a good weekend for me, I want to say congratulations to Casey for his title, he's been the strongest this season, always on the podium, with no mistakes, so he deserves it."
Shuhei Nakamoto – HRC Executive Vice President:
"The feeling is of course very happy, today I can relax little bit, because almost every night I wake up thinking about something, doing some memo to remember to check or do something... this is my first feeling after the race! I want to say to all Honda fans and sponsors, thank you very much for your support and especially to all Honda people and in particular to everyone at HRC and in Honda R&D centre. Then I'd like to thank the Repsol Honda Team crew, all of them! A big thanks to all our Honda riders that push each other during this season and achieved great results. Then of course I want to thank Casey Stoner. He did a great job since the first day he rode the RC212V and he brings great enthusiasm to everybody in HRC. Tonight we will celebrate, but starting from tomorrow morning we will start working again to finish this season at top, win the Team Championship and to prepare th e 2012 new challenge with the 1000cc."
Repsol Honda press release.
MotoGP, 2011, IVECO AUSTRALIAN GRAND PRIX, Dani Pedrosa, Andrea Dovizioso, Casey Stoner, Repsol Honda Team
Lorenzo's surgery a success
MotoGP, Jorge Lorenzo
Phillip Island tyre performance analysis
Cudlin denied race start in Australia after practice crash
A Champion in profile: Casey Stoner
MotoGP, Casey Stoner
Stoner clinches the 2011 title on home turf
De Angelis victorious at Phillip Island
Moto2, Alex de Angelis
Cortese takes a red flagged Australian GP
125cc, Sandro Cortese
Lorenzo and Spies ruled out of Australian Grand Prix
Stoner on top again in Phillip Island warm up
Márquez tops Phillip Island warm up
Cortese heads up 125 morning run
Fourth row for both Pramac riders in Australia
MotoGP, Loris Capirossi, Randy de Puniet
Second row for Hayden at Phillip Island, Rossi 13th
MotoGP, Valentino Rossi, Nicky Hayden


Our team of technology professionals deliver advanced technology and innovative solutions for Municipal Lien Search companies. We are committed to providing your business with the exceptional Customer Service and Software Support. From installation to deployment we will work with you to ensure a smooth transition.
Our software engineers and project managers have years of experience and routinely deal with complex technological situations.
Please submit your service request below. Our system will show you a confirmation number.


Home > Funtasia Too Clothes > Funtasia Too Spring/Summer Clothes > Boys Infant Clothes > Funtasia Too Butch the Bunny Reversible Shortall with applique. Reverses to a Boat appliqued. Snaps in the inseam. Shirt not included.


Spemann, H. & Mangold, H. Arch. mikrosk. Anat. EntwMech. 100, 599 (1924).
Slack, J.M.W. & Forman, D. J. Embryol. exp. Morph. 56, 283 (1980).
Cooke, J. Am. Zool. 22, 91 (1982).
Jacobson, M. 'Origins of the Nervous System in Amphibians' in Neuronal Development (ed. Spitzer) (Plenum, New York, 1982).
Lawrence, P.A. & Morata, G. 'The compartment hypothesis' in Insect Development (ed. Lawrence) (Blackwell Scientific, Oxford, 1976).
Nieuwkoop, P.D. & Sutasurya, L.A. J. Embryol. exp. Morph. 35, 159 (1976).
Smith, J.C. & Malacinski, G.M. Devl Biol. (in the press).
Wolpert, L. J. theor. Biol. 25, 1 (1969).
Slack, J. Nature 278, 600 (1979).


Hannah it was good to see you in Bournemouth - if only very briefly!
Hannah, nice reflection of a very enjoyable conference. The spirit of this years Bournemouth event was very optimistic, something that we have not been able to say about a whole conference for some time.
It was great to see you there and wonderful that you were able to be part of the Community centre project.


Since upgrading ArcGIS Enterprise to 10.6.1 we are not able to sign in to Collector on iOS. We use a VPN to connect to our network and use Portal level authentication. It looks like Collector tries to log in through an in-app Safari browser and our organization doesn't allow access to any sites using Safari and VPN. This is really puzzling to me because 1) we can connect through ArcGIS Explorer, Collector Classic and Survey123 and 2) we can connect to Collector through ArcGIS Enterprise 10.5.1.
Has anyone else experienced this issue? Does anyone have any ideas on how to fix this? Esri does not provide support for VPN configurations.
Is there any way you can see if you can rule out the VPN by accessing the 10.6.1 Enterprise setup through and internal WiFi Connection? If you have the same issue in the internal network, then it would be easier to debug the web traffic via a program like fiddler and you can compare the web traffic to Collector signing on to ArcGIS Enterprise 10.5.1.


text:
/**
 * NEMO APP by Tua Hoang Nguyen
 * @author hoangtua.vn@gmail.com
 * @skype hoangtua
 * @phone 0939.96.75.96
 * @company Cherry Vietnam
 */

var previousPage = ''

var deviceReadyDeferred = $.Deferred();
var jqmReadyDeferred = $.Deferred();

$(document).on("deviceready", function() {
	console.log('Ready 1')
	deviceReadyDeferred.resolve();
});

$(document).ready(function () {
	console.log('Ready 2')
	jqmReadyDeferred.resolve();
});

$.when(jqmReadyDeferred, deviceReadyDeferred).then(init);

function init() {
	overrideFuncs()
	FastClick.attach(document.body)
	gotoPage('login')
	if (typeof localStorage.user != 'undefined') {
		USER = JSON.parse(localStorage.user)
		updateFeature()
		gotoPage('home')
		$('div.username').text(USER.name)
	}
	$('.multiPrev').click(function(){
		if(previousPage=='clientdata'){
			renderPageClientData()
			gotoPage('clientdata')
		} else {
			gotoPage('home')
		}
	})
	initOnlineData()
	initLocalData()
	updateStatus()

	// page LOGIN
	$('#btnLogin').click(function(){
		doLogin()
		return false
	})
	$("#btnLogout").click(function(){
		doLogout()
		console.log('Logout now')
		return false
	})
	$('#uploadData').click(function(){
		checkAuthentication(syncUp)
	})
	$('#downloadData').click(function(){
		syncDown()
	})

	// page SETTING
	$('#btnSetting').click(function(){
		renderPageSetting()
		gotoPage('setting')
		return false
	})
	$('#submitFormSetting').click(function(){
		saveSetting()
		return false
	})

	//page home
	$('#btnAddUser').click(function(){
		gotoPage('customer')
		renderPageCustomer()
	})
	$('#btnInventory').click(function(){
		gotoPage('inventory')
		renderPageInventory()
	})
	$('#btnSellout').click(function(){
		gotoPage('sellout')
		renderPageSellout()
	})
	$('#btnClientData').click(function(){
		renderPageClientData()
		gotoPage('clientdata')
	})

	//Page add customer
	$('select[name="provinceid"]').change(function(){
		var selected = PROVINCES.filter(function(item){return item.prov == this}, $(this).val());
		selected.sortOn('dist')
		renderOptions('select[name="districtid"]', selected, 'dist', 'dist', '<option value="">Chọn quận huyện</option>');
	});
	$('#resetFormUser').click(function(){
		resetForm('#addUser')
		return false
	})
	$('#submitFormUser').click(function(){
		if (createCustomer()) {
			updateStatus()
			var clientid = formGet('input','clientid')
			if (clientid != '') {
				renderPageClientData()
				gotoPage('clientdata')
			} else {
				resetForm('#addUser', false)
			}
		}
		return false
	})

	$('#deleteUser').click(function(){
		window.confirm('Bạn chắc chắn muốn xóa bản ghi này?', function(buttonIndex){
			if (buttonIndex == 2)
				return
			var id = formGet('input', 'clientid')
			var result = CUSTOMERS.removeAt('clientid', id)
			if (result) {
				localStorage.customers = JSON.stringify(CUSTOMERS)
				resetForm('#addUser', false)
				renderPageClientData()
				gotoPage('clientdata')
			} else {
				showError('Không thể xóa dữ liệu này')
			}
		})
		return false
	})

	//page inventory
	$('#resetFormInventory').click(function(){
		resetForm('#addInventory')
		return false
	})
	$('#submitFormInventory').click(function(){
		if (createReportInventory()) {
			var clientid = formGet('input','clientid', '#addInventory')
			resetForm('#addInventory', false)
			if (clientid) {
				renderPageClientData()
				gotoPage('clientdata')
			}
		}
		return false
	})
	$('#deleteInventory').click(function(){
		window.confirm('Bạn chắc chắn muốn xóa bản ghi này?', function(buttonIndex) {
			if (buttonIndex == 2)
				return
			var id = formGet('input', 'clientid','#addInventory')
			var result = INVENTORY.removeAt('clientid', id)
			if (result) {
				localStorage.inventory = JSON.stringify(INVENTORY)
				resetForm('#addInventory', false)
				renderPageClientData()
				gotoPage('clientdata')
			} else {
				showError('Không thể xóa dữ liệu này')
			}
		})
		return false
	})
	$('#addInventory select[name="outletid"], select[name="inv_date"]').change(function(){
		var day = formGet('select', 'inv_date', '#addInventory')
		var outlet = formGet('select', 'outletid', '#addInventory')
		if (checkDuplicate(day, outlet, INVENTORY)) {
			showError('Thống kê này đã có sẵn')
		}
	})
	// page sellout
	$('#resetFormSellout').click(function(){
		resetForm('#addSellout')
		return false
	})
	$('#submitFormSellout').click(function(){
		if (createReportSellout()) {
			var clientid = formGet('input', 'clientid','#addSellout')
			resetForm('#addSellout', false)
			if (clientid) {
				renderPageClientData()
				gotoPage('clientdata')
			}
		}
		return false
	})
	$('#deleteSellout').click(function(){
		window.confirm('Bạn chắc chắn muốn xóa bản ghi này?', function(buttonIndex) {
			if (buttonIndex == 2)
				return
			var id = formGet('input', 'clientid','#addSellout')
			var result = SELLOUT.removeAt('clientid', id)
			if (result) {
				localStorage.sellout = JSON.stringify(SELLOUT)
				resetForm('#addSellout', false)
				renderPageClientData()
				gotoPage('clientdata')
			} else {
				showError('Không thể xóa dữ liệu này')
			}
		})
		return false
	})
	$('#addSellout select[name="outletid"], select[name="selloutD"], select[name="selloutM"], select[name="selloutY"]').change(function(){
		var day = getDate('#addSellout','sellout')
		var outlet = formGet('select', 'outletid', '#addSellout')
		if (checkDuplicate(day, outlet, SELLOUT)) {
			showError('Thống kê này đã có sẵn')
		}
	})

	// Page clientdata
	$(".page.clientdata h3").click(function(){
		var icon = $(this).find("i.fa")
		if (icon.hasClass('fa-rotate-180')) {
			icon.removeClass('fa-rotate-180')
		} else {
			icon.addClass('fa-rotate-180')
		}
		$(this).next().toggle()
	})
	$.ajaxSetup({
		method: 			'POST',
		processData: 	false,
		contentType: 	'application/json',
		crossDomain: 	true,
		dataType: "json",
		timeout: 50000
	})
} // END INIT FUNCTION

function checkDuplicate(day, outletid, data) {
	var filter1 = data.items('cycledate',day)
	if (0 == filter1.length)
		return false
	var filterPersonalData = filter1.items('usersysid', USER.sysid)
	if (0 == filterPersonalData.length)
		return false
	var filter2 = filterPersonalData.item('outletid', outletid)
	if (null == filter2)
		return false
	return true
}

function showWait() {
	$('.page.activePage').append('

')
}
function hideWait() {
	$('.overlay .waiting').parent('.overlay').remove()
}

function updateStatus() {
	var text = "Số dữ liệu chưa tải lên hệ thống : "
	$('#statusText').text(text+ countData() )
}

function countData() {
	if (USER) {
		var countC = CUSTOMERS.items('usersysid', USER.sysid).length
		var countI = INVENTORY.items('usersysid', USER.sysid).length
		var countS = SELLOUT.items('usersysid', USER.sysid).length
		return countC + countI + countS
	}
	return 0
}

function doLogin() {
	console.log('Login now')
	var username = $('#username').val()
	var password = $('#password').val()
	var validateLogin = ''
	if ('' == $.trim(username) ) {
		validateLogin += '● Nhập mã người dùng
'
	}
	if ('' == $.trim(password) ) {
		validateLogin += '● Nhập mật khẩu
'
	}
	if ('' != validateLogin) {
		showError(validateLogin)
		return
	}
	showWait()
	$.ajax({
		url: DOMAIN+'/LoginValidationController',
		data: JSON.stringify({
			userid: username,
			password: password
		}),
		method: 'POST',
		processData: false,
		contentType: 'application/json',
		crossDomain:true,
		success: function(data, status, xhr) {
			if (data.responsecode == '001'){
				USER = data
				USER.userid = $('#username').val()
				USER.password = $('#password').val()
				localStorage.setItem('user', JSON.stringify(USER))
				syncDown()
				updateFeature()
				gotoPage('home')
				$('div.username').text(USER.name)
				$('.page.login .alert').hide()
			}
			else
				showError(ERROR_CODE[data.responsecode])
		},
		error: function(xhr, status, error) {
			console.log(status)
			showError("Không thể kết nối tới máy chủ")
			hideWait()
		},
		complete: function() {
			hideWait()
		}
	});
	return false;
}
function doLogout() {
	USER = null
	localStorage.removeItem('user')
	gotoPage('login')
	$('#username').val('')
	$('#password').val('')
}
function gotoPage(page) {
	previousPage = $('.page.activePage').attr("class").split(' ')[1]
	$('.page.activePage').hide();
	$('.page.activePage').removeClass('activePage');
	$('.page.'+page).fadeIn();
	$('.page.'+page).addClass('activePage')
	updateStatus()
}
function showError(text) {
	$('.activePage .alert').html(text)
	$('.activePage .alert').removeClass('hidden')
	$('.activePage .alert').show()
	$('html,body').scrollTop(0)
}
function hideError(page) {
	$('.page.'+page+' .alert').hide()
}
function renderOptions(ele, data, val, text, hint, defaultVal) {
	if (typeof defaultVal == 'undefined')
		defaultVal = ''
	var options = hint;
	for (var i = 0; i < data.length; i++) {
		var selected = defaultVal == data[i][val] ? 'selected' : ''
		options += '<option value="'+data[i][val]+'" '+selected+'>'+data[i][text]+'</option>'
	}
	$(ele).html(options);
}
function renderSingleOptions(ele, data, hint, defaultVal) {
	if (typeof defaultVal == 'undefined')
		defaultVal = ''
	var options = hint;
	for (var i = 0; i < data.length; i++) {
		var selected = defaultVal == data[i] ? 'selected' : ''
		options += '<option value="'+data[i]+'" '+selected+'>'+data[i]+'</option>';
	}
	$(ele).html(options);
}

function renderPageCustomer() {
	resetForm('#addUser', false)
	//render cua hang
	renderOptions('#addUser select[name="outletid"]', OUTLETS, 'id', 'name', '<option value="">Chọn cửa hàng</option>');

	//render tinh thanh pho
	var tmp = uniqBy(PROVINCES, function(item) {return item.prov})
	renderOptions('select[name="provinceid"]',tmp, 'prov', 'prov', '<option value="">Chọn tỉnh thành</option>' );

	//render quan huyen
	//handle 1 lần sự thay đổi tỉnh thì đổi quận trong document ready

	//render DOB
	renderSingleOptions('select[name="DOB_D"]',range(1,31),'<option value="">Ngày</option>')
	renderSingleOptions('select[name="DOB_M"]',range(1,12),'<option value="">Tháng</option>')
	renderSingleOptions('select[name="DOB_Y"]',range((new Date()).getFullYear() - 85, (new Date()).getFullYear() + 1).reverse(),'<option value="">Năm</option>')

	var comPowderMilk = COMPETITOR_PRODUCTS.filter(function(obj){return obj.type == 'P'})
	var comLiquidMilk = COMPETITOR_PRODUCTS.filter(function(obj){return obj.type == 'L'})
	var abbPowderMilk = ABBOTT_PRODUCTS.filter(function(obj){return obj.type == 'P'})
	var abbLiquidMilk = ABBOTT_PRODUCTS.filter(function(obj){return obj.type == 'L'})
	renderOptions('select[name="compowderproduct"]', comPowderMilk, 'id', 'name', '<option value="">Chọn sữa bột</option>');
	renderOptions('select[name="comliquidproduct"]', comLiquidMilk, 'id', 'name', '<option value="">Chọn sữa nước</option>');
	renderOptions('select[name="abbpowderproduct"]', abbPowderMilk, 'id', 'name', '<option value="">Chọn sữa bột</option>');
	renderOptions('select[name="abbliquidproduct"]', abbLiquidMilk, 'id', 'name', '<option value="">Chọn sữa nước</option>');

	$('#resetFormUser').show()
	$('#deleteUser').hide()
	$('.page.customer .nav-header').text('Thêm khách hàng')
	hideError('customer')
}
function renderPageInventory() {
	$('.page.inventory .alert').hide()
	renderOptions('#addInventory select[name="outletid"]', OUTLETS, 'id', 'name', '<option value="">Chọn cửa hàng</option>');
	renderOptions('select[name="inv_date"]',INV_DATE, 'cycledate','desc','<option value="">Ngày thống kê</option>')

	$('#addInventory select[name="outletid"]').removeAttr('disabled')
	$('#addInventory select[name="inv_date"]').removeAttr('disabled')

	//render data table
	renderTableData('#addInventory table tbody', NEMO_PRODUCTS.sort(compareNemo), 'id', 'name')

	resetForm('#addInventory', false)
	$('#resetFormInventory').show()
	$('#deleteInventory').hide()
	$('.page.inventory .nav-header').text('Thống kê tồn kho')
	hideError('inventory')
}

function renderPageSellout() {
	renderOptions('#addSellout select[name="outletid"]', OUTLETS, 'id', 'name', '<option value="">Chọn cửa hàng</option>');
	//render DOB
	renderSingleOptions('select[name="selloutD"]',range(1,31),'<option value="">Ngày</option>')
	renderSingleOptions('select[name="selloutM"]',range(1,12),'<option value="">Tháng</option>')
	renderSingleOptions('select[name="selloutY"]',range((new Date()).getFullYear() - 1, (new Date()).getFullYear() + 1).reverse(),'<option value="">Năm</option>')

	$('#addSellout select[name="outletid"]').removeAttr('disabled')
	$('select[name="selloutD"]').removeAttr('disabled')
	$('select[name="selloutM"]').removeAttr('disabled')
	$('select[name="selloutY"]').removeAttr('disabled')

	//render data table
	renderTableData('#addSellout table tbody', NEMO_PRODUCTS.sort(compareNemo), 'id', 'name')

	resetForm('#addSellout', false)
	$('#resetFormSellout').show()
	$('#deleteSellout').hide()
	$('.page.sellout .nav-header').text('Thống kê doanh số')
	hideError('sellout')

}
function renderPageClientData() {
	//partial Customer
	var html = ''
	var tmp = '

%cusname%

%cusadd% - %cusfone%

'
	var curData = CUSTOMERS.items('usersysid', USER.sysid)
	for(var i = 0; i < curData.length; i++) {
		row = tmp.replace(/%cusid%/g, curData[i].clientid)
		row = row.replace(/%cusname%/, curData[i].cusfamilyname + ' ' + curData[i].cusgivenname)
		row = row.replace(/%cusadd%/, curData[i].district)
		row = row.replace(/%cusfone%/, curData[i].phone)
		row = row.replace(/%alert%/, ('syncuperror' in curData[i] || curData[i].syncuperror == true) ? 'alert' : '')
		html += row
	}
	$('h3.ROLE_CAPTRNEWUSER span').text(' Danh sách khách hàng ('+curData.length+')')
	$('#listCustomer').html(html)

	//partial Inventory
	html = ''
	tmp = '

%name%

%date%

'
	var curData = INVENTORY.items('usersysid', USER.sysid)
	for(var i = 0; i < curData.length; i++) {
		var outlet = OUTLETS.item(curData[i].outletid)
		row = tmp.replace(/%name%/, outlet.name)
		row = row.replace(/%date%/, vnDate(curData[i].cycledate))
		row = row.replace(/%pid%/g, curData[i].clientid)
		row = row.replace(/%alert%/, curData[i].syncuperror == true ? 'alert' : '')
		html += row
	}
	$('h3.ROLE_CAPTRINVENTORY span').text('Danh sách tồn kho ('+curData.length+')')
	$('#listInventory').html(html)

	//partial Sellout
	html = ''
	tmp = '

%name%

%date%

'
	var curData = SELLOUT.items('usersysid', USER.sysid)
	for(var i = 0; i < curData.length; i++) {
		var outlet = OUTLETS.item(curData[i].outletid)
		row = tmp.replace(/%name%/, outlet.name)
		row = row.replace(/%date%/, vnDate(curData[i].cycledate))
		row = row.replace(/%pid%/g, curData[i].clientid)
		row = row.replace(/%alert%/, curData[i].syncuperror == true ? 'alert' : '')
		html += row
	}
	$('h3.ROLE_CAPTRPGSELLOUT span').text('Danh sách doanh số ('+curData.length+')')
	$('#listSellout').html(html)
}

function renderTableData(selector, data, idLabel, displayLabel) {
	var rows = ''
	for(var i = 0; i<data.length; i++) {
		rows += '
'
		rows += ''+data[i][displayLabel]+'	'
		rows += ''
		rows += '	<input type="text" class="inv-product" data-id="'+data[i][idLabel]+'" value="">'
		rows += '	'
		rows += '
'
	}
	rows = '
Sản phẩm	Số lon
' + rows
	$(selector).html(rows)
}
function resetForm(selector, doConfirm) {
	if (typeof doConfirm == 'undefined') {
		doConfirm = true;
	}
	var doReset = function(buttonIndex){
		if (buttonIndex == 2)
			return
		$(selector).find('select').val('')
		$(selector).find('input').val('')
		$(selector).find('input.alert').removeClass('alert')
		$(selector).find('.alert').hide()
		$('html,body').scrollTop(0)
	}
	if (doConfirm) {
		window.confirm("Bạn có muốn xóa nội dung đã nhập để làm lại?",doReset)
	} else {
		doReset(1)
	}
}

function syncDown() {
	var defProvince 	= $.Deferred()
	var defOutlet		 	= $.Deferred()
	var defCompetitor = $.Deferred()
	var defAbbott 		= $.Deferred()
	var defNemo				= $.Deferred()
	var defDate				= $.Deferred()
	var countToDetectLostInternet = 0
	$("#statusText").text("Đang tải xuống ...")
	showWait()
	$.when(defProvince,defOutlet,defCompetitor,defAbbott, defNemo, defDate).then(function(){
		hideWait()
		initOnlineData()
		if (isDataReady()) {
			$("#statusText").text("Tải xuống thành công")
		} else {
			$("#statusText").html("Dữ liệu chưa sẵn sàng")
		}

		// Đếm số lượng defferred, đủ 6 cái ajax đều error thì chắc là mất kết nối rồi
		if (countToDetectLostInternet == 6) {
			countToDetectLostInternet = 0
			$("#statusText").html("Không thể kết nối tới máy chủ")
		}
	})
	$.ajax({
		url: DOMAIN+'/SyncDownProvinceController',
		data: "",
		success: function(data, status, xhr) {
			PROVINCES = data.province
			PROVINCES.sortOn('prov')
			localStorage.provinces = JSON.stringify(PROVINCES)
		},
		error: function(xhr, status, error) {
			++countToDetectLostInternet
			console.log(status)
		},
		complete: function(){
			defProvince.resolve()
		}
	});
	$.ajax({
		url: DOMAIN+'/SyncDownPGOutletController',
		data: '{"userid":"'+USER.userid+'"}',
		success: function(data, status, xhr) {
			OUTLETS = data.pgoutlet
			OUTLETS.sortOn('name')
			localStorage.outlets = JSON.stringify(OUTLETS)
		},
		error: function(xhr, status, error) {
			++countToDetectLostInternet
			console.log(status)
		},
		complete: function(){
			defOutlet.resolve()
		}
	});
	$.ajax({
		url: DOMAIN+'/SyncDownCompetitorProductController',
		data: '',
		success: function(data, status, xhr) {
			COMPETITOR_PRODUCTS = data.competitorproduct
			COMPETITOR_PRODUCTS.sortOn('name')
			localStorage.competitor_products = JSON.stringify(COMPETITOR_PRODUCTS)
		},
		error: function(xhr, status, error) {
			++countToDetectLostInternet
			console.log(status)
		},
		complete: function(){
			defCompetitor.resolve()
		}
	});
	$.ajax({
		url: DOMAIN+'/SyncDownAbbottProductController',
		data: '',
		success: function(data, status, xhr) {
			ABBOTT_PRODUCTS = data.abbottproduct
			ABBOTT_PRODUCTS.sortOn('name')
			localStorage.abbott_products = JSON.stringify(ABBOTT_PRODUCTS)
		},
		error: function(xhr, status, error) {
			++countToDetectLostInternet
			console.log(status)
		},
		complete: function(){
			defAbbott.resolve()
		}
	});
	$.ajax({
		url: DOMAIN+'/SyncDownNEMOProductController',
		data: '',
		success: function(data, status, xhr) {
			NEMO_PRODUCTS = data.nemoproduct
			NEMO_PRODUCTS.sort(compareNemo)
			localStorage.nemo_products = JSON.stringify(NEMO_PRODUCTS)
		},
		error: function(xhr, status, error) {
			++countToDetectLostInternet
			console.log(status)
		},
		complete: function(){
			defNemo.resolve()
		}
	});
	$.ajax({
		url: DOMAIN+'/SyncDownInventoryCycleController',
		data: '',
		success: function(data, status, xhr) {
			INV_DATE = data.inventorycycle
			localStorage.inv_date = JSON.stringify(INV_DATE)
		},
		error: function(xhr, status, error) {
			++countToDetectLostInternet
			console.log(status)
		},
		complete: function(){
			defDate.resolve()
		}
	});

}

function getDOB() {
	var d = formGet('select', 'DOB_D')
	var m = formGet('select', 'DOB_M')
	var y = formGet('select', 'DOB_Y')

	d = (d < 10 && d != '')? "0"+d : d
	m = (m < 10 && m != '')? "0"+m : m

	return d+m+y;
}

function createCustomer() {
	var data = {
		clientid: makeid(8),
		userid:USER.userid,
		usersysid:USER.sysid,
		outletid: formGet('select', 'outletid'),
		cusfamilyname:$.trim(formGet('input','familyName')),
		cusgivenname:$.trim(formGet('input','givenName')),
		unit: $.trim(formGet('input','unit')),
		street: $.trim(formGet('input', 'street')),
		ward: $.trim(formGet('input', 'ward')),
		province:formGet('select', 'provinceid'),
		district:formGet('select', 'districtid'),
		phone: $.trim(formGet('input', 'phone')),
		consumername: $.trim(formGet('input', 'consumerName')),
		dob:getDOB(),
		compowderproduct:formGet('select','compowderproduct'),
		comliquidproduct:formGet('select','comliquidproduct'),
		abbpowderproduct:formGet('select','abbpowderproduct'),
		abbliquidproduct:formGet('select','abbliquidproduct')
	};
	var valid = validateCustomer(data)
	if (valid == true) {
		var clientid = formGet('input', 'clientid')
		if (clientid != '') {
			CUSTOMERS.removeAt('clientid', clientid)
		}
		CUSTOMERS.push(data)
		localStorage.customers = JSON.stringify(CUSTOMERS);
		return true
	} else {
		showError(valid.message)
		return false
	}
}

function formGet(tag, name, formSelector) {
	if (typeof formSelector == 'undefined')
		formSelector = '#addUser'
	var form = $(formSelector)
	return form.find(tag+'[name="'+name+'"]').val();
}
function countProduct(formSelector) {
	var form = $(formSelector+' input.inv-product')
	var products = []
	for(var i = 0; i<form.length; i++) {
		if (form.eq(i).val() != '') {
			products.push({
				productid: form.eq(i).attr('data-id'),
				qty: form.eq(i).val()
			})
		}
	}
	return products
}
function getDate(form_selector, input_name) {
	var form = $(form_selector)
	var d = form.find('select[name="'+input_name+'D"]').val()
	var m = form.find('select[name="'+input_name+'M"]').val()
	var y = form.find('select[name="'+input_name+'Y"]').val()

	d = (d < 10 && d != '')? "0"+d : d
	m = (m < 10 && m != '')? "0"+m : m

	return d+m+y;
}
function validateCustomer(data) {
	var valid = {message:''}
	var filter = [
		{field:'outletid',label:'Cửa hàng', action:'chọn'},
		{field:'cusfamilyname', label:'họ khách hàng', action: 'nhập'},
		{field:'cusgivenname', label: 'tên khách hàng', action: 'nhập'},
		{field:'street', label:'đường', action:'nhập'},
		{field:'province', label:'Tỉnh/thành phố', action:'chọn'},
		{field:'district', label:'Quận/huyện', action: 'chọn'},
		{field:'phone', label:'Số điện thoại', action: 'nhập'},
		{field:'consumername', label:'họ tên người sử dụng', action:'nhập'}
	]
	for (var i = 0; i<filter.length; i++) {
		if (data[filter[i].field] == '') {
			valid.message += "
● Chưa "+filter[i].action+" "+filter[i].label+" "
		}
	}

	if( !(data.phone.length == 10 || data.phone.length == 11) ) {
		valid.message += "
● Số điện thoại không đúng"
	}

	var prevPowder 	= formGet('select','compowderproduct')
	var prevLiqid 	= formGet('select','comliquidproduct')

	var powder 	= formGet('select','abbpowderproduct')
	powder  		= ABBOTT_PRODUCTS.item(powder)
	var liqid  	= formGet('select','abbliquidproduct')
	liqid 	 		= ABBOTT_PRODUCTS.item(liqid)

	var dob = data.dob
	if (dob != '' && dob.length < 8) {
		valid.message += "
● Ngày sinh chưa nhập chính xác"
	}
	if ('' === prevPowder && '' === prevLiqid) {
		valid.message += "
● Chưa chọn loại sữa trước đây"
	}
	if (null === powder && null === liqid) {
		valid.message += "
● Chưa chọn loại sữa hiện tại"
	} else {
		if ( (isManProduct(powder) || isManProduct(liqid)) && dob=="" ) {
			valid.message += "
● Ngày sinh bắt buộc nhập"
		}
		if ( !isFutProduct(powder) && !isFutProduct(liqid) && dob != '') {
			var d = new Date();
			d.setDate(formGet('select', 'DOB_D'))
			d.setMonth(formGet('select', 'DOB_M') - 1)
			d.setYear(formGet('select', 'DOB_Y'))
			var currentDate = new Date()
			if (d > currentDate)
				valid.message += "
● Ngày sinh không thể trong tương lai"
			else if(!checkDate(getDOB())) {
				valid.message += "
● Ngày sinh không đúng"
			}
		}
	}

	//Another validate
	if (valid.message == '')
		return true
	valid.message = "Thông tin chưa hợp lệ:" + valid.message
	return valid;
}
function isManProduct(p) {
	if (null === p)
		return false
	if (p.isman == "Y")
		return true
	return false
}
function isFutProduct(p) {
	if (null === p)
		return false
	if (p.isfut == "Y")
		return true
	return false
}
function validateInventory(data) {
	var valid = {message:''}
	var clientid = formGet('input','clientid','#addInventory')
	if (checkDuplicate(data.cycledate, data.outletid, INVENTORY) && clientid == '') {
		valid.message += '
● Thống kê này đã có sẵn'
	}
	if (data.inventory.length == 0)
		valid.message += "
● Chưa nhập số lượng"
	if (data.outletid == '') {
		valid.message += "
● Chưa chọn cửa hàng"
	}
	if (data.cycledate == '' || data.cycledate.length < 8){
		valid.message += "
● Chưa chọn đúng ngày thống kê"
	}

	var isNumberError = 0
	$('input.inv-product.alert').removeClass('alert')
	for(var i = 0; i < data.inventory.length; i++) {
		if (data.inventory[i].qty != parseInt(data.inventory[i].qty, 10) || data.inventory[i].qty <= 0){
			if (isNumberError == 0)
				valid.message += "
● Số lượng chưa đúng"
			var eleError = $('input.inv-product[data-id="'+data.inventory[i].productid+'"]')
			eleError.addClass('alert')
			isNumberError = 1
		}
	}
	if (valid.message == '')
		return true
	valid.message = "Thông tin chưa hợp lệ:" + valid.message
	return valid;
}

function validateSellout(data) {
	var valid = {message:''}
	var clientid = formGet('input','clientid','#addSellout')
	if (checkDuplicate(data.cycledate, data.outletid, SELLOUT) && clientid == '') {
		valid.message += '
● Thống kê này đã có sẵn'
	}
	if (data.sellout.length == 0)
		valid.message += "
● Chưa nhập số lượng"
	if (data.outletid == '') {
		valid.message += "
● Chưa chọn cửa hàng"
	}
	if (data.cycledate == '' || data.cycledate.length < 8){
		valid.message += "
● Chưa chọn ngày thống kê"
	} else {
		if (!checkDate(data.cycledate)) {
			valid.message += "
● Chọn sai ngày thống kê"
		}
		var d = new Date();
		d.setDate(date2d(data.cycledate))
		d.setMonth(date2m(data.cycledate) - 1)
		d.setYear(date2y(data.cycledate))
		var currentDate = new Date()
		if (d > currentDate) {
			valid.message += "
● Không thể chọn ngày trong tương lai"
		}
	}

	var isNumberError = 0
	$('input.inv-product.alert').removeClass('alert')
	for(var i = 0; i < data.sellout.length; i++) {
		if (data.sellout[i].qty != parseInt(data.sellout[i].qty, 10) || data.sellout[i].qty <= 0){
			if (isNumberError == 0)
				valid.message += "
● Số lượng chưa đúng"
			var eleError = $('input.inv-product[data-id="'+data.sellout[i].productid+'"]')
			eleError.addClass('alert')
			isNumberError = 1
		}
	}
	if (valid.message == '')
		return true
	valid.message = "Thông tin chưa hợp lệ:" + valid.message
	return valid;
}

function createReportInventory() {
	var data = {
		clientid: makeid(8),
		userid: USER.userid,
		usersysid: USER.sysid,
		outletid: $('#addInventory select[name="outletid"]').val(),
		cycledate: formGet('select', 'inv_date', '#addInventory'),
		inventory: countProduct('#addInventory')
	}

	var valid = validateInventory(data)
	if (valid == true) {
		var clientid = formGet('input', 'clientid', '#addInventory')
		if (clientid != '') {
			INVENTORY.removeAt('clientid', clientid)
		}
		INVENTORY.push(data)
		localStorage.inventory = JSON.stringify(INVENTORY);
		return true
	} else {
		showError(valid.message)
		return false
	}
}
function createReportSellout() {
	var data = {
		clientid: makeid(8),
		userid: USER.userid,
		usersysid: USER.sysid,
		outletid: $('#addSellout select[name="outletid"]').val(),
		cycledate: getDate('#addSellout','sellout'),
		sellout: countProduct('#addSellout')
	}

	var valid = validateSellout(data)
	if (valid == true) {
		var clientid = formGet('input', 'clientid', '#addSellout')
		if (clientid != '') {
			SELLOUT.removeAt('clientid', clientid)
		}
		SELLOUT.push(data)
		localStorage.sellout = JSON.stringify(SELLOUT);
		return true
	} else {
		showError(valid.message)
		return false
	}
}
function formSet(tag, name, val, formSelector) {
	if (typeof formSelector == 'undefined')
		formSelector = '#addUser'
	$(formSelector).find(tag+'[name="'+name+'"]').val(val)
}
function fillFormCustomer(id) {
	obj = CUSTOMERS.item('clientid', id)
	//render cua hang
	renderOptions('#addUser select[name="outletid"]', OUTLETS, 'id', 'name', '<option value="">Chọn cửa hàng</option>', obj.outletid);

	formSet('input', 'familyName', obj.cusfamilyname)
	formSet('input', 'givenName', obj.cusgivenname)
	formSet('input', 'unit', obj.unit)
	formSet('input', 'street', obj.street)
	formSet('input', 'ward', obj.ward)

	//render tinh thanh pho
	var tmp = uniqBy(PROVINCES, function(item) {return item.prov})
	renderOptions('select[name="provinceid"]',tmp, 'prov', 'prov', '<option value="">Chọn tỉnh thành</option>', obj.province);

	//render quan huyen
	var province = PROVINCES.filter(function(item){return item.prov == this}, obj.province);
	renderOptions('select[name="districtid"]', province, 'dist', 'dist', '<option value="">Chọn quận huyện</option>', obj.district);

	formSet('input', 'phone', obj.phone)
	formSet('input', 'consumerName', obj.consumername)

	//render DOB
	renderSingleOptions('select[name="DOB_D"]',range(1,31),'<option value="">Ngày</option>',obj.dob.substr(0,2)*1)
	renderSingleOptions('select[name="DOB_M"]',range(1,12),'<option value="">Tháng</option>', obj.dob.substr(2,2)*1)
	renderSingleOptions('select[name="DOB_Y"]',range(1930, (new Date()).getFullYear() + 1).reverse(),'<option value="">Năm sinh</option>', obj.dob.substr(4,4))

	var comPowderMilk = COMPETITOR_PRODUCTS.filter(function(obj){return obj.type == 'P'})
	var comLiquidMilk = COMPETITOR_PRODUCTS.filter(function(obj){return obj.type == 'L'})
	var abbPowderMilk = ABBOTT_PRODUCTS.filter(function(obj){return obj.type == 'P'})
	var abbLiquidMilk = ABBOTT_PRODUCTS.filter(function(obj){return obj.type == 'L'})
	renderOptions('select[name="compowderproduct"]', comPowderMilk, 'id', 'name', '<option value="">Chọn sữa bột</option>',obj.compowderproduct);
	renderOptions('select[name="comliquidproduct"]', comLiquidMilk, 'id', 'name', '<option value="">Chọn sữa nước</option>',obj.comliquidproduct);
	renderOptions('select[name="abbpowderproduct"]', abbPowderMilk, 'id', 'name', '<option value="">Chọn sữa bột</option>',obj.abbpowderproduct);
	renderOptions('select[name="abbliquidproduct"]', abbLiquidMilk, 'id', 'name', '<option value="">Chọn sữa nước</option>',obj.abbliquidproduct);

	formSet('input', 'clientid', obj.clientid)

	$('#resetFormUser').hide()
	$('#deleteUser').show()
	$('.page.customer .nav-header').text('Cập nhật khách hàng')
	hideError('customer')
}

function fillTableData(data, formSelector) {
	var form = $(formSelector)
	for(var i = 0; i < data.length; i++) {
		form.find('input[data-id="'+data[i].productid+'"]').val(data[i].qty)
	}
}
function fillInventory(id) {
	obj = INVENTORY.item('clientid', id)

	renderOptions('#addInventory select[name="outletid"]', OUTLETS.items('id',obj.outletid), 'id', 'name', '<option value="">Chọn cửa hàng</option>', obj.outletid);
	renderOptions('#addInventory select[name="inv_date"]',INV_DATE.items('cycledate', obj.cycledate), 'cycledate','desc','<option value="">Ngày thống kê</option>', obj.cycledate)

	//disable
	$('#addInventory select[name="outletid"]').attr('disabled','disabled')
	$('#addInventory select[name="inv_date"]').attr('disabled','disabled')

	//render data table
	renderTableData('#addInventory table tbody', NEMO_PRODUCTS, 'id', 'name')

	fillTableData(obj.inventory, '#addInventory')
	formSet('input', 'clientid', obj.clientid, '#addInventory')

	$('#resetFormInventory').hide()
	$('#deleteInventory').show()
	$('.page.inventory .nav-header').text('Cập nhật tồn kho')
	hideError('inventory')
}
function fillSellout(id) {

	var obj = SELLOUT.item('clientid', id)
	renderOptions('#addSellout select[name="outletid"]', OUTLETS.items('id', obj.outletid), 'id', 'name', '<option value="">Chọn cửa hàng</option>', obj.outletid);

	//render DOB
	renderSingleOptions('select[name="selloutD"]',range(1,31),'<option value="">Ngày</option>', obj.cycledate.substr(0,2)*1)
	renderSingleOptions('select[name="selloutM"]',range(1,12),'<option value="">Tháng</option>', obj.cycledate.substr(2,2)*1)
	renderSingleOptions('select[name="selloutY"]',range((new Date()).getFullYear() - 1, (new Date()).getFullYear() + 1).reverse(),'<option value="">Năm</option>', obj.cycledate.substr(4,4))

	//disable
	$('#addSellout select[name="outletid"]').attr('disabled','disabled')
	$('select[name="selloutD"]').attr('disabled','disabled')
	$('select[name="selloutM"]').attr('disabled','disabled')
	$('select[name="selloutY"]').attr('disabled','disabled')

	//render data table
	renderTableData('#addSellout table tbody', NEMO_PRODUCTS.sort(compareNemo), 'id', 'name')
	fillTableData(obj.sellout, '#addSellout')
	formSet('input', 'clientid', obj.clientid, '#addSellout')

	$('#resetFormSellout').hide()
	$('#deleteSellout').show()
	$('.page.sellout .nav-header').text('Cập nhật doanh số')
	hideError('sellout')
}
function syncUp() {
	var defCus 	= $.Deferred()
	var defInv	= $.Deferred()
	var defSel  = $.Deferred()
	var countToDetectLostInternet = 0
	var countBeforeSync = countData()
	var errorMsg = ''
	$("#statusText").text("Đang tải lên ...")
	showWait()
	$.when(defCus, defInv, defSel).then(function(){
		hideWait()
		if (errorMsg !== "") {
			errorMsg += "Số dữ liệu chưa tải lên: "+ countData() +"/"+countBeforeSync
		} else {
			errorMsg  = "Số dữ liệu đã tải lên: "+ countBeforeSync+"/"+countBeforeSync
		}
		$("#statusText").text(errorMsg)
		if (countToDetectLostInternet == 3) {
			$("#statusText").text("Không thể kết nối tới máy chủ")
		}
	})
	$.ajax({
		url: DOMAIN+'/SyncUpNewUserController',
		data: JSON.stringify({newuserrequest:CUSTOMERS.items('usersysid', USER.sysid)}),
		beforeSend : function(xhr, opts){
        var check = USER.funcs.filter(function(e){return e == this},'CAPTRNEWUSER')
        if (check.length === 0) {
            xhr.abort()
            defCus.resolve()
        }
    },
		success: function(data, status, xhr) {
			RESPONSE = data.newuserresponse
			var flagErr = 0
			for(var i = 0; i < RESPONSE.length; i++) {
				if (RESPONSE[i].responsecode == "101" || RESPONSE[i].responsecode == "102") {
					CUSTOMERS.updateAt('clientid', RESPONSE[i].clientid, 'syncuperror', true)
					flagErr = 1
				} else {
					CUSTOMERS.removeAt('clientid', RESPONSE[i].clientid)
				}
			}
			if (flagErr == 1) {
				errorMsg = 'Có lỗi. '
			}
			localStorage.customers = JSON.stringify(CUSTOMERS)
		},
		error: function(xhr, status, error) {
			errorMsg = 'Có lỗi. '
			++countToDetectLostInternet
			console.log(status)
		},
		complete: function() {
			defCus.resolve()
		}
	});
	$.ajax({
		url: DOMAIN+'/SyncUpInventoryController',
		data: JSON.stringify({inventoryrequest:INVENTORY.items('usersysid', USER.sysid)}),
		beforeSend : function(xhr, opts){
        var check = USER.funcs.filter(function(e){return e == this},'CAPTRINVENTORY')
        if (check.length === 0) {
            xhr.abort()
            defInv.resolve()
        }
    },
		success: function(data, status, xhr) {
			RESPONSE = data.inventoryresponse
			var flagErr = 0
			for(var i = 0; i < RESPONSE.length; i++) {
				if (RESPONSE[i].responsecode == "101" || RESPONSE[i].responsecode == "102") {
					INVENTORY.updateAt('clientid', RESPONSE[i].clientid, 'syncuperror', true)
					flagErr = 1
				} else {
					INVENTORY.removeAt('clientid', RESPONSE[i].clientid)
				}
			}
			if (flagErr == 1) {
				errorMsg = 'Có lỗi. '
			}
			localStorage.inventory = JSON.stringify(INVENTORY)
		},
		error: function(xhr, status, error) {
			errorMsg = 'Có lỗi. '
			++countToDetectLostInternet
			console.log(status)
		},
		complete: function() {
			defInv.resolve()
		}
	});
	$.ajax({
		url: DOMAIN+'/SyncUpSelloutController',
		data: JSON.stringify({selloutrequest:SELLOUT.items('usersysid', USER.sysid)}),
		beforeSend : function(xhr, opts){
        var check = USER.funcs.filter(function(e){return e == this},'CAPTRPGSELLOUT')
        if (check.length === 0) {
            xhr.abort()
            defSel.resolve()
        }
    },
		success: function(data, status, xhr) {
			RESPONSE = data.selloutresponse
			var flagErr = 0
			for(var i = 0; i < RESPONSE.length; i++) {
				if (RESPONSE[i].responsecode == "101" || RESPONSE[i].responsecode == "102") {
					SELLOUT.updateAt('clientid', RESPONSE[i].clientid, 'syncuperror', true)
					flagErr = 1
				} else {
					SELLOUT.removeAt('clientid', RESPONSE[i].clientid)
				}
			}
			if (flagErr == 1) {
				errorMsg = 'Có lỗi. '
			}
			localStorage.sellout = JSON.stringify(SELLOUT)
		},
		error: function(xhr, status, error) {
			errorMsg = 'Có lỗi. '
			++countToDetectLostInternet
			console.log(status)
		},
		complete: function() {
			defSel.resolve()
		}
	});
}
function checkAuthentication(callback) {
	showWait()
	$('#statusText').text('Đang xác nhận tài khoản...')
	$.ajax({
		url: DOMAIN+'/LoginValidationForSyncController',
		data: JSON.stringify({
			userid: USER.userid,
			password: USER.password
		}),
		success: function(data, status, xhr) {
			hideWait()
			if (data.responsecode == '001') {
				callback()
			} else {
				$('#statusText').text('Thông tin đăng nhập đã thay đổi trên hệ thống. Vui lòng đăng xuất ứng dụng và đăng nhập lại.')
			}
		},
		error: function(xhr, status, error) {
			hideWait()
			$('#statusText').text('Không thể kết nối tới máy chủ')
			console.log(status)
		}
	});
}
function updateFeature() {
	$(ALL_ROLE.map(function(i){
		return '.ROLE_'+i
	}).join(',')).hide()
	if (null !== USER) {
		$(USER.funcs.map(function(i){
			return '.ROLE_'+i
		}).join(',')).show()
	}
}

function renderPageSetting() {
	formSet('input', 'domain', DOMAIN,'#setting')
}
function saveSetting() {
	var url = formGet('input', 'domain', '#setting')
	var pattern = new RegExp(/(((http|https):\/\/))(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/);
	if ( !pattern.test(url) ) {
		showError('Domain ứng dụng sai định dạng')
	} else {
		DOMAIN = url
		localStorage.setItem('domain', DOMAIN)
		$('.setting .alert').hide()
		gotoPage('login')
	}
}
function overrideFuncs() {
	if (typeof navigator.notification != 'undefined') {
		window.alert = function(msg, callback) {
			if (typeof callback == 'undefined')
				callback = function(){}
			navigator.notification.alert(msg, callback, 'NEMO')
		}

		window.confirm = function(msg, callback) {
			if (typeof callback == 'undefined')
				callback = function(){}
			navigator.notification.confirm(msg, callback, 'NEMO')
		}
	} else {
		var originAlert = window.alert
		window.alert = function(msg, callback) {
			if (typeof callback == 'undefined')
				callback = function(){}
			originAlert(msg)
			callback()
		}
		var originConfirm = window.confirm
		window.confirm = function(msg, callback) {
			if (typeof callback == 'undefined')
				callback = function(){}
			var check = originConfirm(msg)
			if (check)
				callback(1) //press ok
			else
				callback(2) //press cancle
		}
	}
}

redpajama_set_name: RedPajamaGithub


text:
Veron Ang | Mar.06.2014
Asia's 50 Best Restaurants 2014: The Diners Club Roundtable
Asia's 50 Best Restaurants 2014 was announced on February 24. The event, one of the biggest in the fine dining scene, unveils this year's 50 best restaurants in the region as voted by over 900 international restaurant industry experts of The Diners Club® World's 50 Best Restaurants Academy.
Thanks to Diners Club International, I had the rare privilege to attend the gala event that took place at the luxurious Capella Singapore. In conjunction with the main event, Diners Club held a pre-event reception at Bob's Bar at the Capella.
Eduardo Tobon, President of Diners Club International, attended the event along with Chef Ivan Li, winner of the prestigious Diners Club® Lifetime Achievement Award winner for Asia's 50 Best Restaurants 2014.
A roundtable session was held as Chef Li took questions from a select group of journalists and bloggers at this session.
As the direct descendant of a chef who cooked for Empress Cixi during the late 19th century, Chef Li spent most of his 30-year career preserving the heritage of Chinese imperial cuisine. The strong restaurant empire he built under Family Li Imperial Cuisine boasts celebrity clientele that has included Bill Gates, Bill Clinton and even Mick Jagger.
If you ever visit a Family Li restaurant, you will be treated to exotic delicacies that have endured the test of time. His menu today features modern alternatives that preserve the original flavour without compromising the quality. One example is the lobster, which was not served back then.
We then moved on to the red carpet. This is like the Oscars equivalent for the restaurant industry. It is difficult not to gaze starry-eyed at the top chefs here, including Yoshihiro Narisawa, whose Tokyo restaurant topped the Asia's 50 Best Restaurants list last year, and chef-owner André Chiang, who picked up the respected Chefs' Choice Award this year, based on votes from fellow head chefs.
One additional focal point for the evening was this magnificent ice sculpture, featuring the Merlion and Singapore's skyline. People waited patiently for their turn to capture a cool photographic moment.
Chef Li's Family Li Imperial Cuisine was one restaurant that made it to the list for the first time, coming in at No. 46. Here, he receives his Lifetime Achievement Award on stage from Eduardo Tobon.
Nahm in Bangkok, Thailand, took the coveted top spot. The runner-up is last year's winner and the current Best Restaurant in Japan, Yoshihiro Narisawa's Les Créations de Narisawa. Third place goes to Gaggan, also from Thailand. Host city Singapore's Waku Ghin and Imperial Treasure and came in at No. 7 and No. 40, respectively.
The full list of Asia's 50 Best Restaurants 2014 is also available online.
What do you think of the rankings for Asia's 50 Best Restaurants 2014? Leave your thoughts in my blog post here.
BelieveBelong Editor's Note: Veron Ang is the editor and lead blogger behind Sparklette.net. Sparklette is an online lifestyle and food blog dedicated to the latest updates on entertainment, fashion, beauty, food and beverage and travel trends in Singapore and the region. This post is an excerpt from Ms. Ang's coverage of Asia's 50 Best Restaurants and the Diners Club Lifetime Achievement Award Reception, originally published on February 27. Click here for the full post.
Olga Londono | Mar.26.2014
Chef Ivan Li: Heir to An Imperial Chinese Legacy
Chrysoula Economopoulos | Feb.23.2014

redpajama_set_name: RedPajamaCommonCrawl


text:
Bernardo Añor (Caracas, 24 mei 1988) is een Venezolaans voetballer. Hij verruilde in 2015 Columbus Crew voor Sporting Kansas City.

Clubcarrière
Anor werd als achtenveertigste gekozen door Columbus Crew in de MLS SuperDraft 2011. Hij maakte op 26 maart 2011 zijn debuut in een 0-0 gelijkspel tegen New York Red Bulls. Op 18 juni 2011 maakte hij tegen Houston Dynamo zijn eerste doelpunt. Op 8 december 2014 tekende hij bij Sporting Kansas City.

Trivia
Zijn vader, ook genaamd Bernardo Añor (1959), was eveneens een professioneel voetballer en speelde in de jaren tachtig en negentig interlands voor Venezuela. Añor senior nam deel aan de Olympische Spelen van 1980 in Moskou.

Zie ook
 Lijst van spelers van Columbus Crew

Venezolaans voetballer

redpajama_set_name: RedPajamaWikipedia


I tell you, if your sense of right and wrong is not keener than that of the Lawyers and the Pharisees, you will not enter the kingdom of heaven.
You have heard, that it was said to our people in the past: Do not commit murder; anyone who murders will have to face trial. But now, I tell you: whoever gets angry with a brother or sister will have to face trial. Whoever insults a brother or sister is liable, to be brought before the council. Whoever calls a brother or sister "Fool!" is liable, of being thrown into the fire of hell. So, if you are about to offer your gift at the altar, and you remember that your brother has something against you, leave your gift there, in front of the altar; go at once, and make peace with your brother, and then come back and offer your gift to God.
Don't forget this: be reconciled with your opponent quickly when you are together on the way to court. Otherwise he will turn you over to the judge, who will hand you over to the police, who will put you in jail. There, you will stay, until you have paid the last penny.
By the same token the seeds of the kingdom are also in our hearts: when we forgive our brothers and sisters and those who frustrate us or do us harm. So serious is the call to be reconciled that it is a higher priority to make peace with our brother or sister than to go to Mass.


I hope the Babe said this, and if he did not, then no problem anyway, somebody like him needs the credit.
My friend Gary said something like this to me one time, it is one of them reverse logic, look at the world from a different angle, and the solution is easy thoughts. He wrote me, and now my curiousity is going astray, was a great day, searching for quotes.
Somewhere in the mind, over in the corner, hidden by some confusions, is a switch, flip the switch, and the world changes. Come up with one more excuse, and the world stays the same.


text:
Ascot Gold Cup
Queen Anne Stakes
King's Stand Stakes
St James's Palace Stakes
Prince of Wales's Stakes
Commonwealth Cup
Coronation Stakes
Platinum Jubilee Stakes
When is the 2023 Ascot Gold Cup?
2022 Ascot Gold Cup Tips - 40/1 outsider Khan outrun his odds
2022 Ascot Gold Cup Odds - Trueshan and Kyprios joint-favourites to land Royal feature
2022 Royal Ascot Tips - Four huge value bets in the Group Ones
2021 Royal Ascot Gold Cup Tips - 14/1 chance can thwart the favourite
Ascot Gold Cup Predictions & Betting Tips: Order Of St George could return for his redemption story
2021 Royal Ascot Gold Cup Odds - Stradivarius Evens as he goes for four in a row
2022 Royal Ascot Tips - All seven races covered on day three
2023 Ascot Gold Cup Tips & Predictions
Day three at Royal Ascot revolves around the only Group One on the card, the Ascot Gold Cup. This historic race takes place over a grueling trip of two-and-a-half miles, and Her Majesty, The Queen comes down from the stands to hand the famous trophy to winning connections.
Many of flat racing's most famous stayers have won Ascot Gold Cup, including multiple winners Sagaro, Touchstone, Kayf Tara and Yeats.
Ascot Gold Cup Key Facts
Date Thursday June 22, 2023
Track Royal Ascot
Distance 2m4f
Prizemoney £400,000
2023 Ascot Gold Cup Odds
No odds are available for the 2023 Ascot Gold Cup.
2023 Ascot Gold Cup Tips
Once the field has been finalised, we'll publish our guide to the 2023 Ascot Gold Cup.
2021 Ascot Gold Cup Result
1st Kyprios 13/8f
2nd Mojo Star 15/2
3rd Stradivarius 2/1
Ascot Gold Cup History
The Ascot Gold Cup is the biggest staying race during the Royal Ascot festival.
Established in 1807 in the presence of King George III and Queen Charlotte, the first running was taken out by Master Jackey as a three-year-old.
There were many three-year-old winners in the early stages of the Gold Cup, but the race is now only open to horse four years old and above.
1844 winner The Emperor was unnamed when winning the Ascot Gold Cup, but was named after Nicholas I of Russia, who was in attendance.
The Emperor would again win a year later to make it a winning double.
Estimate gave Queen Elizabeth II a win in 2013 as an owner. A massive roar of the crowd was heard when the four-year-old crossed the line first.
Champion stayer Yeats won the Ascot Gold Cup on four straight occasions. The Aidan O'Brien-trained runner received a big ovation when winning his fourth and he has been immortalised with a statue in the parade ring.
Lestor Piggott has the record for most wins with 11. The jockey won his first in 1957 with Zarathustra and his last in 1982 with two-time winner Ardross.
Aidan O'Brien is the leading trainer. He has saddled up Yeats, Fame and Glory, Leading Light and Order of St George to victory.
Big Orange claimed a famous Ascot win for Michael Bell and his team when he lowered Order Of St George's colours in 2017.
Stradivarius then took over in 2018, winning his first Ascot Gold Cup. John Gosden's star stayer defended his crown the following season and powered to a superb 10-length triumph on soft ground in 2020 to complete a hat-trick of Gold Cup wins.
Gosden's star was then beaten in 2021 and 2022, as he attempted to match Yeats' tally of four wins. Mark Johnson Subjectivist made all to score in 2021, before Aidan O'Brien's Kyprios proved too quick for Stradivaius in 2022.
Ascot Gold Cup Betting Guide
Big Orange, Order of St George and Trip to Paris are all recent winners and all three have gone on to win on the world stage.
Big Orange was able to upset 5/6 favourite and 2016 champion Order of St George in 2017, winning at odds of 5/1 for trainer Michael Bell.
Order of St George had won in 2016 at an odds-on quote with bookmakers.
Included in the 2016 field were Melbourne Cup entrants Tiberian and Max Dynamite, so the quality of the field was high and considered one of the best Ascot Gold Cup fields in history.
Trip to Paris scored for trainer Ed Dunlop in 2015. The world class runner scored at 12/1 before running well in the Melbourne Cup later in his career.
Estimate won as the 7/2 favourite in 2013 and was disqualified in 2014.
The Queen's horse finished second behind 10/11 favourite Leading Light but was disqualified after testing positive to a prohibited substance.
The controversy rocked Royal Ascot and the each way punters which took the 8/1 on offer were left to lick their wounds.
The 20/1 odds around Rite Of Passage was good value for punters in 2010, but most of the money was on Ask at 11/4.
Yeats paid 7/1 when winning his first Ascot Gold Cup. He started at 8/13, 11/8 and 6/4 in his three subsequent wins and bettors were happy with the better than odds-on prices for his last two wins.
Recent Ascot Gold Cup Winners
Race Winner
2022 Kyprios
2021 Subjectivist
2020 Stradivarius
2017 Big Orange
2016 Order of St George
2015 Trip to Paris
2014 Leading Light
2013 Estimate
2012 Colour Vision
2011 Fame and Glory
2010 Rite of Passage
2009 Yeats
2005 Westerner
2004 Papineau
2003 Mr Dinos
2002 Royal Rebel
2000 Kayf Tara
1999 Enzeli
1997 Celeric
1996 Classic Cliche
1995 Double Trigger
1994 Arcadian Heights
1993 Drum Taps
1991 Indian Queen
1990 Ashal
1989 Sadeem
Cheltenham Odds 2023 Relkeel Hurdle Odds - Marie's Rock heads Cheltenham betting
Kempton Quotes 2022 King George VI Chase News - Key quotes from Paul Nicholls, Henry De Bromhead and more
Racing News Noble Yeats and Ashtown Lad cut for the Grand National after Aintree wins
Grade One Odds 2022 Tingle Creek Odds - Shishkin now the clear favourite at Sandown


Projects with the ISWCC Project Tracker are assigned to an appropriate place in a project hierarchy consisting of Resources, and Programs. While some projects have multiple benefits and thus could fit under various Programs, for reporting purposes each project must be assigned to a primary Program.
Use the tree view below to see projects fit in to the hierachy. The search feature can be used to explore the project types and names. Click a Resource or Program to learn details about each item.


text:
Q: Onedrive File picker not opening when using authorization code flow I am following the Microsoft onedrive documentation  authorization code flow to grant my user access to their onedrive files.
I got the access_code and sent a POST request using ruby with access_code, client_id, clien_secret and got the access_token as a JSON response.
when I try appending this access_token,scopes,state,.. along with My Redirect_url to access the Onedrive file Picker the window closes. The following is the sample URL of that
 http://MY_REDIRECT_URL/onedrive#access_token=My_access_token&token_type=bearer&expires_in=3600&scope=wl.skydrive%20wl.signin&state=redirect_type%3dauth%26display%3dpage%26request_ts%3d1427963180884%26response_method%3durl%26secure_cookie%3dfalse&user_id=My_USER_ID

when I used the same URL in Authorization token flow it's properly opening  the file picker.
When I checked the wl_auth cookie value it's saying
 error=invalid_cookie&error_description=The%20'wl_auth'%20cookie%20has%20been%20modified%20incorrectly.%20Ensure%20that%20the%20redirect%20URI%20only%20modifies%20sub-keys%20for%20values%20received%20from%20the%20OAuth%20endpoint.&status=connected

A: The error is that we need to make the URL the same as the URL that would be obtained when Authorization token flow is used.
Also, while making URL make sure its encoded and also response_type value should be URL not COOKIE

redpajama_set_name: RedPajamaStackExchange


text:
Find an Ob-Gyn
Multiples and Twins
Pre-Pregnancy
Pregnancy Visual Timeline
Pregnancy Milestones
Male Births Declining in the U.S.
135,000 Fewer White Males Born During Past 30 Years
By Jennifer Warner
April 11, 2007 -- The number of male babies born in the U.S. is dropping and has been on a steady decline for the last three decades, according to a new study.
Researchers found the decline in male births is equivalent to 135,000 fewer white males in the last 30 years in the U.S.
They say the reason for the decrease is unclear, but environmental factors coupled with the rising age of parents giving birth may be playing a role.
"We know that men who work with some solvents, metals, and pesticides father fewer baby boys. We also know that nutritional factors, physical health, and chemical exposures of pregnant women affect their ability to have children and the health of their offspring," says Devra Lee Davis, PhD, MPH, director of the University of Pittsburgh Cancer Institute's Center for Environmental Oncology, in a news release. "We suspect that some combination of these factors, along with older age of parents, may account for decreasing male births."
Male Births Declining
In the study, researchers analyzed birth statistics in the U.S. from 1970 to 2002 and in Japan from 1970 to 1999. The results appear in the online edition of Environmental Health Perspectives.
The results showed an overall decline of 17 males per 10,000 births in the U.S. and 37 males per 10,000 births in Japan during the study period. But the decline was only evident among white males in the U.S. and not among blacks.
Researchers found the number of black male births has increased slowly over the last three decades, but the ratio of male-to-female births among blacks remains lower than that of whites. In addition, blacks have a higher fetal mortality rate, and male black babies are more likely to die than females.
"Given the higher mortality rates for African-American males in the United States, these results re-emphasize the need to determine all factors, including environmental contaminants, which are responsible for this continuing health disparity," researcher Lovell A. Jones, PhD, director of the Center for Research on Minority Health at the University of Texas M.D. Anderson Cancer Center, says in the release.
WebMD Health News Reviewed by Louise Chang, MD on April 11, 2007
SOURCES: Davis, D. Environmental Health Perspectives, April, 9 2007. News release, University of Pittsburgh Schools of the Health Sciences.
© 2007 WebMD, Inc. All rights reserved.
Am I in Labor?
Guide to Prenatal Tests
When Pregnancy Is a Surprise
Abdominal Separation
Pregnant With Allergies? Top Treatment Tips
Today on Grow
Your Pre-Pregnancy Checklist: Ready for Baby?
Ovulation Calculator: Track Your Most Fertile Days
Am I in Labor? Signs to Watch Out For
Inducing Labor: Are There Ways to Do It Naturally?
See How Your Baby Grows Each Month
Why Your Favorite Foods Gross You Out
What You Should Know About Multiple Births
Your Guide to a Beautiful Pregnancy
7 Embarrassing Pregnancy Symptoms
12 Easy, Yummy Snacks for Pregnant Women
Can You Eat Peanuts?
What to Expect During Labor
Should I Eat My Placenta?
What Is Implantation Bleeding?
Flu Shots and Pregnancy
Ovulation Tool: Find Your Most Fertile Days
Get Pregnancy & Parenting Tips In Your Inbox
Doctor-approved information to keep you and your family healthy and happy.
Pregnancy & Baby Bulletin
Parenting & Children's Health


Make sure to bring some style and fashion to your dirty laundry with the Mint Seersucker Laundry Bag. Choose your favorite color to hold your camp clothes with panache pattern! The Mint Seersucker's drawstring cinches shut to keep your dirty clothes out of sight and out of mind. Provided with a large shoulder strap, you can carry your Seersucker Laundry Bag comfortably to the wash and back. Machine wash cold and air dry. Dimensions: 22.5" x 31".


text:
Q: How to initialize a koa node.js app application on IISNode (Azure WebSites) We are currently moving a self-hosted koa app to IISNode on Azure WebSites..
In self-hosting, we initiallize the application by calling
    node --harmony ./bin/application
Requests then go to ./index.js.
However we could not find how to setup IISNode to call "bin/application" at initialization time.
Any ideas?
Thanks

A: Not sure this is the same scenario, but I ran into something that sounds like this when express.js started using ./bin/www as the entry point for express.js apps. Initially it broke everything, but now we look for the "scripts" entry in the package.json to tell Azure how to configure IISNode for the application. For express, it generates a "scripts" entry that looks like this:
"scripts": {
    "start": "node ./bin/www"
  },
When Azure sees this, it generates a web.config on the server that uses ./bin/www for the entry point.
So... I'd say first off, try adding a "scripts" entry to the package.json that points to your ./bin/application file, and try deploying that to Azure. Hopefully that 'just works'. If it doesn't, try adding a web.config to the root of your application, using https://gist.github.com/Blackmist/8677359708fd30779c77 as the contents. This should point IISNode to the ./bin/application file as the entrypoint, and is what Azure Websites should automatically generate when it sees the "scripts" entry in the package.json file.
The other problem you'll run into is using Node.js v0.11.13, which I don't believe is included in Azure websites by default, and passing the --harmony switches. http://azure.microsoft.com/en-us/documentation/articles/nodejs-specify-node-version-azure-apps/ has a section on including a version of node.js as part of your website. In the iisnode.yml file, you'd want to have a line similar to the following:
nodeProcessCommandLine: d:\home\site\wwwroot\bin\node.exe --harmony
I believe this should make this work.

A: You can setup custom deployment scripts for Azure Websites.
This blog post contains details on how to use it:
http://blog.amitapple.com/post/38417491924/azurewebsitecustomdeploymentpart1/#.VBcrnPldXIc


Purpose: Obesity is a major public health problem worldwide, and of late, epidemiological studies indicate a preponderance of cataracts under obesity conditions. Although cataract is a multifactorial disorder and various biochemical mechanisms have been proposed, the influence of obesity on cataractogenesis has yet to be investigated. In such a scenario, a suitable animal model that develops cataract following the onset of obesity will be a welcome tool for biomedical research. Therefore, we investigated the molecular and biochemical basis for predisposition to cataract in the obese mutant rat models established in our institute because 15%–20% of these rats develop cataracts spontaneously as they reach 12–15 months of age.
Methods: We analyzed the major biochemical pathways in the normal lenses of different age groups of our obese mutant rat strains, Wistar/Obese (WNIN/Ob) and WNIN/GR-Ob, the former with euglycemia and the latter with an additional impaired glucose tolerance trait. In addition, sorbitol levels were estimated in the cataractous lenses of the obese rats.
Results: Except for the polyol pathway, all the principal pathways of the lens remained unaltered. Therefore, sorbitol levels were found to be high in the normal eye lenses of obese rats (WNIN/Ob and WNIN/GR-Ob) compared to their lean controls from three months of age onwards. Between WNIN/Ob and WNIN/GR-Ob, the levels of sorbitol were higher in the latter, suggesting a synergistic effect of impaired glucose tolerance along with obesity in the activation of the sorbitol pathway. Either way, an elevated sorbitol pathway seemed to be the predisposing factor responsible for cataract formation in these mutant rats.
Conclusions: Activation of the sorbitol pathway indeed enhances the risk of cataract development in conditions such as metabolic syndrome. These rat models thus may be valuable tools for investigating obesity-associated cataract and for developing intervention strategies, based on these findings.
Epidemiological studies suggest the prevalence of overweight and obesity has reached epidemic proportions worldwide , and in the past 20 years, obesity rates have tripled in developing countries as well [2,3]. Several serious medical conditions are now associated with obesity, and it is no longer considered just a problem of overweight. Obesity is now aptly referred to as a metabolic syndrome and is associated with several degenerative diseases, including coronary heart disease, type 2 diabetes, hypertension, stroke, dyslipidemia, osteoarthritis, sleep apnea, fatty liver, and certain types of cancers. Eye problems are probably the latest addition to this list associated with obesity [4,5]. The ocular complications of obesity include diabetic retinopathy, high intraocular pressure, cataracts, macular degeneration, and exophthalmos [4,5].
Cataract is the leading cause of blindness worldwide and accounts for an estimated 16 million cases of blindness, with approximately half of all cases originating in Africa and Asia [6,7]. Recently, several large population-based studies have shown the association between obesity and cataract [5,8-12]. For example, the Physicians' Health Study [9,12], the Nurses' Health Study , and the Framingham Eye Study , as well as several cross-sectional studies [13-16], demonstrated a positive association between various measures of obesity and cataract. Cortical and posterior subcapsular cataracts have been most consistently associated with obesity [13,15-17]. In the Age-Related Eye Disease Study (AREDS), higher body mass index (BMI) and weight gain were found to have significant association with moderate cortical cataract .
There are three principal mechanisms by which the lens can be damaged, resulting in cataract (oxidative stress, osmotic effect, and non-enzymatic protein glycation ), and obesity might influence any or all of these physiologic processes [19,20]. However, to the best of our knowledge no experimental studies have explained the association between obesity and cataract and their plausible pathophysiological mechanism(s). Thus, there is an urgent need for mechanistic studies to understand cataract due to obesity. In such a scenario, the availability of an animal model that develops cataract following the onset of obesity (akin to obesity-associated cataract in patients) is of immense value.
At the National Center for Laboratory Animal Sciences of our institute, as early as 1997, a spontaneously developed obese rat was isolated from the existing Wistar (WNIN) stock of rats, and a colony of WNIN-Obese (WNIN/Ob) rats was established by selective breeding [21,22]. Subsequently, it bifurcated into another strain with impaired glucose tolerance (IGT)-WNIN/GR-Ob [21,23]. The phenotype and associated biochemical, histological, and pathophysiological characteristics of WNIN/Ob and WNIN/GR-Ob rats have been reported in detail elsewhere [21-24]. In essence, starting from 35 to 40 days of age, the WNIN/Ob and WNIN/GR-Ob phenotypes are different from their respective lean littermates, and the rats' bodyweight increases progressively until the age of six to nine months. The average life span of these obese mutant rat strains was found to be 18–24 months as against 30–36 months for their parent WNIN strain. The animals show hyperinsulinemia, hypertriglyceridemia, and hypercholesterolemia. In addition, these rats also seem to develop a few degenerative conditions such as retinal degenerations as early as four months of age . Further, our initial screening of these rat colonies showed that about 15% of WNIN/Ob and 20% of WNIN/GR-Ob rats develop cataracts spontaneously by the time they reach 12 months of age. However, the molecular basis for these cataracts was a dilemma, that, too, being shown in about only 15%–20% animals at best. We undertook the present study to explore and explain the observed enigma.
Anti-α-actin antibody, bovine serum albumin (BSA), 1-chloro-2,4-dinitro benzene (CDNB), 2,4-dinitro phenyl hydrazine (DNPH), diethylene triamine penta acetic acid (DEPTA), glucose-6-phosphate, glutathione reductase, DL-glyceraldehyde, glutathione (GSH), nicotinamide adenine dinucleotide (NAD), NADH, nicotinamide adenine dinucleotide phosphate (NADP), nicotinamide adenine dinucleotide phosphate (reduced) (NADPH), pyrogallol, D-sorbitol, sorbitol dehydrogenase, antirabbit immunoglobulin G (whole molecule) peroxidase, and Tris-HCl were purchased from Sigma Chemicals (St. Louis, MO). The Sephacryl S-300 HR was from Amersham Biosciences (Piscataway, NJ).
All the procedures involving rats were performed in accordance with the Association for Research in Vision and Ophthalmology (ARVO) statement for the Use of Animals in Ophthalmic and Vision Research and were approved by the Institutional Animal Ethics Committee at the National Institute of Nutrition. Animals were kept in a 12-h light-dark cycle with ambient light intensity and temperature at the National Center for Laboratory Animal Science, National Institute of Nutrition. Three- to 12-month-old WNIN/Ob and WNIN/GR-Ob rats along with their respective lean littermate rats were fasted overnight and sacrificed by CO2 asphyxiation at the end of the dark cycle.
Eyes were examined for lens opacity using a slit lamp biomicroscope (Kowa Portable; Kowa, Ltd., Tokyo, Japan) on dilated pupils. Only clear lenses without any opacity were used for analysis. Eyeballs of three- to 12-month-old animals were collected, and the lenses were dissected by the posterior approach. Briefly, a small incision was made on the posterior side of the eye with scissors. The lenses were collected by pressing with tweezers against the side of the eye opposite the incision and stored at −70 °C until further analysis.
A 10% homogenate of the lenses was prepared in homogenization buffer (25 mM Tris-Cl, pH 8.0 containing 0.5 mM ethylenediaminetetraacetic acid and 100 mM NaCl). The homogenate was centrifuged at 10,000× g for 30 min at 4 °C. The supernatant was referred to as the soluble fraction. Total and soluble protein content was estimated with the Lowry method, and the percentage of soluble protein was calculated. The soluble fraction was applied onto a 300× 7.8 mm TSK-3000 SW-XL size exclusion chromatography (SEC) column (Tosoh Co., Tokyo, Japan) using a Shimadzu high-performance liquid chromatography system . The subunit profile and cross-linking of lens-soluble proteins were analyzed on 12% polyacrylamide gels in the presence of sodium dodecyl sulfate (SDS) under reducing conditions .
Lens lipid peroxidation was measured as thiobarbituric acid reacting substances (TBARS) and protein carbonyl content was determined based on their reactivity with 2,4-dinitrophenyl hydrazine according to reported methods [27-29]. In brief, malondialdehyde is the end product of lipid peroxidation of polyunsaturated fatty acids. Malondialdehyde was estimated by utilizing its reactivity with 2-thiobarbituric acid resulting pink coloured condensation product, a trimethine which was measured spectrophotometrically at 533 nm. The carbonyls react with 2,4-dinitrophenyl hydrazine to form protein hydrozones, which can be detected and quantified spectrophotometrically at 365 nm. The activities of antioxidant enzymes: superoxide dismutase (SOD), glutathione peroxidase (GPx), glutathione S-transferase (GST) and glucose-6-phosphate dehydrogenase (G6PD) were assayed spectrophotometrically according to the reported methods [27,29]. The assay of SOD is based on the ability of the enzyme to inhibit the auto-oxidation of pyrogallol. The rate of auto-oxidation of pyrogallol is measured following the change in absorbance at 420 nm. GPx catalyzes the oxidation of reduced glutathione by hydrogen peroxide or lipid peroxides to oxidized glutathione (GSSG). The rate of GSSG formation, a measure of enzyme activity, was monitored coupling with the glutathione reductase reaction where NADPH oxidation was followed at 340 nm. GST catalyzes the conjugation of toxic electrophilic compounds with glutathione. In GST assay formation of 1-chloro-2,4-dinitrobenzene-glutathione conjugate was monitored at 340 nm. G6PD catalyzes the oxidation of glucose-6-phosphate to 6- phosphogluconolactone in presence of NADP+. The rate of NADP reduction to NADPH was followed as a measure of enzyme activity of G6PD at 340 nm.
The extent of glycation was measured by monitoring advanced glycation end-product (AGE) related non-tryptophan fluorescence. AGE fluorescence measurements were performed using a Jasco spectrofluorometer (FP-6500; Tokyo, Japan) in soluble protein (0.15 mg/ml protein in 50 mM sodium phosphate buffer, pH 7.2) . Fluorescence spectra were obtained from 400 to 500 nm with excitation at 370 nm.
The status of the polyol pathway in the eye lenses of WNIN/Ob and WNIN/GR-Ob rats was assessed by analyzing the activity of aldose reductase (ALR2) and sorbitol dehydrogenase (SDH) and sorbitol levels in the lens. The activities of ALR2 and SDH were assayed spectrophotometrically according to the reported methods [27,29]. ALR2 catalyzes the NADPH linked reduction of glyceraldehyde and change in the absorbance at 340 nm due to NADPH oxidation was monitored. SDH catalyses the NAD linked oxidation of sorbitol to fructose or reduction of fructose to sorbitol. SDH activity was measured by the decrease in absorbance at 340 nm due to the oxidation of NADH using fructose as the substrate.. Sorbitol was extracted by homogenizing the lens in nine volumes of 0.8 M perchloric acid. The homogenate was centrifuged at 5,000× g at 4 °C for 10 min, and the pH of the supernatant was adjusted to 3.5 with 0.5 M potassium carbonate. The sorbitol content of the supernatant was measured with the fluorometric method as described previously  using a fluorometer (Jasco-FP-6500, Tokyo, Japan). One ml reaction mixture, consisted of 50 μmol glycine buffer, pH 9.4, 2 μmol magnesium chloride, 0.2 μmol nicotinamide adenine dinucleotide (NAD) and protein-free supernatant, was incubated for 5 min at 37 °C, and the reaction was initiated by the addition of 0.6 U of SDH. The relative fluorescence due to NADH formation was measured in a fluorometer with an excitation wavelength at 360 nm and an emission wavelength of 452 nm. Sorbitol standards, ranging from 0.2 to 9.0 μg/ml, were analyzed the same way to generate a standard curve. Sorbitol was also estimated in a few cataractous lenses collected from the obese rats.
Lens-soluble proteins were resolved under reducing conditions on 12% SDS–polyacrylamide gel electrophoresis (PAGE), proteins were transferred onto a nitrocellulose membrane (NC), and NC was blocked with 5% skimmed milk powder. The NC membrane was incubated with an affinity purified polyclonal antisera of ALR2 (1:2,000 dilution) later with horseradish peroxidase–conjugated goat antirabbit antibody (1:2,500). Subsequently, detection was performed with diaminobenzidine in the presence of hydrogen peroxide.
Descriptive statistics were calculated for all the study variables, and a t test was used to compare the mean values of different parameters among groups for given age/strain. Mean values were also compared among the time points for given group/strain using ANOVA with a post hoc Fisher's least significant difference test. Level of significance was considered as 0.05.
Insolubilization and aggregation of soluble lens proteins is the major biochemical alteration leading to cataractogenesis. Therefore, we determined the total and soluble protein content in the lens of the WNIN/Ob and WNIN/GR-Ob rats at different ages. Although irrespective of phenotypes there was a decrease in soluble protein content with age, there was no difference in protein (total, soluble, and insoluble) content of the WNIN/Ob rats as compared to lean rats of the corresponding age (Table 1). Similar results were observed with WNIN/GR-Ob rats (data not shown).
To understand the possible alterations in crystallin distribution and subunit profile due to obesity, the soluble protein fraction was analyzed with SEC and SDS–PAGE. The lens-soluble fraction was clearly resolved into high molecular weight aggregate-, αL-, β-, and γ-crystallin peaks on a SEC column, and there was no difference in the percentage distribution of different crystalline peaks between WNIN/Ob and its respective lean animals from three to 12 months (Figure 1). Similar results were observed with WNIN/GR-Ob rats (data not shown). Similarly, the subunit profile of lens proteins and cross-linking was also not different in WNIN/Ob or WNIN/GR-Ob rats compared to their respective lean animals as assessed with SDS–PAGE (Figure 2).
Increased oxidative stress has been implicated in the development of various types of cataract [31-34]. Therefore, we assessed oxidative stress by measuring lipid peroxidation, protein carbonyls, and some of the antioxidant enzymes in the lenses of WNIN/Ob and WNIN/GR-Ob rats. The TBARS levels, an indication of lipid peroxidation, were not different in the WNIN/Ob or WNIN/GR-Ob lenses compared with their respective lean controls from three to 12 months (data not shown). Usually, increased lipid peroxidation is observed in hypercholesterolemia and hyperlipidemia. Although the obese rats were hypercholesterolemic and hyperlipidemic, we did not observe any change in the lipid peroxidation of the lenses between the lean and obese rats suggesting that the lens might have a robust mechanism to preserve and maintain the fatty acids profile even under altered metabolic conditions. Because we observed a significant increase in lipid peroxidation (TBARS) in other tissues such as the livers, hearts, and kidneys of the WNIN/Ob and WNIN/GR-Ob rats compared with their respective lean animals (data not shown). Further, there were no significant differences in the fatty acid composition of the lenses between the lean and WNIN-Ob rats (data not shown), which indicates that indeed the eye lens has a robust mechanism for preserving and maintaining the fatty acids profile under altered metabolic conditions.
However, we found the protein carbonyl content, a measure of oxidative damage to proteins, higher in the WNIN/Ob and WNIN/GR-Ob rat lenses compared with their respective lean controls suggesting enhanced protein oxidation in the obese rat lens (Figure 3). The increase in protein oxidation due to obesity was more prominent in the WNIN/GR-Ob rat lenses compared to the WNIN/Ob rat lenses (Figure 3) indicating the added effect of IGT. Similarly, there was an increase, though statistically not significant, specifically SOD, GPx, G6PD, and GST activities in the lenses of WNIN/Ob and WNIN/GR-Ob animals compared with their respective lean animals at three, six, and 12 months, thereby substantiating the increased oxidative stress in the eye lens due to obesity (Table 2).
Non-enzymatic glycation of lens protein has been considered a major factor responsible for age-related and diabetic cataracts [35,36], which alters protein conformation and stability, induces protein aggregation and cross-linking, and leads to protein insolubilization [37-39]. Hence, the degree of glycation in the soluble and insoluble protein fraction of the WNIN/Ob and WNIN/GR-Ob animals was measured by monitoring AGE-related non-tryptophan fluorescence. However, there was no difference in AGE-related non-tryptophan fluorescence between WNIN/Ob and WNIN/GR-Ob and the respective lean rats in all the age groups studied (data not shown). The lack of change in the subunit profile and cross-linking of lens proteins in WNIN/Ob or WNIN/GR-Ob rats compared to their respective lean animals (Figure 2) further corroborate these observations.
Among the many biochemical pathways associated with cataract, the polyol pathway has been extensively studied, particularly in the diabetic cataract [29,34,40,41]. Hence, we investigated the status of the polyol pathway in WNIN/Ob and WNIN/GR-Ob rat lenses. The specific activity of ALR2, the rate-limiting enzyme of the polyol pathway, was moderately but consistently higher in the lenses of WNIN/Ob and WNIN/GR-Ob animals from three months of age onwards compared to the respective lean animals (Table 3). However, the activity of SDH, the second enzyme of the polyol pathway, was not altered significantly in obese rats (data not shown). Yet there was a remarkable increase in sorbitol, the product of ALR2, in the lenses of the WNIN/Ob and WNIN/GR-Ob rats when compared to respective lean animals from three months of age onwards (Figure 4). The increase in sorbitol levels was greater in the WNIN/GR-Ob rats compared to the WNIN/Ob rats for the corresponding age groups, and the increase was higher in older animals (Figure 4). This further indicates a synergistic effect of IGT along with obesity on the activation of the sorbitol pathway. Increased levels of sorbitol were consistent with the increased bodyweight as sorbitol levels were highly correlated with bodyweight with a correlation coefficient of 0.958 (p<0.001; Figure 5). This suggests that BMI (overweight or obesity) has a direct influence on sorbitol levels.
For a moderate increase in ALR2 activity, the increase in sorbitol levels was substantial in the WNIN/Ob lenses and more so in the WNIN/GR-Ob rat lenses. Therefore, we then determined the expression of ALR2 in the lens with immunodetection using ALR2-specific polyclonal antibodies . The data indicate ALR2 expression was higher in the lenses of WNIN/Ob and WNIN/GR-Ob rats compared to lean animals (Figure 6). The increase in transcript levels (analyzed with real-time polymerase chain reaction) also supports the western data (data not shown).
Apart from the major biochemical pathways, chaperone-like activity (CLA) of α-crystallin was also assessed, as the CLA of α-crystallin has been shown to play a critical role in maintaining lens transparency, and loss of CLA of α-crystallin was observed in many types of cataract . However, there was no significant difference in the CLA of α-crystallin in the three- to 12-month-old WNIN/Ob and WNIN/GR-Ob eye lenses compared to their respective age-matched lean controls (data not shown).
These results indicate that under normal conditions all principal lens pathways except the polyol pathway remained unaltered in these mutant rats. The higher levels of sorbitol in the lenses of the WNIN/Ob and WNIN/GR-Ob rats could be attributed to increased specific activity as well as increased expression of ALR2. Further, there were moderately higher plasma glucose levels in the WNIN/Ob and WNIN/GR-Ob rats (Figure 7). Probably these three factors (chronic high glucose, increased activity, and expression of ALR2) together might have contributed to substantially high sorbitol levels in the lenses of the WNIN/Ob and WNIN/GR-Ob rats. Studies indicate a metabolic connection between the polyol pathway and oxidative stress [29,34,44]. Therefore, activation of the polyol pathway may lead to increased oxidative stress as indicated by higher protein carbonyls and altered activities of antioxidant enzymes in the eye lenses of the WNIN/Ob rats and more so in the WNIN/GR-Ob rats. These results suggest that increased sorbitol might be a predisposing factor for the higher incidence of cataract in WNIN/Ob and WNIN/GR-Ob rats.
A previous study reported increased sorbitol pathway activity in the sciatic nerve of the leptin-deficient ob/ob mouse with mild hyperglycemia that developed peripheral diabetic neuropathy (PDN) at 11 weeks . Interestingly, administration of fidarestat, an ALR2 inhibitor, to ob/ob mice for six weeks was associated with alleviation of PDN pathogenic features , suggesting the involvement of sorbitol in PDN associated with obesity.
Another study also demonstrated that prediabetic neuropathy in mice fed a high-fat diet could be alleviated by a dietary intervention or a combination of a dietary intervention and pharmacological treatment with an ALR2 inhibitor , corroborating the role of sorbitol in the development of obesity associated complications. Increased accumulation of sorbitol in the retina has been implicated in the pathogenesis of diabetic retinopathy . Rajala et al. examined insulin receptor (IR) signaling in the sorbitol-treated retina under ex vivo conditions and showed that sorbitol activates the IR and IGF-1R tyrosine kinases, which results in activation of the receptor's direct downstream targets . Recently we reported a threefold increase in sorbitol levels in the eye lens (without cataract) in the neonatal streptozotocin rat model with prolonged IGT and insulin resistance . All these studies support a preponderance of sorbitol accumulation and cataract in WNIN/GR-Ob rats (with IGT) over WNIN/Ob rats.
However, it is an enigma why only 15%–20% obese animals in the WNIN/Ob and WNIN/GR-Ob colony develop cataracts if accumulation of sorbitol is the cause of cataract formation in these strains. Sorbitol levels could reach or cross a threshold level to develop cataracts. To substantiate this assumption, we estimated sorbitol levels in the cataractous lenses of WNIN/Ob and WNIN/GR-Ob rats at random. Sorbitol levels in the cataractous lens of four- to six-month-old WNIN/Ob and WNIN/GR-Ob rats were between 650 and 750 nmoles/g lens (mean 680 nmoles; n=10), just above the levels (650 nmoles) as seen in 12-month-old WNIN/Ob and WNIN/GR-Ob rats (Figure 2). This indicates that sorbitol levels above 650 nmoles may result in cataracts in these animals. Any factor (such as fluctuations in glucose levels, ALR2 activity, or ALR2 expression) that abets or incites reaching this threshold level for sorbitol could precipitate cataract formation. Increased susceptibility of WNIN/Ob and WNIN/GR-Ob rats to galactose- and streptozotocin-induced cataract compared to lean rats (P.Y.R., N.V.G., and G.B.R. unpublished data) further supports early onset and higher incidence of cataracts in WNIN/Ob and WNIN/GR-Ob rats. Although factors other than the increased intracellular glucose concentrations that cause sorbitol accumulation need to be identified, these findings are in line with similar observations made previously in models of nondiabetic conditions and aging [49,50]. However, since the nature of the genetic lesion in these rats at present is unknown (work in progress), it is not possible to directly attribute any pathological process to this metabolic phenotype. It could be even independently related to the genotype.
In summary, the results indicate that activation of the sorbitol pathway appears to enhance the risk of cataract development in WNIN-obese rats. These rat models of metabolic syndrome may thus be valuable tools for investigating obesity-associated cataract and for developing intervention strategies based on these observations. The data presented here also imply that there might be a connection between increased sorbitol levels and complications associated with obesity (or metabolic syndrome), which needs to be investigated further.
The authors acknowledge Ms. M. Satyavani, Mr. N. Yadagiri, and Mr. E. Ganesh from National Center for Laboratory Animal Sciences for their help in breeding and maintenance of rats. The authors thank Dr. N. Balakrishna, National Institute of Nutrition for his help in statistical analysis. This work was supported by grants from Indian Council of Medical Research and Department of Biotechnology, Government of India.
Harding J. In Cataract: biochemistry, epidemiology, and pharmacology.1st ed. London: Chapman and Hall; 1991.
Girdharan NV, Harishankar N, Satyavani M. A new rat model for the study of obesity. Scand J Lab Anim Sci. 1996; 23:131-7.
Rajala RVS, Ivanovic I, Dilly AK. Retinal insulin receptor signaling in hyperosmotic stress. In Vitamins and Hormones. 80: 583–612, Academic Press, Burlington, 2009.


text:
<?xml version='1.0' encoding='utf-8'?>
<resources>
    <string name="app_name">WebODF</string>
    <string name="report_issue">Report issue</string>
    <string name="visit_website">Visit website</string>
    <string name="about">About</string>
</resources>


text:
Help Centers
Full Width Normal Width
Broadcast 2.2 Release Notes
Sign Into Broadcast
Set up Displays
Display Layouts
Launch Displays
CURRENT (v. 63) Jan 17, 2017 13:06 Amy Scott
v. 62 Sep 07, 2016 15:01 James Clyburn
v. 61 Aug 11, 2016 10:08 James Clyburn
v. 60 Jul 21, 2016 11:04 James Clyburn
v. 55 Jun 24, 2016 14:54 James Clyburn block moved
v. 54 Jun 24, 2016 14:53 James Clyburn
v. 53 Jun 24, 2016 14:53 James Clyburn column removed
v. 51 Jun 23, 2016 21:54 James Clyburn Migrated Zen Sections to Theme Press Blocks
v. 50 Jun 23, 2016 21:54 James Clyburn Removed zen-master macros
v. 49 Jun 23, 2016 21:54 James Clyburn Migrated macro wrap to html-wrap
v. 48 Dec 08, 2015 10:10 Amy Scott
v. 47 Oct 29, 2015 10:01 Amy Scott
v. 46 Sep 28, 2015 09:54 Amy Scott
v. 45 Jun 17, 2015 17:01 Barbara Green
v. 44 Apr 01, 2015 15:25 Amy Scott
v. 42 Feb 05, 2015 14:08 Amy Scott
v. 41 Jan 23, 2015 12:21 Amy Scott
v. 38 Oct 16, 2014 09:42 Barbara Green fixed zen sections and css for positioning
v. 37 Oct 03, 2014 16:17 Barbara Green adjusted spacing
v. 36 Sep 26, 2014 11:07 Barbara Green add support number
v. 35 Sep 26, 2014 11:05 Barbara Green removed 2.0
v. 34 Sep 26, 2014 11:01 Barbara Green Added version
v. 33 Aug 26, 2014 10:29 Amy Scott
v. 31 Jul 31, 2014 14:53 Barbara Green
v. 30 Jul 29, 2014 12:35 Amy Scott
v. 23 Jul 29, 2014 10:54 Kaitlyn Snook Changed banner text margins to be consistent with other spaces
v. 15 Jun 27, 2014 16:07 Amy Scott
v. 13 Jun 27, 2014 15:54 Amy Scott Added signup link
v. 12 Jan 24, 2014 15:16 Mark Thompson
v. 9 Jan 24, 2014 15:14 Mark Thompson
v. 8 Jan 24, 2014 12:17 Barbara Green
v. 2 Jan 23, 2014 23:12 Mark Thompson First published version
{"serverDuration": 156, "requestCorrelationId": "216047acc0d9673a"}