//Search in dropdown
(function($){
$.fn.extend({
customStyle:function(options){
if(!$.browser.msie || ($.browser.msie&&$.browser.version>6)){
return this.each(function() {
var currentSelected=$(this).find(':selected');
var arrowURL=('https:'==document.location.protocol?'':'http://a.ooi1.com/');
$(this).after('<span class="customStyleSelectBox"><span class="customStyleSelectBoxInner">'+currentSelected.text()+'</span><img style="vertical-align:middle;margin:0 0 0 5px" src="'+arrowURL+'arrow.png" width=13 height=7></span>').css({position:'absolute', opacity:0,fontSize:$(this).next().css('font-size')});
var selectBoxSpan=$(this).next();
var selectBoxWidth=parseInt($(this).width())-parseInt(selectBoxSpan.css('padding-left'))-parseInt(selectBoxSpan.css('padding-right'))-10;
var selectBoxSpanInner=selectBoxSpan.find(':first-child');
selectBoxSpan.css({display:'inline-block'});
selectBoxSpanInner.css({width:selectBoxWidth,display:'inline-block'});
var selectBoxHeight=parseInt(selectBoxSpan.height())+parseInt(selectBoxSpan.css('padding-top'))+parseInt(selectBoxSpan.css('padding-bottom'));
$(this).height(selectBoxHeight).change(function(){
selectBoxSpanInner.text($(this).find(':selected').text()).parent().addClass('changed');
});});}}});})(jQuery);
$(document).ready(function(){$('.searchDropdownBox').customStyle();});
//Next part changes form action based on selection of dropdown
$("#search").submit(function(){
var ohost='http://www.orientaloutpost.com/';
if($("#url").val()=="artwork") $(this).attr("action",ohost+"search.php");
if($("#url").val()=="dictionary") $(this).attr("action",ohost+"dictionary.php");
if($("#url").val()=="forum") $(this).attr("action",ohost+"forum/search.php");
});

//SuperFish
(function(b){b.fn.superfish=function(k){var g=b.fn.superfish,j=g.c,f=b(['<span class="',j.arrowClass,'"> &#187;</span>'].join("")),i=function(){var c=b(this),l=d(c);clearTimeout(l.sfTimer);c.showSuperfishUl().siblings().hideSuperfishUl()},e=function(){var c=b(this),m=d(c),l=g.op;clearTimeout(m.sfTimer);m.sfTimer=setTimeout(function(){l.retainPath=(b.inArray(c[0],l.$path)>-1);c.hideSuperfishUl();if(l.$path.length&&c.parents(["li.",l.hoverClass].join("")).length<1){i.call(l.$path)}},l.delay)},d=function(c){var l=c.parents(["ul.",j.menuClass,":first"].join(""))[0];g.op=g.o[l.serial];return l},h=function(c){c.addClass(j.anchorClass).append(f.clone())};return this.each(function(){var c=this.serial=g.o.length;var m=b.extend({},g.defaults,k);m.$path=b("li."+m.pathClass,this).slice(0,m.pathLevels).each(function(){b(this).addClass([m.hoverClass,j.bcClass].join(" ")).filter("li:has(ul)").removeClass(m.pathClass)});g.o[c]=g.op=m;b("li:has(ul)",this)[(b.fn.hoverIntent&&!m.disableHI)?"hoverIntent":"hover"](i,e).each(function(){if(m.autoArrows){h(b(">a:first-child",this))}}).not("."+j.bcClass).hideSuperfishUl();var l=b("a",this);l.each(function(n){var o=l.eq(n).parents("li");l.eq(n).focus(function(){i.call(o)}).blur(function(){e.call(o)})});m.onInit.call(this)}).each(function(){var c=[j.menuClass];if(g.op.dropShadows&&!(b.browser.msie&&b.browser.version<7)){c.push(j.shadowClass)}b(this).addClass(c.join(" "))})};var a=b.fn.superfish;a.o=[];a.op={};a.IE7fix=function(){var c=a.op;if(b.browser.msie&&b.browser.version>6&&c.dropShadows&&c.animation.opacity!=undefined){this.toggleClass(a.c.shadowClass+"-off")}};a.c={bcClass:"sf-breadcrumb",menuClass:"sf-js-enabled",anchorClass:"sf-with-ul",arrowClass:"sf-sub-indicator",shadowClass:"sf-shadow"};a.defaults={hoverClass:"sfHover",pathClass:"overideThisToUse",pathLevels:1,delay:800,animation:{opacity:"show"},speed:"normal",autoArrows:true,dropShadows:true,disableHI:false,onInit:function(){},onBeforeShow:function(){},onShow:function(){},onHide:function(){}};b.fn.extend({hideSuperfishUl:function(){var e=a.op,d=(e.retainPath===true)?e.$path:"";e.retainPath=false;var c=b(["li.",e.hoverClass].join(""),this).add(this).not(d).removeClass(e.hoverClass).find(">ul").hide().css("visibility","hidden");e.onHide.call(c);return this},showSuperfishUl:function(){var e=a.op,d=a.c.shadowClass+"-off",c=this.addClass(e.hoverClass).find(">ul:hidden").css("visibility","visible");a.IE7fix.call(c);e.onBeforeShow.call(c);c.animate(e.animation,e.speed,function(){a.IE7fix.call(c);e.onShow.call(c)});return this}})})(jQuery);
jQuery(function(){jQuery('ul.sf-menu').superfish({autoArrows:false,speed:'fast'});});

//HoverIntent 2011.02.26
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type=="mouseenter"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}}};return this.bind('mouseenter',handleHover).bind('mouseleave',handleHover)}})(jQuery);

$(document).ready(function(){
$(window).resize(function(){
if($(window).width()<940){$('form.sf').css({float:'left',clear:'both'});$('div.toplinks').css({float:'left'});}else{$('form.sf').css({float:'none',clear:'none'});$('div.toplinks').css({float:'none'});}
if($(window).width()<850){$('div.toplinks').css({width:'29em'});}else{$('div.toplinks').css({width:'auto'});}
if($(window).width()<950){$('div#navBeta').css({position:'relative'});}else{$('div#navBeta').css({position:'absolute'});}
if($(window).width()<480){$('div.social').css({display:'none'});}else{$('div.social').css({display:'block'});}
}).resize();});

(function(d,s,id){var js, fjs=d.getElementsByTagName(s)[0];if(d.getElementById(id)){return;}
js=d.createElement(s);js.id=id;js.src="//connect.facebook.net/en_US/all.js#xfbml=1";js.async=true;fjs.parentNode.insertBefore(js,fjs);}(document,'script','facebook-jssdk'));

(function(){var po=document.createElement('script');po.type='text/javascript';po.async=true;po.src='https://apis.google.com/js/plusone.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(po,s);})();

(function($){$.fn.jBrowserBookmark=function(options,lang){var defaults=$.extend(opts={language:{'':['Press [key] + ',' to bookmark this page.']},defaultLanguage:'',functionButton:['CTRL','CMD']},options);var docUrl=window.location.href;var docTitle=document.title;var browserName;browserName=getBrowser();return this.each(function(){$(this).click(function(e){e.preventDefault();try{switch(browserName){case'konqueror':case'firefox':window.sidebar.addPanel(docTitle,docUrl,'');break;case'msie':window.external.AddFavorite(docUrl,docTitle);break;case'opera':if(versionOpera()<11){$(this).attr('rel','sidebar').attr('title',docTitle).attr('href',docUrl);break;}else{throw error;}default:throw error;}}catch(error){var hotkey=getHotkey(browserName);var alertText=getLanguageText();if(/mac/.test(navigator.platform.toLowerCase()=='mac')){prefix=alertText[0].replace('[key]',opts.functionButton[1]);}else{prefix=alertText[0].replace('[key]',opts.functionButton[0]);}alert(prefix+hotkey+alertText[1]);}});});function getBrowser(){if($.browser.msie){return'msie';}if($.browser.mozilla){return'firefox';}if($.browser.opera){return'opera';}if($.browser.safari&&/chrome/.test(navigator.userAgent.toLowerCase())){return'chrome';}if($.browser.safari){return'safari';}if(/konqueror/.test(navigator.userAgent.toLowerCase())){return'konqueror';}}function getHotkey(browserName){switch(browserName){case'konqueror':return'B';break;case'opera':return(versionOpera()<9)?'T':'D';break;default:return'D';break;}}function getLanguageText(){var languageChosen;if(opts.language[lang]!=undefined){languageChosen=lang;}else{if(opts.language[navigator.language.toLowerCase().substring(0,2)]!=undefined){languageChosen=navigator.language.toLowerCase().substring(0,2);}else{if(opts.language[opts.defaultLanguage]!=undefined)languageChosen=opts.defaultLanguage;else{for(var i in opts.language){languageChosen=i;break;}}}}return opts.language[languageChosen];}function versionOpera(){version=navigator.userAgent.substring(navigator.userAgent.toLowerCase().indexOf('version/')+8);return parseInt(version.substring(0,version.indexOf('.')));}};})(jQuery);
$(document).ready(function(){$("#add-favourites").jBrowserBookmark();});

function wopen(url,w,h){w+=32;h+=96;var win=window.open(url,'popup','width='+w+',height='+h+','+'location=no,menubar=no,'+'status=no,toolbar=no,scrollbars=yes,resizable=yes');win.resizeTo(w,h);win.focus();}

var gaJsHost=(("https:"==document.location.protocol)?"https://ssl.":"http://www.");document.write(unescape("%3Cscript src='"+gaJsHost+"google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));try{var pageTracker=_gat._getTracker("UA-481758-1");pageTracker._trackPageview();}catch(err){}

adroll_adv_id="7XZNW2ZFCJES5HMCKRT6FW";adroll_pix_id="IXXMIG5OEFHW3C3M3B5ZSI";(function(){var oldonload=window.onload;window.onload=function(){__adroll_loaded=true;var scr=document.createElement("script");var host=(("https:"==document.location.protocol)?"https://s.adroll.com":"http://a.adroll.com");scr.setAttribute('async','true');scr.type="text/javascript";scr.src=host+"/j/roundtrip.js";((document.getElementsByTagName('head') || [null])[0] || document.getElementsByTagName('script')[0].parentNode).appendChild(scr);if(oldonload){oldonload()}};}());
