function vst_enq_validateForm()
{$("#vst_enq_comments").each(function(){var fieldValue=$(this).val();var fieldTitle=$(this).attr("rel");if(fieldValue==fieldTitle){$(this).val("");}});var firstname=$("#vst_enq_firstname").val();var lastname=$("#vst_enq_lastname").val();var contact_tel=$("#vst_enq_contact_tel").val();var email=$("#vst_enq_email").val();var message=$("#vst_enq_comments").val();var errors=0;var errorList='<ul class="reddot">\n';if(firstname==null||firstname=='')
{var firstnameMsg="Please enter your first name";$("#vst_enq_firstname").addClass("error");var errorList=errorList+"<li>"+firstnameMsg+"</li>\n";errors++;}else{$("#vst_enq_firstname").removeClass("error");}
if(lastname==null||lastname=='')
{var lastnameMsg="Please enter your surname"
$("#vst_enq_lastname").addClass("error");var errorList=errorList+"<li>"+lastnameMsg+"</li>\n";errors++;}else{$("#vst_enq_lastname").removeClass("error");}
if(contact_tel==null||contact_tel=='')
{var contact_telMsg="Please enter your contact number"
$("#vst_enq_contact_tel").addClass("error");var errorList=errorList+"<li>"+contact_telMsg+"</li>\n";errors++;}else{$("#vst_enq_contact_tel").removeClass("error");}
if(email==null||email=='')
{var emailMsg="Please enter your email address";$("#vst_enq_email").addClass("error");var errorList=errorList+"<li>"+emailMsg+"</li>\n";errors++;}else{$("#vst_enq_email").removeClass("error");}
if(message==null||message==''||message=='')
{var messageMsg="Please enter a message to send us!"
$("#vst_enq_comments").addClass("error");var errorList=errorList+"<li>"+messageMsg+"</li>\n";errors++;}else{$("#vst_enq_comments").removeClass("error");}
var errorList=errorList+"</ul>";if(errors==1)
{jAlert("<p>There is an error in the form:</p>"+errorList+"<p>Please correct and try again</p>","Oops!");return false;}else if(errors>1){jAlert("<p>There are errors in the form:</p>"+errorList+"<p>Please correct and try again</p>","Oops!");return false;}}
$("#vst_enq textarea").each(function(){$(this).val($(this).attr("rel"));});$("#vst_enq_comments").bind("focus",function(){var fieldValue=$(this).val();var fieldTitle=$(this).attr("rel");if(fieldValue==fieldTitle){$(this).val("");}});$("#vst_enq_comments").bind("blur",function(){var fieldValue=$(this).val();var fieldTitle=$(this).attr("rel");if(fieldValue==""){$(this).val(fieldTitle);}});function vst_enq_showResponse(responseText,statusText){jAlert(responseText,"myVIVA Vendor Services");$("#vst_enq .inputbox").val("");$("#vst_enq input:checkbox").attr('checked',false);}
$(document).ready(function(){$("form .tooltip").each(function(){$(this).after('<img align="top" class="info" src="/media/images/icons/form_info.gif" alt="Information" width="13" height="13" />');});var options={type:'post',beforeSubmit:vst_enq_validateForm,url:'/index.php?load=datacapture',success:vst_enq_showResponse};$('#vst_enq').append('<input type="hidden" name="ajax" />');$('#vst_enq').ajaxForm(options);$('#vst_enq *[title]').qtip({show:{solo:false,delay:150,effect:{type:'fade',length:430}},content:{text:false},style:{color:'#ffffff',background:'#D1234B',border:{color:'#D1234B',width:1,radius:3},name:'red'},position:{corner:{target:'bottomMiddle',tooltip:'topMiddle'}}});});