function setCookie(name,value,expires,path,domain,secure)
{var today=new Date();today.setTime(today.getTime());if(expires)
{expires=expires*1000*60*60*24;}
var date=new Date(today.getTime()+(expires));document.cookie=name+"="+escape(value)+((expires)?";expires="+date.toGMTString():"")+
((path)?";path="+path:"")+
((domain)?";domain="+domain:"")+
((secure)?";secure":"");}
var RATINGS={getCookie:function(check_name)
{var a_all_cookies=document.cookie.split(';');var a_temp_cookie='';var cookie_name='';var cookie_value='';var b_cookie_found=false;for(i=0;i<a_all_cookies.length;i++)
{a_temp_cookie=a_all_cookies[i].split('=');cookie_name=a_temp_cookie[0].replace(/^\s+|\s+$/g,'');if(cookie_name==check_name)
{b_cookie_found=true;if(a_temp_cookie.length>1)
{cookie_value=unescape(a_temp_cookie[1].replace(/^\s+|\s+$/g,''));}
return cookie_value;}
a_temp_cookie=null;cookie_name='';}
if(!b_cookie_found)
{return null;}}}
var inProgress=false;function ShowMessage(message,width)
{inProgress=true;var msg=jQuery('<div />').addClass('popupwindow').css({position:'absolute',left:parseInt(jQuery('body').width()/2-width/2),width:width,top:(window.pageYOffset?window.pageYOffset:document.body.scrollTop)+width/2,display:'none'}).html('<p style="margin:0 auto;text-align: center">'+message+'</p>'+'<div class="popupbtns"></div>');jQuery('.popupbtns',msg).append(jQuery('<input type="button" class="popupbutton ok" />').click(function()
{msg.fadeIn('slow',function()
{msg.remove();unblockUI();inProgress=false;});}));jQuery('body').append(msg);jQuery('.popupwindow').draggable({handle:'#close_div'});msg.fadeIn('slow');}
function ShowCommentWindow(termID,id,rating,starObject)
{var result=true;if(RATINGS.getCookie('ratings'+termID)!=null)
{ShowMessage('You have already rated this term.',260);return false;}
var tpl='<div style="text-align:center;">';tpl+='<span style="color:#ffffff;font-weight:bold;">Thanks for voting, we have recorded your rating.</span><br />';tpl+='<b>Enter your comment:</b><br />';var tmpRate=StarRating.getWordsForRate(rating);var reg=/<span.*>(.*)<\/span>/;var newRate='';if(reg.exec(tmpRate))
{newRate=reg.exec(tmpRate)[1];}
tpl+='<textarea id="comment_box" rows="10" class="send-to-friend-control">I rate this term "'+newRate+'" because </textarea><br />';tpl+='</div>';var popupWidth=360;var msg=jQuery('<div />').addClass('popupwindow').css({position:'absolute',left:parseInt(jQuery('body').width()/2-(popupWidth/2)),width:popupWidth,top:(window.pageYOffset?window.pageYOffset:document.documentElement.scrollTop)+100,display:'none'}).html('<div class="close_div"></div><p style="margin:0 auto;text-align: center">'+tpl+'</p>'+'<div class="popupbtns"></div>');jQuery('.popupbtns',msg).append(jQuery('<input type="button" class="popupbutton submit" />').click(function()
{var comment=document.getElementById('comment_box').value;msg.fadeIn('slow',function(){msg.remove();unblockUI();});var data='id='+id+"&comment="+escape(comment)+'&mode=update'+'&rate='+rating;var res=Query('POST',"/rate_service.php",data,true);if(res.toLowerCase()=='ok')
{setCookie('ratings'+termID,rating,7);ShowMessage('Successfully rated. Thanks for rating!',260);}
else
{msg.fadeIn('slow',function(){msg.remove();unblockUI();});var errors=res.split(';');error=errors[0].split(':')[1];ShowMessage(error,260);result=false;starObject.setCanVote(true);starObject.clearRates();}
inProgress=false;}));jQuery('.close_div',msg).append(jQuery('<img src="/images/close_popup.png" alt="close" id="close_button" />').click(function(){msg.fadeIn('slow',function()
{setCookie('ratings'+termID,rating,7);starObject.setCanVote(false);msg.remove();unblockUI();inProgress=false;});}));jQuery('.popupbtns',msg).append(jQuery('<input type="button" class="popupbutton dont_submit" />').click(function(){msg.fadeIn('slow',function()
{setCookie('ratings'+termID,rating,7);starObject.setCanVote(false);msg.remove();unblockUI();inProgress=false;});}));jQuery('body').append(msg);msg.fadeIn('slow');setTimeout(function()
{var el=document.getElementById('comment_box');el.focus();var sz=el.value.length;if(el.setSelectionRange)
{el.setSelectionRange(sz,sz);}
else if(el.createTextRange)
{var rng=el.createTextRange();rng.collapse(true);rng.moveEnd('character',sz);rng.moveStart('character',sz);rng.select();}},100);jQuery('.popupwindow').draggable({handle:'#close_div'});msg.fadeIn('slow');return result;}
function CheckRateVisibility(termID)
{var el=document.getElementById('stars-container');var currRate=RATINGS.getCookie('ratings'+termID);if(typeof(el)!=undefined)
{var rs=StarRating.create('stars-container',(currRate!=null?currRate:0),(currRate!=null?StarRating.getWordsForRate(currRate):''),(currRate==null));rs.setOnClickHandler(function()
{var tmpRate=RATINGS.getCookie('ratings'+termID);if(tmpRate==null&&!inProgress)
{inProgress=true;rs.setCanVote(false);rs.setDefText(StarRating.getWordsForRate(rs.getRate()));var data='id='+termID+'&mode=add'+'&rate='+rs.getRate();var id=Query('POST',"/rate_service.php",data,true);if(isNaN(id))
{var errors=id.split(';');error=errors[0].split(':')[1];ShowMessage(error,260);rs.setCanVote(true);rs.clearRates();inProgress=false;return false;}
var res=ShowCommentWindow(termID,id,rs.getRate(),rs);rs.setCanVote(!res);return res;}
else if(!inProgress)
{ShowMessage('You have already rated this term.',260);}
return false;});}
else
{setTimeout(function(){CheckRateVisibility(termID);},1000);}}
jQuery(function(){CheckRateVisibility(TERMID);});function ShowCite(term_name,site_name,term_path)
{pageTracker._trackPageview('/outgoing/citeDef.com');var tpl='To help you cite our definitions in your bibliography, here is the proper citation layout for the three major formatting styles, with all of the relevant information filled in.<br />';tpl+='<br /><span style="color:#4B0082;font-weight:bold;"><font color="#4B0082">American Psychological Association (APA):</font></span><br /><br />';tpl+='!word. !site. Retrieved !date, from !site website: !link<br />';tpl+='<br /><span style="color:#4B0082;font-weight:bold;"><font color="#4B0082">Chicago Manual of Style (CMS):</font></span><br /><br />';tpl+='!word. !site. WebFinance, Inc. !link (accessed: !date).<br />';tpl+='<br /><span style="color:#4B0082;font-weight:bold;"><font color="#4B0082">Modern Language Association (MLA):</font></span><br /><br />';tpl+='"!word" !site. WebFinance, Inc. !date &lt;!link&gt;.<br />';tpl+='<br />';var dt=new Date();var months=['January','February','March','April','May','June','July','August','September','October','November','December'];var full_date=months[dt.getMonth()]+' '+(dt.getDate()<10?'0':'')+dt.getDate()+', '+dt.getFullYear();var message=tpl.replace(/!word/g,term_name);message=message.replace(/!site/g,site_name);message=message.replace(/!link/g,term_path);message=message.replace(/!date/g,full_date);var msg=jQuery('<div />').addClass('popupwindow').css({position:'absolute',left:parseInt(jQuery('body').width()/2-300),width:600,top:(window.pageYOffset?window.pageYOffset:document.body.scrollTop)+100,display:'none'}).html('<div class="close_div"></div><div class="close-div-padded"></div><p style="margin:0 auto;text-align: center">'+message+'</p>'+'<div class="popupbtns"></div>');jQuery('.close_div',msg).append(jQuery('<img src="/images/close_popup.png" alt="close" id="close_button" />').click(function(){msg.fadeIn('slow',function()
{msg.remove();unblockUI();});}));jQuery('.popupbtns',msg).append(jQuery('<input type="button" class="popupbutton ok" />').click(function(){msg.fadeIn('slow',function(){msg.remove();unblockUI();});}));jQuery('body').append(msg);jQuery('.popupwindow').draggable({handle:'.close_div'});msg.fadeIn('slow');};function blockUI(container)
{var contain=jQuery(typeof(container)=='undefined'?'body':container);var blockdiv='<div class="x-mask" style="display: block" />';var mask=contain.prepend(blockdiv).children('.x-mask');contain.addClass('x-masked');}
function unblockUI()
{jQuery('.x-masked').removeClass('x-masked').children('.x-mask').hide().remove();}
function enter_search_popup()
{blockUI();var message='Please enter a term in the search box, and try again.';var msg=jQuery('<div />').addClass('popupwindow').css({position:'absolute',left:parseInt(jQuery('body').width()/2-160),display:'none'}).html('<p style="margin: 0 auto; text-align: center">'+message+'</p>'+'<div class="popupbtns"></div>');jQuery('.popupbtns',msg).append(jQuery('<input type="button" class="popupbutton ok" />').click(function(){msg.fadeIn('slow',function(){msg.remove();unblockUI();});}));jQuery('body').append(msg);msg.fadeIn('slow');}
function check_search_popup()
{if(jQuery("#term").val().replace(/[ ]*/,'')==''||jQuery("#term").val()=='Enter a word or phrase...')
{enter_search_popup();return false;}}
function addFavorites()
{var bookmarkurl='http://www.investorwords.com';var bookmarktitle='Investorwords.com';if(window.sidebar){window.sidebar.addPanel(bookmarktitle,bookmarkurl,"");}else if(window.external){window.external.AddFavorite(bookmarkurl,bookmarktitle);}
else if(window.opera&&window.print){return true;}}
empty_filter=false;function filter_active(sender)
{if(empty_filter)
{empty_filter=false;sender.value='';}}
function filter_inactive(sender)
{if(sender.value=='')
{empty_filter=true;sender.value='Enter a word or phrase...';}}
function validate_filter()
{if(empty_filter)
{alert('Enter a word or phrase...');}
return!empty_filter;}
function rand(n)
{return(Math.floor(Math.random()*n+1));}
function toogle_more_links()
{var a=document.getElementById('more-drop-c');var b=document.getElementById('more-drop');if(a.style.display=='none')
{a.style.display='block';b.className='more-button more-button-opened';if(!window.is_loaded_links_block)
{var res=Query('get','/cgi-bin/getword_links.cgi?id='+window.current_term_num+'&mode=get_rest_back_links','');a.innerHTML=res.documentElement.childNodes[0].nodeValue;window.is_loaded_links_block=true;}
if(window.is_loaded_links_block)
{var tmp=window.document.createElement('div');tmp.innerHTML=a.innerHTML;tmp.style.width='300px';tmp.style.position='absolute';tmp.style.visibility='hidden';tmp=document.body.appendChild(tmp);if(tmp.offsetHeight<86)a.style.height='auto';tmp.parentNode.removeChild(tmp);}}
else
{a.style.display='none';b.className='more-button more-button-closed';}}
function displayYahooQuotes()
{var el=document.getElementById('yahoo_quotes');if(el===null){return 0;};var symbol=el.innerHTML;jQuery.ajax({url:'/get_yahoo_symbol.php',type:'POST',data:{symbol:symbol},dataType:'html',success:function(data){el.innerHTML=data;el.style.display='block';}})}
jQuery(function()
{displayYahooQuotes();});;StarRating=function()
{var rateText='Rate this definition:';var rateInWords=['<span style="color: #FF0000">Poor</span>','<span style="color: #BB3400">Below Average</span>','<span style="color: #7F6200">Average</span>','<span style="color: #419200">Above Average</span>','<span style="color: #00C400">Excellent</span>'];var starWidth=14;var mouseOvered=false;var h_mouseout=0;var canVote=true;var defText='';var highlightElements=[];var container,rateInWordsElement;var starElements=[];function mouseout_handler()
{h_mouseout=0;if(canVote)
{for(var i=0;i<highlightElements.length;i++){highlightElements[i].style.display='none';}
rateInWordsElement.innerHTML=defText;mouseOvered=false;}}
return{getWordsForRate:function(rate)
{return(rate?rateInWords[rate-1]:'');},create:function(element,currentRate,_defText,_canVote)
{if(typeof(element)=='string')element=document.getElementById(element);if(!element)return;currentRate=currentRate||0;defText=_defText||'';canVote=(typeof(_canVote)=='undefined'?true:_canVote);var resObj=function()
{var onClickHandlerFunc=null;return{clickHappened:function()
{if(onClickHandlerFunc!=null)onClickHandlerFunc();},setOnClickHandler:function(func)
{onClickHandlerFunc=func;},setCanVote:function(canVoteValue)
{canVote=canVoteValue;for(var i=0;i<starElements.length;i++)
{highlightElements[i].style.display='none';starElements[i].className='rate-star'+(canVote?' can-vote':'')+((i<currentRate)?' star-on':'');}},setDefText:function(text)
{defText=text;if(!mouseOvered)rateInWordsElement.innerHTML=defText;},clearRates:function()
{for(var i=0;i<starElements.length;i++)
{highlightElements[i].style.display='none';starElements[i].className='rate-star can-vote';}
defText='';rateInWordsElement.innerHTML=defText;currentRate=0;},getRate:function()
{return currentRate;},getRateInWords:function()
{return(currentRate?rateInWords[currentRate-1]:'');}}}();container=document.createElement('DIV');container.className='rating-stars';element.appendChild(container);var rateTextElement=document.createElement('DIV');rateTextElement.className='rate-text';rateTextElement.innerHTML=rateText;container.appendChild(rateTextElement);var starsContainer=document.createElement('DIV');starsContainer.className='stars-container';container.appendChild(starsContainer);starsContainer.onmouseout=function()
{if(h_mouseout>0)clearTimeout(h_mouseout);h_mouseout=setTimeout(mouseout_handler,100);}
for(var i=0;i<rateInWords.length;i++)
{var starElement=document.createElement('DIV');starElement.className='rate-star'+(canVote?' can-vote':'')+((i<currentRate)?' star-on':'');starElement.style.left=(starWidth*i)+'px';starsContainer.appendChild(starElement);var highlightElement=document.createElement('DIV');highlightElement.className='rate-highlight';highlightElement.style.left=(starWidth*i)+'px';highlightElement.style.display='none';starsContainer.appendChild(highlightElement);starElements.push(starElement);highlightElements.push(highlightElement);starElement.onmouseover=function()
{var num=i;return function()
{if(h_mouseout>0)clearTimeout(h_mouseout);h_mouseout=0;if(canVote)
{for(var i=0;i<=num;i++){highlightElements[i].style.display='';}
rateInWordsElement.innerHTML=rateInWords[num];mouseOvered=true;}}
alert(1);}();highlightElement.onmouseover=function()
{if(h_mouseout>0)clearTimeout(h_mouseout);h_mouseout=0;}
highlightElement.onmouseout=function()
{var num=i;return function()
{if(h_mouseout>0)clearTimeout(h_mouseout);mouseout_handler();}}();starElement.onclick=function()
{var num=i;return function()
{if(!canVote)
{resObj.clickHappened();}}}();highlightElement.onclick=function()
{var num=i;return function()
{if(canVote)
{for(var i=0;i<starElements.length;i++){starElements[i].className='rate-star can-vote'+((i<=num)?' star-on':'');}
currentRate=num+1;resObj.clickHappened();}}}();}
rateInWordsElement=document.createElement('DIV');rateInWordsElement.className='rate-in-words-text';rateInWordsElement.innerHTML=defText;container.appendChild(rateInWordsElement);return resObj;}}}();;function createhidecook()
{var dt=new Date();dt.setTime(dt.getTime()+(20*24*60*60*1000));document.cookie="linkstat=hide; path=/; expires="+dt.toGMTString();}
function createshowcook()
{var dt=new Date();dt.setTime(dt.getTime()+(20*24*60*60*1000));document.cookie="linkstat=show; path=/; expires="+dt.toGMTString();}
jQuery(document).ready(function(){var hideButton=jQuery("#hide_link_description");var showButton=jQuery("#show_link_description");var linkdesc=jQuery.cookie('linkstat');if(linkdesc=="show")
{hideButton.show();showButton.hide();jQuery("#definition_div a").css({'color':'#0253b7'});}
else if(linkdesc=="hide")
{showButton.show();hideButton.hide();jQuery("#definition_div a").css({'color':'#000','text-decoration':'none'});}
else if(linkdesc==""||linkdesc==null)
{hideButton.show();showButton.hide();jQuery("#definition_div a").css({'color':'#0253b7'});}
hideButton.click(function(event){jQuery("#definition_div a").css({'color':'#000','text-decoration':'none'});jQuery(this).hide();createhidecook();pageTracker._trackPageview('/outgoing/hidelink.com');showButton.show();});showButton.click(function(event){jQuery("#definition_div a").css({'color':'#0253b7'});jQuery(this).hide();createshowcook();pageTracker._trackPageview('/outgoing/showlink.com');hideButton.show();});});