dcregister.support.SetLink("mailto:"+Product.GetSupportEmail());
dcregister.support.SetText(Product.GetSupportEmail());
dcregister.oneurl.buyurl.SetLink(Product.GetBuyUrl());
dcregister.oneurl.buyurl.SetText(Product.GetProductName());

if(Product.IsValidateReg())
{
	dcregister.unreglabel.SetText("_static_regok");
	dcregister.unregtip.SetText("_static_thank");
	dcmain.title001.SetText("_main_title");
}
else
{
	dcmain.title001.SetText("_main_title_unreg");
}

function dcregister_RegCodeChange(args)
{
	var str = args[2];

	if(str.length > 0)
	{
		dcregister.regok.SetEnable(true);
	}
	else
	{
		dcregister.regok.SetEnable(false);
	}
	
	return 1;
}

function OnReg(args)
{
	var strname = dcregister.regname.GetText();
	var strcode = dcregister.regcode.GetText();
	var strseial = "";
	
	if (strcode.length <= 0)
	{
		return 1;
	}
	
	Product.SaveRegInfo(strname,strseial,strcode);
	
	if(Product.IsValidateReg())
	{
		dcmain.title001.SetText("_main_title");
		ShowMsg(LanguageStr("_product_name"), LanguageStr("_msg_regok"), 1, "_btn_ok");
		dcregister.Close();
	  
		dcregister.unreglabel.SetText("_static_regok");
		dcregister.unregtip.SetText("_static_thank");

		var reginfo = Product.GetRegInfo();
		dcabout.registerstatus.SetText("_status_havereg");
		dcabout.registername.SetText(reginfo[0]);
	}
	else
	{
		dcmain.title001.SetText("_main_title_unreg");
		ShowMsg(LanguageStr("_product_name"), LanguageStr("_msg_regfail"), 1, "_btn_ok");
	}
	
	return 1;
}


initreg();
changelang();