var scrollTop; 
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler);
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);     
function BeginRequestHandler(sender, args) {
	var m = document.getElementById('DivData');
	if (m != null) {
		scrollTop = m.scrollTop;
	}
}      
function EndRequestHandler(sender, args) {
	var m = document.getElementById('DivData');
	if (m != null) {
		m.scrollTop = scrollTop;
	}
}      
var scrollTopDevice;      
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandlerDevice);
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandlerDevice);  
function BeginRequestHandlerDevice(sender, args) {
	var m = document.getElementById('DivDataDevice');
	if (m != null) {
		scrollTopDevice = m.scrollTop;
	}
}      
function EndRequestHandlerDevice(sender, args) {
	var m = document.getElementById('DivDataDevice');
	if (m != null) {
		m.scrollTop = scrollTopDevice;
	}
}    
popwindow = null;
function OpenDialogue() {
	document.getElementById('filediag').click();
	var test = document.getElementById('filediag').value;
}
function EditDevice(strID, strDID, strVType, strkVal) {
	var w = 600;
	var h = 400;
	var left = (screen.width / 2) - (w / 2);
	var top = (screen.height / 2) - (h / 2);
	if (popwindow == null) {                
		popwindow = window.open('PopUps.aspx?ConfigurationID=' + strID + "&DeviceID=" + strDID + "&VType=" + strVType + "&kVal=" + strkVal + "&ConfigLevelId=" + LevelId, '', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
	}
	else {
		popwindow.close();             
		popwindow = window.open('PopUps.aspx?ConfigurationID=' + strID + "&DeviceID=" + strDID + "&VType=" + strVType + "&kVal=" + strkVal + "&ConfigLevelId=" + LevelId, '', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
	}
}
function EditVal(strID, strVType, strkVal, LevelId) {
	var w = 570;
	var h = 400;
	var left = (screen.width / 2) - (w / 2);
	var top = (screen.height / 2) - (h / 2);
	if (popwindow == null) {
		popwindow = window.open('PopUps.aspx?ConfigurationID=' + strID + "&VType=" + strVType + "&kVal=" + strkVal + "&ConfigLevelId=" + LevelId + '&acts=spec', '', 'location=middle, resizable=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left,'_blank')
	}
	else {
		popwindow.close();
		popwindow = window.open('PopUps.aspx?ConfigurationID=' + strID + "&VType=" + strVType + "&kVal=" + strkVal + "&ConfigLevelId=" + LevelId + '&acts=spec', '', 'location=middle, resizable=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left,'_blank')
	}
}
function GetValueFromChild() {
	location.reload(true);
}