function FrameBuilder (formId, initialHeight, iframeCode){ this.formId = formId, this.initialHeight = initialHeight, this.iframeCode = iframeCode, this.frame = null, this.timeInterval= 200, // initialize function for object this.init = function(){ this.createFrame(); this.addFrameContent(this.iframeCode); }, // Create the frame this.createFrame = function(){ var htmlCode = "" document.write(htmlCode); // also get the frame for future use. this.frame = document.getElementById(this.formId); // set the time on the on load event of the frame this.addEvent (this.frame, 'load', this.bindMethod(this.setTimer, this)); }, // add event function for different browsers this.addEvent = function( obj, type, fn ) { if ( obj.attachEvent ) { obj["e"+type+fn] = fn; obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }; obj.attachEvent( "on"+type, obj[type+fn] ); } else{ obj.addEventListener( type, fn, false ); } }, this.addFrameContent = function (string){ string = string.replace(new RegExp('src\=\"[^"]*captcha.php\"><\/scr'+'ipt>', 'gim'), 'src="http://api.recaptcha.net/js/recaptcha_ajax.js">
'+ ''+ ' window.onload = function(){ Recaptcha.create("6Ld9UAgAAAAAAMon8zjt30tEZiGQZ4IIuWXLt1ky", "recaptcha_div", {theme: "clean",tabindex: 0,callback: function (){'+ 'if (document.getElementById("uword")) { document.getElementById("uword").parentNode.removeChild(document.getElementById("uword")); } if (window["validate"] !== undefined) { if (document.getElementById("recaptcha_response_field")){ document.getElementById("recaptcha_response_field").onblur = function(){ validate(document.getElementById("recaptcha_response_field"), "Required"); } } } if (document.getElementById("recaptcha_response_field")){ document.getElementsByName("recaptcha_challenge_field")[0].setAttribute("name", "anum"); } if (document.getElementById("recaptcha_response_field")){ document.getElementsByName("recaptcha_response_field")[0].setAttribute("name", "qCap"); }}})'+ ' }'); string = string.replace(/(type="text\/javascript">)\s+(validate\(\"[^"]*"\);)/, '$1 jTime = setInterval(function(){if("validate" in window){$2clearTimeout(jTime);}}, 10);'); var frameDocument = (this.frame.contentWindow) ? this.frame.contentWindow : (this.frame.contentDocument.document) ? this.frame.contentDocument.document : this.frame.contentDocument; frameDocument.document.open(); frameDocument.document.write(string); setTimeout( function(){frameDocument.document.close();},200); }, this.setTimer = function(){ var self = this; this.interval = setTimeout(function(){self.changeHeight();},this.timeInterval); }, this.changeHeight = function (){ var actualHeight = this.getBodyHeight(); var currentHeight = this.getViewPortHeight(); if (Math.abs(actualHeight - currentHeight) > 18){ this.frame.style.height = (actualHeight)+"px"; } this.setTimer(); }, this.bindMethod = function(method, scope) { return function() { method.apply(scope,arguments); }; }, this.getBodyHeight = function (){ var height; var scrollHeight; var offsetHeight; if (this.frame.contentWindow.document.height){ height = this.frame.contentWindow.document.height; } else if (this.frame.contentWindow.document.body){ if (this.frame.contentWindow.document.body.scrollHeight){ height = scrollHeight = this.frame.contentWindow.document.body.scrollHeight; } if (this.frame.contentWindow.document.body.offsetHeight){ height = offsetHeight = this.frame.contentWindow.document.body.offsetHeight; } if (scrollHeight && offsetHeight){ height = Math.max(scrollHeight, offsetHeight); } } return height; }, this.getViewPortHeight = function(){ var height = 0; if (this.frame.contentWindow.window.innerHeight) { height = this.frame.contentWindow.window.innerHeight - 18; } else if ((this.frame.contentWindow.document.documentElement) && (this.frame.contentWindow.document.documentElement.clientHeight)) { height = this.frame.contentWindow.document.documentElement.clientHeight; } else if ((this.frame.contentWindow.document.body) && (this.frame.contentWindow.document.body.clientHeight)) { height = this.frame.contentWindow.document.body.clientHeight; } return height; }, this.init(); } new FrameBuilder("92935446961","567", "\n\n\nForm<\/title>\n<meta http-equiv=\"content-type\" content=\"text\/html; charset=utf-8\" \/>\n<script src=\"http:\/\/v2.jotform.com\/js\/form.js?v2.0.1407\" type=\"text\/javascript\"><\/script>\n<style type=\"text\/css\">html,body{\nmargin:0;}\n.tbmain{ \n \/* Changes on the form *\/\n background: #D7E9F3 !important; \n}\n.left{\n \/* Changes on the form *\/\n color: #394F5F !important; \n font-family: Tahoma !important;\n font-size: 11px !important;\n}\ntd.left {\n font-family: Tahoma;\n font-size: 11px;\n font-weight:bold;\n color:#394F5F;\n vertical-align: top;\n text-align: left;\n}\n.pagebreak{\n font-family: Tahoma;\n font-size: 11px;\n font-weight:bold;\n color:black;\n}\ntd.right {\n font-family: Tahoma;\n font-size: 11px;\n font-weight: normal;\n color:#394F5F;\n vertical-align: top; \n text-align: left; \n}\n.tbmain{\n height:100%;\n color:#394F5F;\n background: #D7E9F3;\n}\n.head{\n font-family: Tahoma;\n font-size:medium;\n font-weight:bold;\n color:#394F5F;\n vertical-align: top;\n text-align: left;\n}\n.notvalid{\n border:2px red solid;\n font-family:Tahoma;\n}\n.text{\n color:#394F5F;\n font-family: Tahoma;\n font-size: 11px;\n font-weight:normal;\n border:0px;\n background:#ABCADB;\n}\nselect.other{\n color:#394F5F;\n font-family: Tahoma;\n font-size: 11px;\n font-weight:normal;\n border:0px;\n background:#ABCADB;\n}\n.btn{\n color:#ffffff;\n font-family: Tahoma;\n font-size: 11px;\n font-weight:bold;\n border:1px #8aaabc solid;\n background: url(http:\/\/v2.jotform.com\/images\/styles\/style5_btn_bg.gif) #9bbed0 top repeat-x;\n}\nspan.required{\n font-size: 13px !important;\n color: red !important;\n}\n\ndiv.backButton{\n background: transparent url(\"http:\/\/v2.jotform.com\/\/images\/btn_back.gif\") no-repeat scroll 0 0;\n height:16px;\n width:53px;\n float:left;\n margin-bottom:15px;\n padding-right:5px;\n}\ndiv.backButton:hover{\n background: transparent url(\"http:\/\/v2.jotform.com\/\/images\/btn_back_over.gif\") no-repeat scroll 0 0;\n}\ndiv.backButton:active{\n background: transparent url(\"http:\/\/v2.jotform.com\/\/images\/btn_back_down.gif\") no-repeat scroll 0 0;\n}\ndiv.nextButton{\n background: transparent url(\"http:\/\/v2.jotform.com\/\/images\/btn_next.gif\") no-repeat scroll 0 0;\n height:16px;\n width:53px;\n float: left;\n margin-bottom:15px;\n padding-right:5px;\n}\ndiv.nextButton:hover{\n background: transparent url(\"http:\/\/v2.jotform.com\/\/images\/btn_next_over.gif\") no-repeat scroll 0 0;\n}\ndiv.nextButton:active{\n background: transparent url(\"http:\/\/v2.jotform.com\/\/images\/btn_next_down.gif\") no-repeat scroll 0 0;\n}\n.pageinfo{\n padding-right:5px;\n margin-bottom:15px;\n float:left;\n}\n\n<\/style> \n<table width=\"100%\" cellpadding=\"2\" cellspacing=\"0\" class=\"tbmain\">\n<tr><td class=\"topleft\" width=\"10\" height=\"10\"> <\/td>\n<td class=\"topmid\"> <\/td>\n<td class=\"topright\" width=\"10\" height=\"10\"> <\/td>\n <\/tr>\n<tr>\n<td class=\"midleft\" width=\"10\">   <\/td>\n<td class=\"midmid\" valign=\"top\">\n<form accept-charset=\"utf-8\" action=\"http:\/\/v2.jotform.com\/submit.php\" method=\"post\" name=\"q_form_92935446961\">\n<input type=\"hidden\" name=\"formID\" value=\"92935446961\" \/>\n<div id=\"main\"> \n<div class=\"pagebreak\"> \n<table width=\"520\" cellpadding=\"5\" cellspacing=\"0\">\n <tr >\n <td colspan=\"2\" class=\"head\" >\n We'll send you a list of agents in your area that offer HomeFinder GPS\n <\/td>\n <\/tr>\n <tr >\n <td width=\"150\" class=\"left\" >\n <label >First Name: <span class=\"required\">*<\/span><\/label>\n <\/td>\n <td class=\"right\" >\n <input type=\"text\" size=\"20\" name=\"q0_FirstName\" class=\"text\" value=\"\" id=\"q0\" onblur=\"validate(this,'Required')\" maxlength=\"100\" maxsize=\"100\" \/>\n <\/td>\n <\/tr>\n <tr >\n <td width=\"150\" class=\"left\" >\n <label >Last Name: <span class=\"required\">*<\/span><\/label>\n <\/td>\n <td class=\"right\" >\n <input type=\"text\" size=\"20\" name=\"q8_LastName\" class=\"text\" value=\"\" id=\"q8\" onblur=\"validate(this,'Required')\" maxlength=\"100\" maxsize=\"100\" \/>\n <\/td>\n <\/tr>\n <tr >\n <td width=\"150\" class=\"left\" >\n <label >E-mail: <span class=\"required\">*<\/span><\/label>\n <\/td>\n <td class=\"right\" >\n <input type=\"text\" size=\"20\" name=\"q1_Email\" class=\"text\" value=\"\" id=\"q1\" onblur=\"validate(this,'Email')\" maxlength=\"100\" maxsize=\"100\" \/>\n <\/td>\n <\/tr>\n <tr >\n <td width=\"150\" class=\"left\" >\n <label >Home Search State: <span class=\"required\">*<\/span><\/label>\n <\/td>\n <td class=\"right\" >\n <input type=\"text\" size=\"20\" name=\"q11_HomeSearchState\" class=\"text\" value=\"\" id=\"q11\" onblur=\"validate(this,'Required')\" maxlength=\"100\" maxsize=\"100\" \/>\n <\/td>\n <\/tr>\n <tr >\n <td width=\"150\" class=\"left\" >\n <label >Home Search City: <span class=\"required\">*<\/span><\/label>\n <\/td>\n <td class=\"right\" >\n <input type=\"text\" size=\"20\" name=\"q13_HomeSearchCity\" class=\"text\" value=\"\" id=\"q13\" onblur=\"validate(this,'Required')\" maxlength=\"100\" maxsize=\"100\" \/>\n <\/td>\n <\/tr>\n <tr >\n <td width=\"150\" class=\"left\" >\n <label >Price Range:<\/label>\n <\/td>\n <td class=\"right\" >\n <input type=\"text\" size=\"20\" name=\"q15_PriceRange\" class=\"text\" value=\"\" id=\"q15\" maxlength=\"100\" maxsize=\"100\" \/>\n <\/td>\n <\/tr>\n <tr >\n <td width=\"150\" class=\"left\" >\n <label >Are you Currently working with an Agent? Y\/N <span class=\"required\">*<\/span><\/label>\n <\/td>\n <td class=\"right\" >\n <input type=\"text\" size=\"20\" name=\"q19_AreyouCurrentlyworki\" class=\"text\" value=\"\" id=\"q19\" onblur=\"validate(this,'Required')\" maxlength=\"100\" maxsize=\"100\" \/>\n <\/td>\n <\/tr>\n <tr >\n <td width=\"150\" class=\"left\" >\n <label >Phone:<\/label>\n <\/td>\n <td class=\"right\" >\n <input type=\"text\" size=\"20\" name=\"q2_Phone\" class=\"text\" value=\"\" id=\"q2\" maxlength=\"100\" maxsize=\"100\" \/>\n <\/td>\n <\/tr>\n <tr >\n <td width=\"150\" class=\"left\" valign=\"top\" >\n <label>Your Message: <span class=\"required\">*<\/span><\/label>\n <\/td>\n <td class=\"right\" >\n <textarea cols=\"30\" rows=\"5\" name=\"q6_YourMessage\" class=\"text\" id=\"q6\" onblur=\"validate(this,'Required')\" ><\/textarea>\n <\/td>\n <\/tr>\n <tr >\n <td width=\"150\" class=\"left\" > \n \n <\/td>\n <td class=\"right\">\n <input type=\"submit\" class=\"btn\" value=\"Submit\" \/>\n <\/td>\n <\/tr>\n <tr >\n <td colspan=\"2\" class=\"left\" >\n Your data will never be sold or given to an outside company.\n <\/td>\n <\/tr>\n<\/table>\n<\/div>\n<\/div>\n<\/form>\n<\/td>\n<td class=\"midright\" width=\"10\">   <\/td>\n<\/tr>\n<tr>\n <td class=\"bottomleft\" width=\"10\" height=\"10\"> <\/td>\n <td class=\"bottommid\"> <\/td>\n <td class=\"bottomright\" width=\"10\" height=\"10\"> <\/td>\n<\/tr>\n<\/table>\n<script type=\"text\/javascript\">\nvalidate(\"q_form_92935446961\");\n<\/script>\n\n<\/body>\n<\/html>\n");