// JavaScript Document
var ui={};
Ajax.Responders.register(
  {
    onComplete:function(request,transport,json){ }
  }
);

function kching_submit() {
  if ((Field.getValue('kching_fname')==null) || (Field.getValue('kching_fname')=="")){
	Dialog.alert("Please enter your first name.", {width:300, height:100, okLabel: "close", ok:function(win) {Field.activate('kching_fname');return true;}});
	return false
  }
  if ((Field.getValue('kching_email')==null) || (Field.getValue('kching_email')=="") || (echeck(Field.getValue('kching_email'))==false)){
	Dialog.alert("Please enter your valid email address.", {width:300, height:100, okLabel: "close", ok:function(win) {Field.activate('kching_email');return true;}});
    return false
  }
  var win = new Window({className: "dialog",  width:400, height:320, zIndex: 100, resizable: false, title: "Thank You!", showEffect:Effect.BlindDown, hideEffect: Effect.SwitchOff, draggable:true, wiredDrag: true});
  win.setAjaxContent("/cgi/kching_submit.php?"+Form.serialize("kching"), {}, true, true)
}
