$(document).ready(function () {
	if (document.body.scrollHeight < window.screen.height) height = window.screen.height;
	else height = document.body.scrollHeight;
	$('#Warting').css('height', height);
	var reloadAllVertifyCode = function () {
		tmp_date = new Date();
		current_time = tmp_date.getTime();
		$('.VertifyCodeImage').attr('src', '/index.php/imageoutput/VertifyCode/' + current_time);
	};
	var insertHtmlToLoginResult = function(html_data) {
		$('#LoginResult').html(html_data);
		$('#BackWhenError').click(function () {
			reloadAllVertifyCode();
			$('#LoginResult').hide();
			$('#Warting').hide();closeWindow();
		});
		$('#LoginResult').show();
		$('#WaitingImage').hide();
//		$('#Warting').hide();closeWindow();
	};

	/*$('#LoginForm').submit(function () {
		$('#Warting').show();showWindow();
		$('#WaitingImage').show();
		$.post('/index.php/memberpanel/login', $(this).formToArray(), insertHtmlToLoginResult);
		return false;
	});*/
});

function CtoH(str,tagid)
{ 
  var result=""; 
  for (var i = 0; i < str.length; i++) 
  { 
  	if (str.charCodeAt(i)==12288) 
	{ 
		result+= String.fromCharCode(str.charCodeAt(i)-12256); 
		continue; 
	} 
	if (str.charCodeAt(i)>65280 && str.charCodeAt(i)<65375)
	 result+= String.fromCharCode(str.charCodeAt(i)-65248); 
	 else result+= String.fromCharCode(str.charCodeAt(i)); 
   } 
   $("#"+tagid).val(result);
   return false;
}