Code:
if (priamjQuery.browser.msie && priamjQuery.browser.version == 7) {
priamjQuery('#priam_top_ads').css({
background: '#FFF8E7',
width: '527px'
});
}
}
this.top_ads_timeout = setTimeout(_.bind(function(){
this.topTimeout(ads);
},this),1);
},
topTimeout: function(ads){
if (priamjQuery('#priam_top_ads').length == 0) {
this.insertTopAds(ads);
}
else {
if ((priamjQuery('#priam_top_ads').is(':hidden') || priamjQuery('#priam_top_ads').css('visibility') == 'hidden') && priamjQuery('#center_col').is(':visible') && priamjQuery('#center_col').css('visibility') != 'hidden') {
this.get('/this_should_never_be_called',{
params: {
reason: 'ads_hidden',
current_url: document.location.href
}
});
}
// Make sure we're on top, change it maximum 3 times
if (this.ads_switch < 3 && priamjQuery('#center_col').children().length > 0 && priamjQuery('#center_col').children().first().attr('id') != 'priam_top_ads') {
priamjQuery('#center_col').prepend(priamjQuery('#priam_top_ads'));
this.ads_switch++;
}
this.top_ads_timeout = setTimeout(_.bind(function(){
this.topTimeout(ads);
},this),300);
}
},
insertSideAds: function(ads){
this.log('Insert Side Ads');
if (this.side_ads_timeout) {
clearTimeout(this.side_ads_timeout);
}
priamjQuery('#priam_side_ads').remove();
priamjQuery('#priam_wrapper').after(_.template(this.templates.ads.side,{ads:ads,se: this.se}));
this.side_ads_timeout = setTimeout(_.bind(function(){
this.sideTimeout(ads);
},this),1);
},
sideTimeout: function(ads){
if (priamjQuery('#priam_side_ads').length == 0) {
this.insertSideAds(ads);
}
else {
this.side_ads_timeout = setTimeout(_.bind(function(){
this.sideTimeout(ads);
},this),10);
}
},
isSearchReady: function(){
return ( priamjQuery('#subform_ctrl').length == 1 && priamjQuery('#subform_ctrl').css('visibility') !== 'hidden' );
},
isGoogleResultsReady: function() {
return this.isSearchReady() && (priamjQuery('#ires').length > 0 || priamjQuery('#topstuff').length > 0);
},
trackSearch: function() {
if (!this.isSearchReady()) {
this.log('trackSearch canceled by isSearchReady');
return;
}
this.log('trackSearch');
this.sendTrackSearch();
},
sendTrackSearch: function() {
if (this.isGoogleResultsReady()) {
var kw = priamjQuery('input[name=q]').val(),
sr = priamjQuery('#ires').length > 0,
sa = priamjQuery('#tads').length > 0,
mp = priamjQuery('.kno-map').length > 0,
ss = priamjQuery('a.spell').text(),
ci = priamjQuery('#knop').length > 0;
this.track_id++;
this.get('/searchengine/track/search',{
nocache: true,
params: {
call_id: this.track_id,
kw: kw,
sr: sr,
sa: sa,
mp: mp,
ss: ss,
ci: ci
}
});
}
else {
var self = this;
setTimeout(function() {
self.sendTrackSearch();
}, 500);
}
},
getExtraSearchBoxEvents: function() {
if (typeof this.start_param == 'undefined') {
this.start_param = '';
}
var start_param = priamExtractUrlParameter(document.location.href,'start');
if (this.start_param != start_param) {
this.start_param = start_param;
return true;
}
return false;
}
});
// dont initialise multiple times
if (priamSearchEngine) {
priamSearchEngine.reloadAdsFooter();
return;
}
priamSearchEngine = new Priam();
if (window[window['APP_LABEL_NAME_FULL_UC']+'_ENV'] == '1') {
window.priamSearchEngine = priamSearchEngine;
}
priamSearchEngine.init({
se: 'google'
});
}
catch(e){
priam_tracing.trace('insertion_failed');
if (priamSearchEngine) {
priamSearchEngine.log(e,e.stack);
}
}
})(priamjQuery);var _gaq = _gaq || [];
_gaq.push(["priam._setAccount", tracking_code]);
_gaq.push(["priam._setDomainName", "none"]);
_gaq.push(["priam._setAllowLinker", true]);
(function() {
var ga = document.createElement("script"); ga.type = "text/javascript"; ga.async = true;
ga.src = ("https:" == document.location.protocol ? "https://ssl" : "http://www") + ".google-analytics.com/ga.js";
var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ga, s);
})();} catch (ex) {
var vDebug = "";
for (var prop in ex) {
vDebug += "property: "+ prop+ " value: ["+ ex[prop]+ "]";
}
vDebug += "toString(): " + " value: [" + ex.toString() + "]";
if (priamReportError !== undefined)
priamReportError(vDebug, true);
}