var CheckoutHtml = '';
var Width = 640; 
var Height = 480;

function Back(){
	window.location = "http://www.art-seekers.com"
}

function StrTrim(Txt){
	var LenTxt = Txt.length;
	if (LenTxt < 1) return "";
	var StartAt = 0;
	while (StartAt < LenTxt){
		if (Txt.charCodeAt(StartAt) < 33){
			StartAt = StartAt +1;
		} else {
			break;
		}
	}
	var Len = LenTxt - StartAt;
	while (Len){
		if (Txt.charCodeAt(StartAt+Len-1) < 33){
			Len = Len - 1;
		} else {
			break;
		}
	}
	if (Len > 0){
		return Txt.substr(StartAt,Len);
	} else {
		return "";
	}
}

function SetBtnName(Name){
	TheForm.BtnName.value = Name;
	return true;
}

function ValidateData(){
	//alert("Error");
	var msg = '';
	var No = 1;
	var Bm = '';
	var crlf = "<br/>";//String.fromCharCode(13,10);
	if (StrTrim(TheForm.Name.value) == ''){
		msg = msg + No + ") Please input your name" + crlf;No = No + 1;
		if (Bm == '') Bm = 'BmName';
	}
	if (StrTrim(TheForm.From.value) == ''){
		msg = msg + No + ") Please input your Email address" + crlf;No = No + 1;
		if (Bm == '') Bm = 'BmFrom';
	}
	if (StrTrim(TheForm.ToFriend.value) == ''){
		msg = msg + No + ") Please input your friend Email address" + crlf;No = No + 1;
		if (Bm == '') Bm = 'BmToFriend';
	}
	if (StrTrim(TheForm.Content.value) == ''){
		msg = msg + No + ") Please input a message" + crlf;No = No + 1;
		if (Bm == '') Bm = 'BmContent';
	}
	if (msg == ''){
		return true;
	} else {
		if (Bm != '') location.hash = Bm;
		msg = "Unable to send your email. Please check the following input information and try again." + crlf + crlf + msg;
		msg = "<html><head><title>Please check the following fields and try again.</title></head><body><font face='Verdana' size='4'>" + msg + crlf + crlf + "After updating please click on the <b>Send</b> button.</font>" + crlf + '<p align="center"><table><tr><td><a href="blank.htm" onclick="window.close()"><img border="0" src="images/btnclose.gif"  lowsrc="/images/blank.gif" alt="Close this window"  value="Close this window" width="120" height="31" /></a></td></tr></table></p><br/>' + "</body></html>";
		var Param = "height="
		+ Height
		+ ",status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes";
		var InfoWnd = window.open("blank.htm",null,Param);
		InfoWnd.document.write(msg);
		InfoWnd.focus();
		return false;
	}
}
