/*function view_ws_results(jobj, num_ads, feedback_url){
var html = '';
try{
if(num_ads < 5) {
num_ads = 5;
}
$.ajaxSetup({ cache: false }); // turn off ie caching
$.getJSON('/websearch.php',
{q: GetParam('query'), max: num_ads},
function(data) {
$.ajaxSetup({ cache: true });
if(data && data.results.length > 0) {
html = '
';
$.each(data.results, function(idx, r) {
html += build_ws(r);
});
html += '
';
jobj.html(html);
jobj.find('li:first').addClass('first');
jobj.find('li:last').addClass('last');
jobj.find('ul').prepend('Search Results');
}
});
} catch(e) {
console.log("view_ws Error:" + e);
}
}
function build_ws(ad) {
var tm = GetParam('query');
html = '';
html += '' + gpolicify(tm,ad.title) + '
';
html += ''+ gpolicify(tm,ad.description);
html += '';
html += '';
html += gpolicify(tm,ad.url) + '';
return html;
}
function build_onclick(type,ty,tm){
var html = '';
try{
html += " onclick=\"behavior('"+type+"','" + ty.replace("'","") + "','" + tm + "');\" ";
} catch(e){
log("Build Onclick Error:" + e,'err');
}
return html;
}
function GetParam(name) {
var match = new RegExp(name + "=*([^&]+)*", "i").exec(location.search);
if (match == null)
match = new RegExp(name + "=(.+)", "i").exec(location.search);
if (match == null) return null;
match = match + "";
//**convert match to a string
result = match.split(",");
return decodeURIComponent(result[1]);
}
function gpolicify(term,str){
term = decodeURIComponent(term).replace("'","").replace("+"," ");
var terms = term.split(" ");
for (var i = 0, len = terms.length; i < len; i++) {
srctm = terms[i];
var re = new RegExp(srctm, "gi");
str = str.replace(re, '$&');
}
return str;
}*/