// ');
tileCounter++;
// ]]>
//
//
'
var prefix = '\n
';
window['spLabel'] = 'Sponsored Results';
var suffix = '
';
var template = '
{title} {abstract} {label}
{visibleUrl} ';
s += prefix;
var ads = window['google_ads'];
var offset = 0;
var idx=0;
if(true&& true && position=='bot' && ads.length > window['ad_config_mid']){
offset = window['ad_config_mid'];
if(false || false){
if(ads.length>3){
offset = window['ad_config_top'];
}else{
offset =0;
}
}
idx= offset;
}
var ajslAds=window['ajsl_ads'];
var spnrAds=window['spnr_ads'];
if(ajslAds){
for(var i = 0; i < ajslAds.length;i++) {
s += render_inhouse_ad(top,ajslAds , template,i)
}
}
var ec=0;
for(var i = idx, j=0; j
0 )){
fragment = fragment.replace(/\{label\}/, spLabel);
}else {
fragment = fragment.replace(/\{label\}/,"");
}
for(var k=0;fragment.indexOf("{pickJavascript}")!= -1;k++){
fragment = fragment.replace(/\{pickJavascript\}/,pickLog);
fragment = fragment.replace(/\(position\)/,position);
fragment = fragment.replace(/\{counter\}/,(top?"t_":"b_") + (i+1));
}
fragment = fragment.replace(/\{en\}/g, "gc");
fragment = fragment.replace(/\{ggid\}/g, "gg_" + (top?"t_":"b_") + (i+1));
fragment = fragment.replace(/\{ec\}/g, ec);
fragment = fragment.replace(/\{url\}/g, ads[i].url);
fragment = fragment.replace(/\{visibleUrl\}/, ads[i].visible_url.length > 65 ? ads[i].visible_url.substring(0, 65) : ads[i].visible_url);
ads[i].line1 = highlightQuery(ads[i].line1);
var dbgInfo="";
if(false){
dbgInfo="[id=" + ads[i].n +",type=afc]";
}
fragment = fragment.replace(/\{title\}/, dbgInfo+ads[i].line1);
ads[i].line2 = highlightQuery(ads[i].line2);
ads[i].line3 = highlightQuery(ads[i].line3);
fragment = fragment.replace(/\{abstract\}/, ads[i].line2 + " " + ads[i].line3);
fragment = fragment.replace(/\{io\}/, offset ? offset+i : i);
return fragment;
}
function render_inhouse_ad(top, ads, template,i,label) {
if(!label){
label= false;
}
var fragment = template;
if( false){
if(window['spShadedLabel'] && i==0) {
fragment = fragment.replace(/\{label\}/, spShadedLabel);
} else if(window['spLabel'] && i==0 ){
fragment = fragment.replace(/\{label\}/, spLabel);
}else {
fragment = fragment.replace(/\{label\}/,"");
}
}else {
if(window['spShadedLabel'] && i==window['ad_config_top']+ads.length-1) {
fragment = fragment.replace(/\{label\}/, spShadedLabel);
} else if((window['spLabel'] && i==window['ad_config_top']+ads.length-1 ) || label){
fragment = fragment.replace(/\{label\}/, spLabel);
}else {
fragment = fragment.replace(/\{label\}/,"");
}
}
for(var k=0;fragment.indexOf("{pickJavascript}")!= -1;k++){
fragment = fragment.replace(/\{pickJavascript\}/,ads[i].pickJavascript);
fragment = fragment.replace(/\(position\)/,"");
fragment = fragment.replace(/\{counter\}/,"");
}
fragment = fragment.replace(/\{en\}/g, ads[i].adType);
fragment = fragment.replace('gg_', ads[i].adType+"_" + i);
fragment = fragment.replace(/\{ec\}/g, ads.length);
fragment = fragment.replace(/\{url\}/g, ads[i].url);
fragment = fragment.replace(/\{visibleUrl\}/, ads[i].visible_url.length > 65 ? ads[i].visible_url.substring(0, 65) : ads[i].visible_url);
ads[i].line1 = highlightQuery(ads[i].line1);
var dbgInfo="";
if(false){
dbgInfo="[id=" + ads[i].n +",type="+ads[i].adType +"]";
}
fragment = fragment.replace(/\{title\}/, dbgInfo+ads[i].line1);
ads[i].line2 = highlightQuery(ads[i].line2);
ads[i].line3 = highlightQuery(ads[i].line3);
fragment = fragment.replace(/\{abstract\}/, ads[i].line2 + " " + ads[i].line3);
fragment = fragment.replace(/\{io\}/, i);
return fragment;
}
var ajslAds=new Array();
var spnrAds=new Array();
var repeatAds=true;
function debug_info_update_render_ads(){
if(document.getElementById('afc_ads_recieved')){
var no_of_ads_debug_info = document.createTextNode(google_ads.length);
document.getElementById('afc_ads_recieved').appendChild(no_of_ads_debug_info);
}
}
function google_ad_request_done(google_ads) {
debug_info_update_render_ads();
window['google_ads'] = google_ads;
inhouseAds = false;
getInHouseAds();
window['ajsl_ads']=ajslAds;
window['spnr_ads']=spnrAds;
if(google_ads.length != 0) {
apply_ad_config(google_ads.length);
render_ads('top', window['ad_config_top']);
}
}
function InHouseAd() {
this.url = "";
this.visible_url = "";
this.line1 = "";
this.line2 = "";
this.line3 = "";
this.pickJavascript = "";
this.adType = "";
this.n = "";
}
function getInHouseAds()
{
if(inhouseAds){
}
}
function apply_ad_config(num) {
window['ad_config_top'] = Math.min(3, num);
if(ajslAds.length >0 ){
var maxTop=3-window['ajsl_ads'].length;
maxTop=(maxTop)>0?maxTop:0;
window['ad_config_top'] =Math.min(maxTop, window['ad_config_top']);
}
else if(spnrAds.length > 0 ){
var maxTop=3-window['spnr_ads'].length;
maxTop=(maxTop)>0?maxTop:0;
window['ad_config_top'] =Math.min(maxTop, window['ad_config_top']);
}
window['ad_config_mid']
num>2)?Math.min(2, num):0;
window['ad_config_bot'] = Math.min(5, num - window['ad_config_mid']);
}
if(false){
google_ad_client = 'ca-aj-lexico-dict';
google_ad_channel = 'channel-01';
google_ad_output = 'js';
google_max_num_ads = '5';
google_page_url = '';
google_num_ads_recieved= '';
google_ad_type = 'text';
google_image_size = '';
google_language = '';
google_country = '';
google_encoding = 'utf8';
google_safe = 'high';
google_adtest = 'off';
google_hints = '';
google_kw = 'sarcasm';
google_kw_type = 'broad';
google_ad_section = 'default';
}else{
google_ad_client = 'ca-aj-lexico-dict';
google_ad_channel = 'channel-01';
google_ad_output = 'js';
google_ad_type = 'text';
google_max_num_ads ='5';
google_safe = 'high';
google_encoding = 'utf8';
google_hints = 'sarcasm';
google_ad_section='def';
}
var word_arr ;
var word_arr_len ;
function highlightQuery(input_str) {
var queryTokenArray = "sarcasm,";
var tok_arr = queryTokenArray.split(",");
for(tok_arr_idx=0; tok_arr_idx < tok_arr.length-1; tok_arr_idx ++) {
if(isCombinationWord(tok_arr[tok_arr_idx])){
word_arr = tok_arr[tok_arr_idx].split("-");
word_arr_len = word_arr.length;
first_pos = input_str.toLowerCase().indexOf(word_arr[0],0);
if(first_pos !=-1) {
input_str = highlightCombinationWords(input_str,first_pos);
}
}
else {
first_pos = input_str.toLowerCase().indexOf(tok_arr[tok_arr_idx],0);
if(first_pos != -1) {
input_str = highlightSimpleWords(input_str,tok_arr[tok_arr_idx],first_pos);
}
}
}
return input_str;
}
function isCombinationWord(word){
if(word.indexOf("-") != -1){
return true;
}else{
return false;
}
}
function isAlpha(ch) {
if (ch != null && ch.match(/^[a-zA-Z0-9\<\>]+$/)){
return true;
}
return false;
}
function isQueryinInput(firstindex, input_str, j){
for(i=firstindex; i< input_str.length ; ++i) {
var currindex = i;
if(!isAlpha(input_str.charAt(i))) {
if(firstindex == currindex) {/* 2 consecutive non-alpha characters */
firstindex++;
}
else {
if(word_arr[j] != input_str.substring(firstindex,currindex).toLowerCase())
return -1;
if (j == word_arr_len-1) return currindex;
else return isQueryinInput(currindex+1,input_str,++j);
}
}
}
if(j < word_arr_len) {
if(word_arr[j] != input_str.substring(firstindex,currindex+1).toLowerCase())
return -1;
}
return (currindex + 1) ;
}
function highlightCombinationWords(input_str,first_pos) {
exactmatch = isQueryinInput(first_pos+word_arr[0].length,input_str,1) ;
if(exactmatch !=-1 ) {
bold_str = "" + input_str.substring(first_pos,exactmatch) + "";
input_str = input_str.substring(0,first_pos) + bold_str + input_str.substring(exactmatch);
next_pos = input_str.toLowerCase().indexOf(word_arr[0],exactmatch+7);
while(next_pos != -1) {
return highlightCombinationWords(input_str,next_pos);
}
}
return input_str;
}
function highlightSimpleWords(input_str,token, first_pos) {
var end_pos = first_pos + token.length;
if(!isAlpha(input_str.charAt(end_pos)) && !isAlpha(input_str.charAt(first_pos-1))){
bold_str = "" + input_str.substring(first_pos,end_pos) + "";
input_str = input_str.substring(0,first_pos) + bold_str + input_str.substring(end_pos);
next_pos = input_str.toLowerCase().indexOf(token,end_pos+7);
}
else {
next_pos = input_str.toLowerCase().indexOf(token,end_pos);
}
while(next_pos != -1) {
return highlightSimpleWords(input_str,token,next_pos);
}
return input_str;
}
// ]]>
–noun
1.
harsh or bitter derision or irony.
2.
a sharply ironical taunt; sneering or cutting remark: a review full of sarcasms.
But I know I know. Blah blah, liberal wikipedia, blah blah, obama, socialism, world ends next week, blah blah