/*jslint nomen:false, debug:true, evil:true, vars:false, browser:true, forin:true, undef:false, white:false */ /** * Includes a Form with javascript * @param {Object} formId * @param {Object} initialHeight * @param {Object} iframeCode */ function FrameBuilder (formId, appendTo, initialHeight, iframeCode){ this.formId = formId; this.initialHeight = initialHeight; this.iframeCode = iframeCode; this.frame = null; this.timeInterval= 200; this.appendTo = appendTo || false; this.formSubmitted = 0; // initialize function for object this.init = function(){ this.createFrame(); this.addFrameContent(this.iframeCode); }; // Create the frame // Create the frame this.createFrame = function(){ var tmp_is_ie = !!window.ActiveXObject; //IE detection var htmlCode = "<"+"iframe src=\"\" allowtransparency=\"true\" frameborder=\"0\" name=\""+this.formId+"\" id=\""+this.formId+"\" style=\"width:100%; height:"+this.initialHeight+"px; border:none;\" scrolling=\"no\">"; if(this.appendTo === false){ document.write(htmlCode); }else{ var tmp = document.createElement('div'); tmp.innerHTML = htmlCode; var a = this.appendTo; document.getElementById(a).appendChild(tmp.firstChild); //var form = document.getElementById() } // also get the frame for future use. this.frame = document.getElementById(this.formId); //correct fix to IE security bugfix if(tmp_is_ie === true){ try { //check for security bug ahead! If bug occurs then parent frame's document.domain was set, if it does not then do not apply fix!!! var tmptmptmp = (this.frame.contentWindow) ? this.frame.contentWindow : (this.frame.contentDocument.document) ? this.frame.contentDocument.document : this.frame.contentDocument; tmptmptmp.document.open(); tmptmptmp.document.write(""); } catch (err) { this.frame.src= "javascript:void((function(){document.open();document.domain=\'"+ window.location.hostname.replace('www.', '')+"\';document.close();})())"; } } // set the time on the on load event of the frame this.addEvent(this.frame, 'load', this.bindMethod(this.setTimer, this)); var self = this; //on chrome to suppress unsafe attempt error this codes break setHeight-time interval loop if(window.chrome!==undefined){ this.frame.onload = function(){ try{ var doc = this.contentWindow.document; var _jotform = this.contentWindow.JotForm; if(doc!==undefined){ var form = doc.getElementById(""+self.formId); self.addEvent(form, "submit", function(){ if(_jotform.validateAll()){ self.formSubmitted=1; } }); } } catch(e){ } } } }; // 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"><'+'div id="recaptcha_div"><'+'/div>'+ '<'+'style>#recaptcha_logo{ display:none;} #recaptcha_tagline{display:none;} #recaptcha_table{border:none !important;} .recaptchatable .recaptcha_image_cell, #recaptcha_table{ background-color:transparent !important; } <'+'/style>'+ '<'+'script defer="defer"> 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"); }}})'+ ' }<'+'/script>'); string = string.replace(/(type="text\/javascript">)\s+(validate\(\"[^"]*"\);)/, '$1 jTime = setInterval(function(){if("validate" in window){$2clearTimeout(jTime);}}, 1000);'); 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(); try{ if('JotFormFrameLoaded' in window){ JotFormFrameLoaded(); } }catch(e){} },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(actualHeight === undefined){ this.frame.style.height = "100%"; if(!this.frame.style.minHeight){ this.frame.style.minHeight = "300px"; } }else 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 (){ if(this.formSubmitted===1){ return; } var height; var scrollHeight; var offsetHeight; try{ // Prevent IE from throw errors if (this.frame.contentWindow.document.height){ height = this.frame.contentWindow.document.height; //Emre: to prevent "iframe height" problem (61059) 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; } } 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); } } }catch(e){ } return height; }; this.getViewPortHeight = function(){ if(this.formSubmitted===1){ return; } var height = 0; try{ // Prevent IE from throw errors 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; } }catch(e){ } return height; }; this.init(); } FrameBuilder.get = []; var i23463562342350 = new FrameBuilder("23463562342350", false, "", "\n\n\n\n\nForm<\/title>\n<link href=\"http:\/\/cdn.jotfor.ms\/static\/formCss.css?3.1.22\" rel=\"stylesheet\" type=\"text\/css\" \/>\n<link type=\"text\/css\" media=\"print\" rel=\"stylesheet\" href=\"http:\/\/cdn.jotfor.ms\/css\/printForm.css?3.1.22\" \/>\n<style type=\"text\/css\">\n .form-label{\n width:150px !important;\n }\n .form-label-left{\n width:150px !important;\n }\n .form-line{\n padding-top:5px;\n padding-bottom:5px;\n }\n .form-label-right{\n width:150px !important;\n }\n body, html{\n margin:0;\n padding:0;\n background:#FFFFFF;\n }\n\n .form-all{\n margin:0px auto;\n padding-top:20px;\n width:600px;\n background:#FFFFFF;\n color:#000000 !important;\n font-family:'Verdana';\n font-size:12px;\n }\n \/* Injected CSS Code *\/\n\/*--move button--*\/\n#id_8{\nmargin-left:26px !important;\nmargin-top:18px !important;\npadding:0px !important;\n}\n\/*--fix name, email,website margin left--*\/\n#id_1, #id_3,#id_6{\nmargin-left:15px;\n}\/*--border bottom--*\/\n#id_7{\npadding:0px !important;\n}\n.form-html{\npadding:0px !important;}\np.borderbottom{\nbackground: url(http:\/\/cms.interlogy.com\/uploads\/image_upload\/image_upload\/global\/6156_form_bottom.gif) no-repeat 0 100%;\npadding: 0 29px 20px 25px;\nmargin: 0;\nwidth:600px;\n}\n\/*--position textarea---*\/\n#id_5{\nposition: absolute;\ntop: 0px;\nleft: 290px;\n}\/*---rounded corners---*\/\n.form-all input,.form-all select,.form-all textarea {\nborder: 1px solid #b7bbbd;\n-webkit-border-radius: 5px;\n-moz-border-radius: 5px;\nborder-radius: 5px;\npadding: 4px;\n-moz-box-shadow: 0px 0px 4px #C0C0C0 !important;\n-webkit-box-shadow: 0px 0px 4px #C0C0C0 !important;\nbox-shadow: 0px 0px 4px #C0C0C0 !important;\n}\n\/*--form all styles--*\/\n.form-all{\nbackground:url(http:\/\/cms.interlogy.com\/uploads\/image_upload\/image_upload\/global\/6154_form_top.gif) no-repeat 0 0;\nfloat:left;\n}\/*---remove error message---*\/\n.form-error-message {display: none !important;}\n.form-line-error {\nbackground:none repeat scroll 0 0;\n}\n\/*---button error move down---*\/\n.form-button-error {\ndisplay: block !important;\n}\n.form-all textarea{\nheight: 195px !important;\nmax-height: 195px !important;\nmin-height: 195px !important;\n}\n.form-all input:focus, .form-all textarea:focus{\noutline:none;\n}\n\n\/*--add red border on error--*\/\n.form-validation-error {\nborder: 1px solid red !important;\n}\n \/* Injected CSS Code *\/\n<\/style>\n\n<link type=\"text\/css\" rel=\"stylesheet\" href=\"http:\/\/jotformeu.com\/css\/styles\/buttons\/form-submit-button-simple_blue.css?3.1.22\"\/>\n<script src=\"http:\/\/cdn.jotfor.ms\/static\/jotform.js?3.1.22\" type=\"text\/javascript\"><\/script>\n<script type=\"text\/javascript\">\n var jsTime = setInterval(function(){try{\n JotForm.jsForm = true;\n\n JotForm.init(function(){\n JotForm.highlightInputs = false;\n JotForm.alterTexts({\"alphabetic\":\"This field can only contain letters\",\"alphanumeric\":\"This field can only contain letters and numbers.\",\"confirmClearForm\":\"Are you sure you want to clear the form\",\"confirmEmail\":\"E-mail does not match\",\"email\":\"Enter a valid e-mail address\",\"incompleteFields\":\"Please complete required (*) fields.\",\"lessThan\":\"Your score should be less than\",\"numeric\":\"This field can only contain numeric values\",\"pleaseWait\":\"Please wait...\",\"required\":\"This field is required.\",\"uploadExtensions\":\"You can only upload following files:\",\"uploadFilesize\":\"File size cannot be bigger than:\"});\n });\n\n clearInterval(jsTime);\n }catch(e){}}, 1000);\n<\/script>\n<\/head>\n<body>\n<form class=\"jotform-form\" action=\"http:\/\/submit.jotformeu.com\/submit\/23463562342350\/\" method=\"post\" name=\"form_23463562342350\" id=\"23463562342350\" accept-charset=\"utf-8\">\n <input type=\"hidden\" name=\"formID\" value=\"23463562342350\" \/>\n <div class=\"form-all\">\n <ul class=\"form-section\">\n <li class=\"form-line\" id=\"id_1\">\n <label class=\"form-label-top\" id=\"label_1\" for=\"input_1\">\n Ad-soyad<span class=\"form-required\">*<\/span>\n <\/label>\n <div id=\"cid_1\" class=\"form-input-wide\">\n <input type=\"text\" class=\" form-textbox validate[required]\" id=\"input_1\" name=\"q1_adsoyad\" size=\"30\" \/>\n <\/div>\n <\/li>\n <li class=\"form-line\" id=\"id_3\">\n <label class=\"form-label-top\" id=\"label_3\" for=\"input_3\">\n E-mail<span class=\"form-required\">*<\/span>\n <\/label>\n <div id=\"cid_3\" class=\"form-input-wide\">\n <input type=\"text\" class=\" form-textbox validate[required, Email]\" id=\"input_3\" name=\"q3_email3\" size=\"30\" \/>\n <\/div>\n <\/li>\n <li class=\"form-line\" id=\"id_6\">\n <label class=\"form-label-top\" id=\"label_6\" for=\"input_6\"> Telefon <\/label>\n <div id=\"cid_6\" class=\"form-input-wide\">\n <input type=\"text\" class=\" form-textbox\" id=\"input_6\" name=\"q6_telefon\" size=\"30\" \/>\n <\/div>\n <\/li>\n <li class=\"form-line\" id=\"id_8\">\n <div id=\"cid_8\" class=\"form-input-wide\">\n <div style=\"text-align:left\" class=\"form-buttons-wrapper\">\n <button id=\"input_8\" type=\"submit\" class=\"form-submit-button form-submit-button-simple_blue\">\n G\u00f6nder\n <\/button>\n <\/div>\n <\/div>\n <\/li>\n <li class=\"form-line\" id=\"id_7\">\n <div id=\"cid_7\" class=\"form-input-wide\">\n <div id=\"text_7\" class=\"form-html\">\n <p class=\"borderbottom\">\n  \n <\/p>\n <\/div>\n <\/div>\n <\/li>\n <li class=\"form-line form-line-column\" id=\"id_5\">\n <label class=\"form-label-top\" id=\"label_5\" for=\"input_5\"> Mesaj\u0131n\u0131z <\/label>\n <div id=\"cid_5\" class=\"form-input-wide\">\n <textarea id=\"input_5\" class=\"form-textarea\" name=\"q5_mesajiniz\" cols=\"31\" rows=\"8\"><\/textarea>\n <\/div>\n <\/li>\n <li style=\"clear:both\">\n <\/li>\n <li style=\"display:none\">\n Should be Empty:\n <input type=\"text\" name=\"website\" value=\"\" \/>\n <\/li>\n <\/ul>\n <\/div>\n <input type=\"hidden\" id=\"simple_spc\" name=\"simple_spc\" value=\"23463562342350\" \/>\n <script type=\"text\/javascript\">\n document.getElementById(\"si\" + \"mple\" + \"_spc\").value = \"23463562342350-23463562342350\";\n <\/script>\n<\/form><\/body>\n<\/html>\n");