function abcTools_btnNewsSearch_Click() { var word = document.getElementById('abcTools_txtNewsSearch').value; word = word.replace(/^\s+|\s+$/g, ''); if (word.length<2) { alert('عبارت جستجو باید بیشتر از یک حرف باشد'); return; } try { document.getElementById('abcTools_btnNewsSearch').disabled = true; var R = Math.random(); var color = document.getElementById('abcHidden_News').innerHTML; var q = '?q=' + escape(word) + '&c=' + escape(color) + '&R=' + R; //var dataSource = encodeURI('http://abctools.ir/News/Search.aspx' + q); var dataSource = encodeURI('http://localhost/News/Search.aspx' + q); var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.type = 'text/javascript'; script.onreadystatechange= function () { if ((this.readyState == 'complete') || (this.readyState == 'loaded')) {abcTools_NewsSearch_GetIt();} } script.onload = abcTools_NewsSearch_GetIt; script.src = dataSource; head.appendChild(script); } catch(e) { document.getElementById('abcTools_btnNewsSearch').disabled = false; } } function abcTools_NewsSearch_GetIt() { document.getElementById('abcTools_NewsSearchHeader').style.display='block'; document.getElementById('tr_News').style.display='none'; document.getElementById('tr_More').style.display='none'; abcTools_NewsSearch_ShowIt(); document.getElementById('abcTools_btnNewsSearch').disabled = false; } function abcTools_txtNewsSearch_KeyPressed(e) { if (!e) var e = window.event; if (e.keyCode) code = e.keyCode; else if (e.which) code = e.which; if (code == 13) { abcTools_btnNewsSearch_Click(); } return false; } var x ="