/*! QTouch 
 *  2016-1-19 */	
$(function(){var a=fc,b=$("#form");if(a.content&&$('<section class="content"></section>').html(a.content).appendTo(b),a.inputs&&a.inputs.length){var c=$('<form method="POST" novalidate></form>').prop("action",location.toString()).appendTo(b);$.each(a.inputs,function(a,b){var d,e=$('<label class="pf-label"></label>'),f=$('<div class="pf-line"></div>');"single"==b.type?d=$('<input type="text" />'):"multi"==b.type?d=$('<textarea rows="5"></textarea>'):"select"==b.type&&(d=$("<select></select>"),$.each(b.data,function(a,b){$("<option></option>").text(b).appendTo(d)})),d.addClass("pf-input"),e.text(b.label),e.prop("for",b.id),d.prop("name",b.id),b.required&&(e.append('<span class="pf-tip">('+VAR_JSLANG.required+')</span>'),d.prop("required",!0)),f.append(e).append(d).appendTo(c)}),c.append('<div class="pf-line pf-vcode-line"><label for="vcode" class="pf-label">'+VAR_JSLANG.verify+'</label><input type="text" class="pf-input" maxlength="4" name="vcode" required /><img class="pf-vcode"></div>'),c.find(".pf-vcode").on("click",function(){$(this).prop("src","?vc&_="+new Date)}).trigger("click"),c.append('<button type="submit" class="pf-button" id="baidu_form_sub">'+VAR_JSLANG.submit+'</button>');var d=$(this).find("[required]");d.on("blur checkdata",function(){$(this).closest(".pf-line").toggleClass("pf-error",!$(this).val().length)}).on("focus",function(){$(this).closest(".pf-line").removeClass("pf-error")}),c.on("submit",function(){d.trigger("checkdata");var a=d.filter(".pf-line.pf-error .pf-input");return a.length?(a[0].focus(),!1):!0})}var btnbC=$("#menu > .menu").css("backgroundColor");if((btnbC.startsWith("rgb")||btnbC.startsWith("rgba"))&&!btnbC.startsWith("rgba(0, 0, 0, 0)")){$("#form .pf-button").css("backgroundColor",btnbC).css("color","#fff")}else{$("#form .pf-button").css("backgroundColor","#999").css("color","#fff")}var btnfC=$("#menu>.menu>.menuitem>a").css("color");if((btnbC.startsWith("rgb")||btnbC.startsWith("rgba"))&&!btnbC.startsWith("rgba(0, 0, 0, 0)")){$("#form .pf-button").css("color",btnfC)}else{$("#form .pf-button").css("color","#fff")}var cookie=document.cookie.split(";");var post_err="";for(var i=0;i<cookie.length;i++){if(cookie[i].trim().startsWith("plugin_post")){post_err=cookie[i]}}if(post_err){var fpe=eval("("+decodeURIComponent(post_err.trim().substring(12))+")");var inputs=document.getElementsByClassName("pf-input");var j=0;for(var i in fpe){inputs[j].value=fpe[i];j++}inputs[inputs.length-1].value="";inputs[inputs.length-1].focus()}});