		var tb4c_searchBox=(function(causeId,causeName,orgId){var mediaUrl='http://media.textbooks4change.com/widgets/searchBox/',input,firstClick=true,base,baseUrl,url;(function(){if(orgId==undefined||orgId==null){orgId='';}
		if(causeId==null){causeId='';}
		baseUrl='cid='+causeId+'&oid='+orgId;}());var dom={makeBase:function(){var scr=document.getElementsByTagName('script');for(var i=0;i<scr.length;i++){if(scr[i].src.search(/textbooks4change.com/i)!==-1){var t=i;i=scr.length;scr=scr[t];}}
		base=this.createElement('div',null,{'min-width':'180px'});var locationScript=document.createElement('script');url=window.location.hostname;locationScript.setAttribute('src',mediaUrl+'url.php?v=1&t=location&url='+url);base.appendChild(locationScript);scr.parentNode.insertBefore(base,scr.nextSibling);},makeAll:function(){var header=this.makeHeader(),content=this.makeContent();base.appendChild(header);base.appendChild(content);},makeHeader:function(){var div=this.createElement('div',null,{'background':'#2f5697','height':'33px'});div.appendChild(this.makeLogo());return div;},makeLogo:function(){var a=this.createElement('a',{'href':mediaUrl+'url.php?v=1&t=click&url='+url+'&p='+encodeURIComponent(baseUrl),'text':'Textbooks4Change','target':'_blank'},{'margin':'auto','display':'block','padding-top':'44px','width':'174px','height':'0px','overflow':'hidden','background':'url('+mediaUrl+'logo.png) no-repeat'});return a;},makeContent:function(){var div=this.createElement('div',null,{'border':'1px solid #d4d4d4','border-top-width':'0px','padding':'5px','text-align':'left'});div.appendChild(this.makeDescription());div.appendChild(this.makeForm());div.appendChild(this.makeInfoLink());return div;},makeDescription:function(){var text='Help fund '+causeName+' by buying books!';return this.createElement('p',{'text':text},{'font-family':'Arial','font-size':'12px','font-weight':'bold','line-height':'15px','color':'#333333','margin':'12px 0'});},makeForm:function(){var form=this.createElement('form',null,{'position':'relative','margin-bottom':'10px'});form.onsubmit=function(){return tb4c_searchBox.searchSubmit()};form.appendChild(this.makeInput());form.appendChild(this.makeSubmit());return form;},makeInput:function(){var div=this.createElement('div',null,{'padding':'6px 41px 7px 5px','display':'block','height':'14px','border':'1px solid #7b7b7b','border-right-width':'0','background':'url('+mediaUrl+'bg.png) repeat-x','-webkit-border-radius':'10px','-moz-border-radius':'10px 0px 0px 10px','border-top-right-radius':'10px 0px 0px 10px','-webkit-border-top-right-radius':'0px','-webkit-border-bottom-right-radius':'0px'});input=this.createElement('input',{'type':'text','name':'tb4cKeywords','id':'tb4cKeywords','value':'Title, Author, ISBN'},{'vertical-align':'top','font-size':'12px','line-height':'14px','display':'block','height':'14px','background':'none','outline':'none','border':'none','width':'100%','font-family':'Arial'});input.onfocus=function(){tb4c_searchBox.clear()};div.appendChild(input);return div;},makeSubmit:function(){var div,a;a=this.createElement('a',{'text':'Go','style':''},{'outline':'none','text-decoration':'none','padding':'6px 0 5px 5px','font-size':'16px','line-height':'16px','font-weight':'bold','color':'#282727','font-family':'Arial','border':'1px solid #7b7b7b','display':'block','width':'29px','background':'url('+mediaUrl+'bg.png) repeat-x 0 -27px','-webkit-border-radius':'10px','-moz-border-radius':'0px 10px 10px 0px','border-radius':'0px 10px 10px 0px','-webkit-border-top-left-radius':'0px','-webkit-border-bottom-left-radius':'0px'});a.onclick=function(){return tb4c_searchBox.searchSubmit()};a.onmousedown=function(){tb4c_searchBox.switchButtonState(this,true)};a.onmouseup=function(){tb4c_searchBox.switchButtonState(this,false)};div=this.createElement('div',null,{'height':'29px','width':'36px','background':'#fff','position':'absolute','top':'0','right':'0'});div.appendChild(a);return div;},makeInfoLink:function(){return this.createElement('a',{'href':mediaUrl+'url.php?v=1&t=click&url='+url+'&p='+encodeURIComponent(baseUrl),'text':'Learn More','target':'_blank'},{'font-size':'10px','font-family':'Arial','color':'#3d628b','text-decoration':'underline'});},createElement:function(name,prop,css){var elem=document.createElement(name);if(prop!==null&&prop!==undefined){for(property in prop){if(property=='text'){elem.innerHTML=prop[property];}else{elem.setAttribute(property,prop[property]);}}}
		if(css!==undefined&&css!==null){elem=this.applyCss(elem,css);}
		return elem;},applyCss:function(elem,cssObj){var cssString='';for(prop in cssObj){cssString+=prop+':'+cssObj[prop]+';';}
		elem.style.cssText=cssString;return elem;}}
		dom.makeBase();dom.makeAll();return{clear:function(){if(firstClick){input.value='';firstClick=false;}},searchSubmit:function(){window.open(mediaUrl+'url.php?v=1&t=click&url='+url+'&p='+encodeURIComponent(baseUrl+'&t=1&q='+input.value));return false;},switchButtonState:function(btn,up){var st='';if(up){st='background-position:0 -54px;'}else{st='background-position:0 -27px;'}
		btn.setAttribute('style',btn.getAttribute('style')+st);}}}(1,'The Courage Campaign',null));
		


