";
document.getElementById("search-notifications").innerHTML = output_str_long + output_str;
//set height of lightbox for IE
try {
var browser=navigator.appName;
var b_version=navigator.appVersion;
//var version=parseFloat(b_version);
if ((browser=="Microsoft Internet Explorer")) {
b_version_short = b_version.substring(b_version.indexOf("MSIE ")+4);
b_version_short = b_version_short.substring(0,b_version_short.indexOf(";"));
var version=parseFloat(b_version_short);
if (version<7) {
if ($("search-notifications").style.setExpression ) { // IE
var temp_text = $("search-notifications").innerHTML;
$("search-notifications").innerHTML = "
" + temp_text + "
";
var temp_width = $("notif-temp").offsetWidth;
$("search-notifications").innerHTML = temp_text;
$("search-notifications").style.width = temp_width + 'px';
$("search-notifications").style.position = 'absolute';
$("search-notifications").style.setExpression("top", "(document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + (document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight) - this.offsetHeight + 'px'");
document.body.style.backgroundImage = "url('" + search_server_to_use + "js/s.gif')";
document.body.style.backgroundAttachment = 'fixed';
}
}
}
}
catch(ex) {}
if(notifications.notification_count > 1) setTimeout('setAndSwap(1)', 5000);
}
}
function setAndSwap(collapse) {
if ($('ws_notifications_big')) $('ws_notifications_big').style.height = $('ws_notifications_big').offsetHeight + "px";
swap_notif(collapse);
}
function swap_notif(collapse) {
if (collapse ) {
if ($('ws_notifications_big').style.display!='none') {
new Effect.BlindUp('ws_notifications_big', {duration:0.5});
setTimeout("new Effect.BlindDown('ws_notifications_small', {duration:0.5, fps:32});", 400);
}
}
else {
new Effect.BlindUp('ws_notifications_small', {duration:0.5});
setTimeout("new Effect.BlindDown('ws_notifications_big', {duration:0.5, fps:32});", 400);
}
}
function search_from_bar( ){
show_ads = true;
window.location=search_server_to_use+'search.html#'+document.forms[0].q.value
}
/** @return the URL, with prepended prefix if the given URL is relative. */
function absolutize_url(prefix, url) {
return /^[^:]+:\/\//.test(url) ? url : prefix + url;
}
/** @return HTML for one leaf menu entry.
@param e - An array like this: [label, url]. */
function html_menu_entry(e) {
if( !e )return;
var label = e[0];
var url = absolutize_url(search_server_to_use, e[1]);
return ''+getspan(label)+'';
}
/** @return HTML for one main menu entry, possibly including a "drop
down menu" (which may actually rise up).
@param e - An array like this: [label, url, id, submenu] id and
submenu are optional. submenu must be an array of menu entries,
suitable as html_menu_entry() arguments.
*/
function html_menu(e, display)
{
var label = e[0];
var url = absolutize_url(search_server_to_use, e[1]);
var id_base= e[2];
var entries= e[3];
var id= id_base+"-more";
var mouseout= 'onmouseout="show_dropdown_timer = '+
'setTimeout(function(){hideProfileDropDown(\''+id+'\')}, 500);"';
var behavior= "";
var menu= "";
if (undefined !== entries) {
behavior= ' onmouseover="clearTimeout(show_dropdown_timer);'+
' showDropDown(\''+id+'\', \'show\', this);"'+
mouseout;
menu= '
';
for (var i= 0; i';
}
var display2= undefined === display ? "inline" :
display ? "inline" : "none";
var button= ''+
''+ getspan(label) +''+
'';
var result= '
'+ button+ menu+ '
';
return result;
}
/** Holds specs for menus. Keeping them in a map allows us to use only
a subset, use a different order, or even use some items in multiple
places. */
var menus=
{
"profile":
["Profile", 'profile.html', "profile",
[["Edit Profile", 'editprofile.html'],
["Edit Photo", 'editpicture.html'],
["Privacy Setting", 'editprofile.html?section=privacy'],
["Change Preferences", 'editprofile.html?section=preferences']
] ],
"friends":
["Friends", 'rel.html', "friends",
[["View Friends", 'rel.html'],
["People You May Know", 'mayknow.html'],
["Find Friends", 'find.html'],
["Invite Friends", 'invite.html']
] ],
"changes":
["Recent Changes", "recent.html", 'recent',
[["Recent Changes", "recent.html"],
["Live Changes", "fun/live_changes.html"],
["Mapped Changes", "fun/mapped_changes.html"]
] ],
"fun":
["Fun", 'fun/fun.html', "fun",
[["Mapped Changes", "fun/mapped_changes.html"],
["Live Changes", "fun/live_changes.html"],
["Bloom", "fun/bloom.html"],
["Keyword Browser", "fun/keys.html"],
["The Faviconnery", "fun/favicon.html"],
["Micro Results", "fun/micro.html"],
["Texter", "fun/texter.html"],
["Clippy", "fun/clippy.html"]
] ],
"community":
["Community", 'about/about.html', "community",
[["Our Principles", 'about/about.html'],
//["People Search", 'friend_search.html'],
["Site Statistics", 'metrics/queries.html'],
["Wiki", server_to_use+'/wiki/'],
["Blog", server_to_use+'/blog'],
["Create an App", server_to_use+'/wiki/Creating_a_WISE_Application'],
["Translate Into Your Language", 'translate.html'],
["Get Involved", 'about/get_involved.html'],
["Crawl The Web", 'about/crawl.html'],
["Contact Us", 'about/contact.html']
] ],
"tools":
["Tools", 'tools/mostqueried.html', "tools",
[["Most Queried", 'tools/mostqueried.html'],
["Most Contributions", 'tools/mostcontributions.html'],
["Recent Top Queries", 'tools/recentqueries.html'],
["Recent Top Contributions", 'tools/recentcontributions.html'],
["Wanted Results", 'tools/wantedresults.html'],
["Toolbar", 'https://addons.mozilla.org/en-US/firefox/addon/8267'],
["Trends", 'tools/trends.html']
] ],
"help":
["Help", 'help/help.html', 'help',
[["Overview", 'help/overview.html'],
["Report a Bug", "https://bugs.launchpad.net/wikia-search"],
["Search Result Tools", "help/help.html"],
["Social Profile Tools", "help/help_profile.html"],
["Contact Us", "help/contact.html"]
] ],
"privacy": ["Privacy", "legal/privacy.html"],
"legal":
["Legal", "legal/legal.html", 'legal',
[["Terms of Use", "legal/legal.html"],
["Privacy Policy", "legal/privacy.html"],
["Copyright Policy", "legal/copyright.html"]
] ],
"applications":
["Applications", server_to_use+'/wiki/Wikia_Intelligent_Search_Extensions',
'applications',
[["About Applications", server_to_use+'/wiki/Wikia_Intelligent_Search_Extensions'],
["Application Gallery", server_to_use+'/wiki/Wikia_Search_Application_Gallery'],
["Creating Application", server_to_use+'/wiki/Creating_a_WISE_Application'],
["Playground", "wise/playground.html"]
] ]
};
/** @return HTML for a menu bar. */
function html_menu_bar()
{
var result= "";
result += '
';
result += html_menu(menus["profile"], is_logged_in_user());
result += html_menu(menus["friends"], is_logged_in_user());
result += html_menu(menus["changes"]);
result += html_menu(menus["community"]);
result += html_menu(menus["applications"]);
result += html_menu(menus["fun"]);
result += html_menu(menus["tools"]);
result += html_menu(menus["legal"]);
result += html_menu(menus["help"]);
result += '';
result += '
';
return result;
}
var header_string = "";
// macbre: add CSS class when not on main page
var container = $('container');
if (container.className != 'main-page') {
container.addClassName('search-page');
}
//header_string += '
';
header_string += '
';
header_string += '
';
header_string += '
';
header_string += '';
header_string += '
';
header_string += '';
header_string += '
';
header_string += html_menu_bar();
header_string += '';
document.write(header_string);
set_header_loggedin();
try{if(typeof show_lang_header == "function") {show_lang_header()};}catch(sl_ex){}
var BrowserDetect = {
init: function () {
this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
this.version = this.searchVersion(navigator.userAgent)
|| this.searchVersion(navigator.appVersion)
|| "an unknown version";
this.OS = this.searchString(this.dataOS) || "an unknown OS";
},
searchString: function (data) {
for (var i=0;iX";
//create image for each browser
message = document.createElement("img");
message.setAttribute("onclick","window.external.AddSearchProvider('http://search.wikia.com/wikiasearch.xml');");
if (BrowserDetect.browser=="Firefox") {
if (BrowserDetect.OS=="Mac") {
message.setAttribute("src","kt_files/browser_search_ff2_mac.png");
} else if (BrowserDetect.OS=="Windows") {
message.setAttribute("src","kt_files/browser_search_ff2_win.png");
}
} else if (BrowserDetect.browser=="Explorer") {
if (BrowserDetect.version==7) {
message.setAttribute("src","kt_files/browser_search_ie7.png");
}
}
//append image to div
mc.appendChild(message);
mc.appendChild(tnl);
//append message to container
if ((BrowserDetect.browser=="Explorer" && BrowserDetect.version==7) || (BrowserDetect.browser=="Firefox" && (BrowserDetect.version==3 || BrowserDetect.version==2))) {
$("container").appendChild(mc);
}
}
}
function closeAddOnMessage() {
//set cookie
var myDate = new Date();
myDate.setDate(myDate.getDate()+365);
setCookie("wikiaAddOnMessage", true, myDate, '/');
//hide message container
$('browser-addon-message').style.display="none";
}
function writeAddOnMessage() {
var message = "";
var tnl = "";
var mc = "";
if( getCookie("wikiaAddOnMessage") == false ) {
//create message container
mc = document.createElement("a");
mc.setAttribute ("id", "browser-addon-message");
//create text and link
tnl = document.createElement("span");
tnl.setAttribute ("id", "addon-tnl");
if (BrowserDetect.browser=="Firefox") {
if (BrowserDetect.version==3){
message = document.createElement("img");
tnl.innerHTML = getspan("Change search! Download the toolbar.") +" X";
message.setAttribute("onclick","window.location='https://addons.mozilla.org/en-US/firefox/addon/8267';");
if (BrowserDetect.OS=="Mac") {
message.setAttribute("src","kt_files/download_toolbar_ff.png");
} else if (BrowserDetect.OS=="Windows") {
message.setAttribute("src","kt_files/download_toolbar_ff.png");
}
}
//append image to div
mc.appendChild(message);
mc.appendChild(tnl);
$("container").appendChild(mc);
}
}
}
// the query counter code
var COUNTER_UPDATE_INTERVAL = 1;
function loadQueryCounter(){
var sUrl = server_to_use + '/index.php?title=index.php&action=ajax&rs=wfQueryCounter&rsargs[]=updateGlobalQueryCount&r=' + Math.random();
getDataFromServer("queryCounter", sUrl);
}
function updateGlobalQueryCount(data){
var lastQueryCount = new Object();
lastQueryCount = data;
lastQueryCount.TYPE_QUERIES = 1;
lastQueryCount.TYPE_CONTRIBUTIONS = 2;
var html= '1234567890 ';
if( Math.ceil(Math.random() * 100) % 2 == 0 ){
lastQueryCount.type = lastQueryCount.TYPE_QUERIES;
html += getspan("queries");
} else {
lastQueryCount.type = lastQueryCount.TYPE_CONTRIBUTIONS;
html += getspan("contributions");
}
$('count').innerHTML = html;
updateCounter(lastQueryCount);
}
function updateCounter(lastQueryCount){
lastQueryCount.queries += lastQueryCount.queryRate * COUNTER_UPDATE_INTERVAL;
lastQueryCount.contributions += lastQueryCount.contributionRate * COUNTER_UPDATE_INTERVAL;
$('count-value').innerHTML=
addCommas(Math.round((lastQueryCount.type == lastQueryCount.TYPE_QUERIES) ?
lastQueryCount.queries : lastQueryCount.contributions) );
window.setTimeout('updateCounter(' + Object.toJSON(lastQueryCount) + ')', COUNTER_UPDATE_INTERVAL * 1000);
}
loadQueryCounter();