var jgIP="18.97.9.171";var swt_middle = 'middle';var right_css = 'default';var right_img = 'default';var bottom_img = 'default';refer = document.referrer;var reg = /[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+\.?/;var re_domain=reg.exec(refer)?reg.exec(refer)[0]:refer;jgSwtConfig =null;jgSwtConfig.searchWord = ''; if(re_domain.indexOf('baidu.com')>0) { jgSwtConfig.searchWord = decodeURIComponent(getUrlParam(refer,'wd')); jgSwtConfig.searchWord = jgSwtConfig.searchWord?jgSwtConfig.searchWord:decodeURIComponent(getUrlParam(refer,'word')); jgSwtConfig.searchWord = jgSwtConfig.searchWord?jgSwtConfig.searchWord:decodeURIComponent(getUrlParam(refer,'p')); jgSetCookie('searchWord',jgSwtConfig.searchWord); }else if(re_domain.indexOf('sogou.com')>0){ jgSwtConfig.searchWord = decodeURIComponent(getUrlParam(refer,'query')); jgSetCookie('searchWord',jgSwtConfig.searchWord); }else if(re_domain.indexOf('sm.cn')>0){ jgSwtConfig.searchWord = decodeURIComponent(getUrlParam(refer,'q')); jgSetCookie('searchWord',jgSwtConfig.searchWord); }else{ if(jgGetCookie('searchWord')){ jgSwtConfig.searchWord = jgGetCookie('searchWord'); } }function getUrlParam(url,paras){ var paraString = url.substring(url.indexOf('?')+1,url.length).split('&'); var paraObj = {} for (i=0; j=paraString[i]; i++){ paraObj[j.substring(0,j.indexOf('=')).toLowerCase()] = j.substring(j.indexOf('=')+1,j.length); } var returnValue = paraObj[paras.toLowerCase()]; if(typeof(returnValue)=='undefined'){ return ''; }else{ return returnValue; } } function jgSetCookie(k, v) { var nowDate = new Date(); nowDate.setTime(nowDate.getTime() + 2 * 24 * 60 * 60 * 1000); document.cookie = k + '=' + escape(v) + ';path=/;expires=' + nowDate.toGMTString() }; function jgGetCookie(k) { var arr = document.cookie.match(new RegExp('(^| )' + k + '=([^;]*)(;|$)')); if (arr != null) return unescape(arr[2]); return null };var all_form = document.querySelectorAll('form'); if(all_form.length>0){ var input=document.createElement('input'); input.setAttribute('type','hidden'); input.setAttribute('name','searchWord'); input.setAttribute('value',jgSwtConfig.searchWord); for(var i=0;i