/*(c) Mindshelf 2010 All Rights Reserved.Web Framework- Core FunctionsNo unauthorised copying or editing without permissionAuthor ~ Matt Hallam*/$('.righthandcontent .pagebody input[type="checkbox"]:eq(0)').ready(function(){$('.righthandcontent .pagebody input[type="checkbox"]:eq(0)').click(function(){if($('.righthandcontent .pagebody input[type="checkbox"]:eq(0)').is(':checked')){$('.righthandcontent .pagebody input[type="text"]:eq(8)').val($('.righthandcontent .pagebody input[type="text"]:eq(4)').val());$('.righthandcontent .pagebody input[type="text"]:eq(9)').val($('.righthandcontent .pagebody input[type="text"]:eq(5)').val());$('.righthandcontent .pagebody input[type="text"]:eq(10)').val($('.righthandcontent .pagebody input[type="text"]:eq(6)').val());$('.righthandcontent .pagebody input[type="text"]:eq(11)').val($('.righthandcontent .pagebody input[type="text"]:eq(7)').val());}else{$('.righthandcontent .pagebody input[type="text"]:eq(8)').val('');$('.righthandcontent .pagebody input[type="text"]:eq(9)').val('');$('.righthandcontent .pagebody input[type="text"]:eq(10)').val('');$('.righthandcontent .pagebody input[type="text"]:eq(11)').val('');}});});function submitform(b){err=false;f=new Array;window['f']['case']="R";if($('div.contactform input[type="text"]:eq(0)').val()==''){$('div.contactform input[type="text"]:eq(0)').closest('tr').addClass('err');err=true;}else{$('div.contactform input[type="text"]:eq(0)').closest('tr').removeClass('err');window['f']['first-name']=$('div.contactform input[type="text"]:eq(0)').val();};if($('div.contactform input[type="text"]:eq(1)').val()==''){$('div.contactform input[type="text"]:eq(1)').closest('tr').addClass('err');err=true;}else{$('div.contactform input[type="text"]:eq(1)').closest('tr').removeClass('err');window['f']['surname']=$('div.contactform input[type="text"]:eq(1)').val();};if(!window['emfilt'].test($('div.contactform input[type="text"]:eq(2)').val())){$('div.contactform input[type="text"]:eq(2)').closest('tr').addClass('err');err=true;}else{$('div.contactform input[type="text"]:eq(2)').closest('tr').removeClass('err');window['f']['email-address']=$('div.contactform input[type="text"]:eq(2)').val();};window['f']['telephone-number']=$('div.contactform input[type="text"]:eq(3)').val();if($('div.contactform input[type="text"]:eq(4)').val()==''){$('div.contactform input[type="text"]:eq(4)').closest('tr').addClass('err');err=true;}else{$('div.contactform input[type="text"]:eq(4)').closest('tr').removeClass('err');window['f']['property-address-line-1']=$('div.contactform input[type="text"]:eq(4)').val();};if($('div.contactform input[type="text"]:eq(5)').val()==''){$('div.contactform input[type="text"]:eq(5)').closest('tr').addClass('err');err=true;}else{$('div.contactform input[type="text"]:eq(5)').closest('tr').removeClass('err');window['f']['property-address-line-2']=$('div.contactform input[type="text"]:eq(5)').val();};if($('div.contactform input[type="text"]:eq(6)').val()==''){$('div.contactform input[type="text"]:eq(6)').closest('tr').addClass('err');err=true;}else{$('div.contactform input[type="text"]:eq(6)').closest('tr').removeClass('err');window['f']['property-city']=$('div.contactform input[type="text"]:eq(6)').val();};if($('div.contactform input[type="text"]:eq(7)').val()==''){$('div.contactform input[type="text"]:eq(7)').closest('tr').addClass('err');err=true;}else{$('div.contactform input[type="text"]:eq(7)').closest('tr').removeClass('err');window['f']['property-postcode']=$('div.contactform input[type="text"]:eq(7)').val();};window['f']['your-address']='|';if($('div.contactform input[type="checkbox"]:eq(0)').is(':checked')){window['f']['your-address']+=stripHTML($('div.contactform input[type="checkbox"]:eq(0)').closest('label').html())+'|';};window['f']['address-line-1']=$('div.contactform input[type="text"]:eq(8)').val();window['f']['address-line-2']=$('div.contactform input[type="text"]:eq(9)').val();window['f']['address-city']=$('div.contactform input[type="text"]:eq(10)').val();window['f']['address-postcode']=$('div.contactform input[type="text"]:eq(11)').val();if($('div.contactform select:eq(0)').val()==''){$('div.contactform select:eq(0)').closest('tr').addClass('err');err=true;}else{$('div.contactform select:eq(0)').closest('tr').removeClass('err');window['f']['looking-to-rent-out-in']=$('div.contactform select:eq(0)').val();};if($('div.contactform select:eq(1)').val()==''){$('div.contactform select:eq(1)').closest('tr').addClass('err');err=true;}else{$('div.contactform select:eq(1)').closest('tr').removeClass('err');window['f']['preferred-contact-method']=$('div.contactform select:eq(1)').val();};window['f']['nid']=(($('div.contactform input[type="checkbox"]:eq(1)').is(':checked'))?'1':'0');if(err){alert('Please check the highlighted fields and try again.');}else{_prc();$.post('../../../../_rsc/validate.mindshelf',{a:$('input.contact').val(),b:$('input[name="subject"]').val()},function(data){if(data=='_tp_pass'){$.post('../../../../_rsc/form.mindshelf',{c:serialize(window['f']),b:b},function(data){d=data.split('|HOAMZ_DATA|');if(d[0]=='_tp_pass'){_prc(true);if($('#nyroModalContent').length>0){$.nyroModalManual({content:'<strong style="color:#009900;">Your enquiry was successfully sent. Thank you for your interest, a member of the team will be in touch.</strong>',endShowContent:function(){setTimeout('$.nyroModalRemove();',3000);}});}else{$('.contactform').html('<p><strong style="color:#009900;">Your enquiry was successfully sent. Thank you for your interest, a member of the team will be in touch.</strong></p>');fixPanel();};$(document).scrollTo('#contact',100);}else if(d[0]=='confirm'){_prc(true);if(window.confirm(d[1]))eval(d[2]);}else{_prc(true);alert(data);_rci();}},'html');}else{_prc(true);alert('Please check the details you\'ve entered and try again.');_rci();}},'html');};return false;};