function getParameter(name) {
	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
	var r;
	if(window.location.href.indexOf('#') > -1){
		var txt = window.location.search + window.location.hash;
		r = txt.substr(1).match(reg); 
	}else{
		r = window.location.search.substr(1).match(reg);
	}
	if(r != null) {
		return decodeURIComponent(r[2]);
	}
	return null;
}
function sendCommand(command) {
	return LvClientWebFunc(clientKey, command);
}
clientKey = getParameter("clientkey");

var imServer = getParameter("imserver");
var lvid = getParameter("lvid");
var sign = getParameter("sign");
var groupName = getParameter("groupname");
var projectName = getParameter("projectname");
var groupId = getParameter("groupid");
var status = getParameter("status");
var projectid = getParameter("projectid");
var projecttype = getParameter("projecttype");
var isnew2d = getParameter("isnew2d");
var groupName;
$(document).ready(function() {
	if(groupId != 0){
		$('.groupid').text('(' +groupId+ ')');
	}else{
		$('.groupid').text('');
	}
	$('.groupName').text(groupName);
	$('.proName').text(projectName);
	var txt = status == 1 ? '转码成功！' : '转码失败，请稍后重试！';
	$('.status').text(txt);

});
$('#button').click(function() {
	var json = {
		'projectname':projectName,
		'transtate':Number(status),
		'projectid':Number(projectid),
		'projecttype':Number(projecttype),
		'isnew2d':Number(isnew2d)
	}
	var params = '{command:1008,params:'+JSON.stringify(json)+'}';
	var resultS = sendCommand(params);
	sendCommand("{command:9001}");
});