
function popTour(tourFile,tourWidth,tourHeight,tourDir){var tourFile=tourFile.toLowerCase();if((tourWidth==null)||(tourWidth=="")){tourWidth=770;}
if((tourHeight==null)||(tourHeight=="")){tourHeight=510;}
if((tourDir==null)||(tourDir=="")){tourDir="/tour/quickbooks/2005/";}
if((tourFile=="customer_mgr_1")||(tourFile=="customer_mgr_2")||(tourFile=="customer_mgr_3")||(tourFile=="customer_mgr_4")||(tourFile=="41-cor-s3s")||(tourFile=="41-ole-f1s")||(tourFile=="41-ole-f3s")||(tourFile=="bs")||(tourFile=="ccs")||(tourFile=="pos")){tourWindow="/tour/popup_tour.jhtml?tourFile="+tourFile;}
else if(tourFile=="51-nui-t1"){tourWindow="/tour/quickbooks/2005/51-nui-t1.jhtml";}
else if(tourFile=="qb_bs"){tourWindow="/tour/quickbooks/2005/qb_bs/movies/qbbs.html";}
else{tourWindow=tourDir+tourFile+".html";}
var positionX=(screen.availWidth-tourWidth)/2;var positionY=(screen.availHeight-tourHeight)/2;if(tourFile.length>0){window.open(tourWindow,"QuickBooks_Tour","width="+tourWidth+",height="+tourHeight+",left="+positionX+",top="+positionY+",directories=no,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no");}}
function popWin(URL,Width,Height,Resizable,Scrollbars){if((Width==null)||(Width=="")){Width=570;}
if((Height==null)||(Height=="")){Height=340;}
if((Resizable==null)||(Resizable=="")){Resizable="no";}
if((Scrollbars==null)||(Scrollbars=="")){Scrollbars="no";}
var positionX=(screen.availWidth-Width)/2;var positionY=(screen.availHeight-Height)/2;Day=new Date();WindowName=Day.getTime();window.open(URL,WindowName,"width="+Width+",height="+Height+",left="+positionX+",top="+positionY+",channelmode=0,dependent=0,directories=0,location=0,menubar=0,resizable="+Resizable+",scrollbars="+Scrollbars+",status=0,toolbar=0");}
function getgoing(targetPage){window.location=targetPage;}
function createCookie(name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}
else var expires="";document.cookie=name+"="+value+expires+"; path=/";}
function readCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length);}
return null;}
function eraseCookie(name){createCookie(name,"",-1);}
function Show_Stuff(Click_MenuOn,Click_MenuOff){if(document.getElementById){var curDisplay=document.getElementById(Click_MenuOn).style;if(document.getElementById(Click_MenuOn).style.display=="none"){document.getElementById(Click_MenuOn).style.display="";document.getElementById(Click_MenuOff).style.display="none";}else{document.getElementById(Click_MenuOn).style.display="none";document.getElementById(Click_MenuOff).style.display="";}}else if(document.all){if(document.all[Click_MenuOn].style.display=="none"){document.all[Click_MenuOn].style.display="";document.all[Click_MenuOff].style.display="none";}else{document.all[Click_MenuOn].style.display="none";document.all[Click_MenuOff].style.display="";}}}
function checkBoxCookie(disp,opt1,opt2){var isBox=readCookie('resourceBoxCookie');if(isBox==1){document.write('<span ID="'+disp+'" style="display:'+opt1+'">');}
else{document.write('<span ID="'+disp+'" style="display:'+opt2+'">');}};function loadingStatus2(whichForm){s=document[whichForm].which;if(s.options[s.selectedIndex].value!=""){_hbLink(hbxStrip(s.options[s.selectedIndex].text),whichForm,"10, 150, 150, 20");s[s.length]=new Option('Loading...',s[s.selectedIndex].value);s[s.length-1].selected=1;window.location.href=s.options[s.selectedIndex].value;}}
function hbxStrip(a)
{a=a.split("|").join("");a=a.split("&").join("");a=a.split("'").join("");a=a.split("#").join("");a=a.split("$").join("");a=a.split("%").join("");a=a.split("^").join("");a=a.split("*").join("");a=a.split(":").join("");a=a.split("!").join("");a=a.split("<").join("");a=a.split(">").join("");a=a.split("~").join("");a=a.split(";").join("");a=a.split(" ").join("+");return a;};function loadingStatusNew(whichForm){s=document.getElementById(whichForm);if(s.options[s.selectedIndex].value!=""){_hbLink(hbxStrip(s.options[s.selectedIndex].text),whichForm,"10, 150, 150, 20");s[s.length]=new Option('Loading...',s[s.selectedIndex].value);s[s.length-1].selected=1;window.location.href=s.options[s.selectedIndex].value;}}
function hbxStrip(a)
{a=a.split("|").join("");a=a.split("&").join("");a=a.split("'").join("");a=a.split("#").join("");a=a.split("$").join("");a=a.split("%").join("");a=a.split("^").join("");a=a.split("*").join("");a=a.split(":").join("");a=a.split("!").join("");a=a.split("<").join("");a=a.split(">").join("");a=a.split("~").join("");a=a.split(";").join("");a=a.split(" ").join("+");return a;};function loadingStatusPop(whichForm){s=document[whichForm].which;if(s.options[s.selectedIndex].value!=""){popWin(s.options[s.selectedIndex].value,770,520,'no','no');}};function initialTab(firstTab){stuffOn=firstTab;}
function rollOverMe2(object_id){if(object_id!=stuffOn+"Tab"){if(document.getElementById){document.getElementById(object_id).className="tabOver";}else if(document.all){document.all[object_id].className="tabOver";}
return;}}
function rollOffMe2(object_id){if(object_id!=stuffOn+"Tab"){if(document.getElementById){document.getElementById(object_id).className="tabOff";}else if(document.all){document.all[object_id].className="tabOff";}
return;}}
function changePage(newLoc){window.location=newLoc;}
function changeTab(onTab,offTabs,whichPage){stuffOn=onTab;var tabArray=offTabs.split(",");var stuffOff=new Array();var z=0;var where=whichPage;while(z<tabArray.length){stuffOff[z]=tabArray[z];z+=1;}
if(document.getElementById){document.getElementById(stuffOn+"Box").style.display="block";document.getElementById(stuffOn+"Tab").className="tabOn";var i=0;while(i<z){document.getElementById(stuffOff[i]+"Box").style.display="none";document.getElementById(stuffOff[i]+"Tab").className="tabOff";i=i+1;}}else if(document.all){document.all[stuffOn+"Box"].style.display="block";document.all[stuffOn+"Tab"].className="tabOn";var i=0;while(i<z){document.all[stuffOff[i]+"Box"].style.display="none";document.all[stuffOff[i]+"Tab"].className="tabOff";i=i+1;}}}
function checkNewBoxCookie(){var isBox=readCookie('newBoxCookie');if(isBox==0){document.getElementById("newPanel").style.display="none";}
else{document.getElementById("newPanel").style.display="block";}}
function whichTab2(planB,whichPage){boxSet=planB;var boxArray=boxSet.split(",");var goodTab=boxArray[0];var firstComma=boxSet.indexOf(",");var badTabs=boxSet.slice(firstComma+1);if(goodTab!=badTabs){changeTab(goodTab,badTabs,whichPage);}}
function closeNew(){document.getElementById("newPanel").style.display="none";createCookie('newBoxCookie',0,3000);}
function go(goWhere)
{var box=goWhere;var destination=box.options[box.selectedIndex].value;if(destination)location.href=destination;}
function changeLocation(menuObj,firstOption){if(firstOption=="no"){starter=-1;}else{starter=0;}
var i=menuObj.selectedIndex;if(i>starter){window.location=menuObj.options[i].value;}}
function changeLocationPop(menuObj,firstOption){if(firstOption=="no"){starter=-1;}else{starter=0;}
var i=menuObj.selectedIndex;if(i>starter){popWin(menuObj.options[i].value,770,520,'no','no');}}
function rollOverThis(object_id,classToUse){if(document.getElementById){document.getElementById(object_id).className=classToUse+"Over";}else if(document.all){document.all[object_id].className=classToUse+"Over";}}
function rollOffThis(object_id,classToUse){if(document.getElementById){document.getElementById(object_id).className=classToUse;}else if(document.all){document.all[object_id].className=classToUse;}}
function openUserMap(busAddy,busCity,busState,busZip,busName,busPhone,usrEmail,busWeb,busDesc){window.open('http://crystal.semphonic.com/googlemapslocator/communitymap.aspx?0~'+busAddy+',%20'+busCity+',%20'+busState+',%20'+busZip+'~'+busName+'~'+busPhone+'~'+usrEmail+'~'+busWeb+'~'+busDesc,'communityMap','width=520,height=600,location=0,menubar=0,resizable="no",scrollbars="no",status=0,toolbar=0');}
var menuwidth='120px';var menubgcolor='#eeeeee';var disappeardelay=250;var hidemenu_onclick="yes";var ie4=document.all;var ns6=document.getElementById&&!document.all;if(ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+';" onMouseover="clearhidemenu();" onMouseout="dynamichide(event);"></div>');function getposOffset(what,offsettype){var totaloffset=(offsettype=="left")?what.offsetLeft:what.offsetTop;var parentEl=what.offsetParent;while(parentEl!=null){totaloffset=offsettype=="left"?totaloffset+parentEl.offsetLeft:totaloffset+parentEl.offsetTop;parentEl=parentEl.offsetParent;}
return totaloffset;}
function showhide(obj,e,visible,hidden,menuwidth){if(ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px";if(menuwidth!=""){dropmenuobj.widthobj=dropmenuobj.style;dropmenuobj.widthobj.width=menuwidth;}
if(e.type=="click"&&obj.visibility==hidden||e.type=="mouseover")
obj.visibility=visible;else if(e.type=="click")
obj.visibility=hidden;}
function iecompattest(){return(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body;}
function clearbrowseredge(obj,whichedge){var edgeoffset=0;if(whichedge=="rightedge"){var windowedge=ie4&&!window.opera?iecompattest().scrollLeft+iecompattest().clientWidth-15:window.pageXOffset+window.innerWidth-15;dropmenuobj.contentmeasure=dropmenuobj.offsetWidth;if(windowedge-dropmenuobj.x<dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth;}
else{var topedge=ie4&&!window.opera?iecompattest().scrollTop:window.pageYOffset;var windowedge=ie4&&!window.opera?iecompattest().scrollTop+iecompattest().clientHeight-15:window.pageYOffset+window.innerHeight-18;dropmenuobj.contentmeasure=dropmenuobj.offsetHeight;if(windowedge-dropmenuobj.y<dropmenuobj.contentmeasure){edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight;if((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge;}}
return edgeoffset;}
function populatemenu(what){if(ie4||ns6)
dropmenuobj.innerHTML=what.join("");}
function dropdownmenu(obj,e,menucontents,menuwidth){if(window.event)
event.cancelBubble=true;else if(e.stopPropagation)
e.stopPropagation();clearhidemenu();dropmenuobj=document.getElementById?document.getElementById("dropmenudiv"):dropmenudiv;populatemenu(menucontents);if(ie4||ns6){showhide(dropmenuobj.style,e,"visible","hidden",menuwidth);dropmenuobj.x=getposOffset(obj,"left");dropmenuobj.y=getposOffset(obj,"top");dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj,"rightedge")+"px";dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj,"bottomedge")+obj.offsetHeight+"px";}
return clickreturnvalue();}
function clickreturnvalue(){if(ie4||ns6)
return false;else
return true;}
function contains_ns6(a,b){while(b.parentNode)
if((b=b.parentNode)==a)
return true;return false;}
function dynamichide(e){if(ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu();else if(ns6&&e.currentTarget!=e.relatedTarget&&!contains_ns6(e.currentTarget,e.relatedTarget))
delayhidemenu();}
function hidemenu(e){if(typeof dropmenuobj!="undefined"){if(ie4||ns6)
dropmenuobj.style.visibility="hidden";}}
function delayhidemenu(){if(ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay);}
function clearhidemenu(){if(typeof delayhide!="undefined")
clearTimeout(delayhide);}
if(hidemenu_onclick=="yes")
document.onclick=hidemenu;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;i<data.length;i++){var dataString=data[i].string;var dataProp=data[i].prop;this.versionSearchString=data[i].versionSearch||data[i].identity;if(dataString){if(dataString.indexOf(data[i].subString)!=-1)
return data[i].identity;}
else if(dataProp)
return data[i].identity;}},searchVersion:function(dataString){var index=dataString.indexOf(this.versionSearchString);if(index==-1)return;return parseFloat(dataString.substring(index+this.versionSearchString.length+1));},dataBrowser:[{string:navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari",versionSearch:"Version"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.userAgent,subString:"iPhone",identity:"iPhone/iPod"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};BrowserDetect.init();function setTabSession(newValue,where){var xmlHttp;try
{xmlHttp=new XMLHttpRequest();}
catch(e)
{try
{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e)
{try
{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e)
{alert("Your browser does not support AJAX!");return false;}}}
xmlHttp.onreadystatechange=function()
{if(xmlHttp.readyState==4)
{if(where=="Forum"){document.getElementById("tasksTop").className="navL4"
document.getElementById("productsTop").className="navL4"
document.getElementById("bizTop").className="navL4"
document.getElementById("industriesTop").className="navL4"
document.getElementById("classifiedsTop").className="navL4"
document.getElementById("expertTop").className="navL4"
document.getElementById(newValue+"Top").className="navL4On"}}}
xmlHttp.open('GET','/?tabSession@@!tab='+newValue+'&where='+where,true);xmlHttp.send(null);}
function setResourceBoxSession(opened,closed){document.getElementById(closed).style.display="none";document.getElementById(opened).style.display="block";var xmlHttp;try
{xmlHttp=new XMLHttpRequest();}
catch(e)
{try
{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e)
{try
{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e)
{alert("Your browser does not support AJAX!");return false;}}}
xmlHttp.onreadystatechange=function()
{if(xmlHttp.readyState==4)
{}}
xmlHttp.open('GET','/?resourceBoxSession@@!box='+opened,true);xmlHttp.send(null);}
function replaceQuote(curLoc,state){var xmlHttp;try
{xmlHttp=new XMLHttpRequest();}
catch(e)
{try
{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e)
{try
{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e)
{alert("Your browser does not support AJAX!");return false;}}}
xmlHttp.onreadystatechange=function()
{if(xmlHttp.readyState==4)
{var addQuote=document.getElementById("addQuote");var removeQuote=document.getElementById("cancelQuote");document.getElementById("quoteBox").innerHTML=xmlHttp.responseText;if(state==1){addQuote.style.display="none";removeQuote.style.display="block";}else{addQuote.style.display="block";removeQuote.style.display="none";}}}
xmlHttp.open('GET','/?replaceQuoteWithEdit@@!loc='+curLoc+'&state='+state,true);xmlHttp.send(null);}
function getFaqList(mainFaq,subFaqs,action){var xmlHttp;try
{xmlHttp=new XMLHttpRequest();}
catch(e)
{try
{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e)
{try
{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e)
{alert("Your browser does not support AJAX!");return false;}}}
xmlHttp.onreadystatechange=function()
{if(xmlHttp.readyState==4)
{divMainFaq=mainFaq.replace(/./,"div_");alert(divMainFaq);document.getElementById(divMainFaq).innerHTML=xmlHttp.responseText;}}
xmlHttp.open('GET','/?buildFaq@@!mainFaq='+mainFaq+'&subFaqs='+subFaqs+'&action='+action,true);xmlHttp.send(null);}
var req,req2;var divID,divID2;function loadXMLDoc(url,dID)
{divID=dID;if(window.XMLHttpRequest){req=new XMLHttpRequest();req.onreadystatechange=processReqChange;req.open("GET",url,true);req.send(null);}else if(window.ActiveXObject){req=new ActiveXObject("Microsoft.XMLHTTP");if(req){req.onreadystatechange=processReqChange;req.open("GET",url,true);req.send();}}}
function processReqChange()
{if(req.readyState==4){if(req.status==200){response=req.responseText;if(document.getElementById(divID).innerHTML)
document.getElementById(divID).innerHTML=response;else
document.getElementById(divID).value=response;}else{document.getElementById(divID).innerHTML="Problem retrieving information: "+req.status+" "+req.statusText;}}}
function loadXMLDoc2(url,dID,url2,dID2)
{divID=dID;divID2=dID2;if(window.XMLHttpRequest){req=new XMLHttpRequest();req.onreadystatechange=processReqChange;req.open("GET",url,true);req.send(null);req2=new XMLHttpRequest();req2.onreadystatechange=processReqChange2;req2.open("GET",url2,true);req2.send(null);}else if(window.ActiveXObject){req=new ActiveXObject("Microsoft.XMLHTTP");if(req){req.onreadystatechange=processReqChange;req.open("GET",url,true);req.send();}
req2=new ActiveXObject("Microsoft.XMLHTTP");if(req2){req2.onreadystatechange=processReqChange2;req2.open("GET",url2,true);req2.send();}}}
function processReqChange2()
{if(req2.readyState==4){if(req2.status==200){var response=req2.responseText;if(document.getElementById(divID2).innerHTML)
document.getElementById(divID2).innerHTML=response;else
document.getElementById(divID2).value=response;}else{document.getElementById(divID2).innerHTML="Problem retrieving information: "+req2.status+" "+req2.statusText;}}}
function formData2QueryString(docForm){if(!docForm)docForm=document.forms[0];var strSubmitContent='';var formElem;var strLastElemName='';for(i=0;i<docForm.elements.length;i++){formElem=docForm.elements[i];switch(formElem.type){case'text':case'hidden':case'password':case'textarea':case'select-one':strSubmitContent+=formElem.name+'='+escape(formElem.value)+'&'
break;case'radio':if(formElem.checked){strSubmitContent+=formElem.name+'='+escape(formElem.value)+'&'}
break;case'checkbox':if(formElem.checked){if(formElem.name==strLastElemName){if(strSubmitContent.lastIndexOf('&')==strSubmitContent.length-1){strSubmitContent=strSubmitContent.substr(0,strSubmitContent.length-1);}
strSubmitContent+=','+escape(formElem.value);}
else{strSubmitContent+=formElem.name+'='+escape(formElem.value);}
strSubmitContent+='&';}
break;}
strLastElemName=formElem.name}
strSubmitContent=strSubmitContent.substr(0,strSubmitContent.length-1);return strSubmitContent;}
function getkey(e)
{if(window.event)
return window.event.keyCode;else if(e)
return e.which;else
return null;}
function load2XMLDocs(url,div,url2,div2){return load2XmlDocs(url,div,url2,div2);}
function load3XMLDocs(url,div,url2,div2,url3,div3){return load3XmlDocs(url,div,url2,div2,url3,div3);}
function load2XmlDocs(url,div,url2,div2){new Ajax.Updater(div,url,{evalScripts:true,asynchronous:true,onComplete:function(element){new Ajax.Updater(div2,url2,{evalScripts:true,asynchronous:true})}});}
function load3XmlDocs(url,div,url2,div2,url3,div3){new Ajax.Updater(div,url,{evalScripts:true,asynchronous:true,onComplete:function(element){new Ajax.Updater(div2,url2,{evalScripts:true,asynchronous:true,onComplete:function(element){new Ajax.Updater(div3,url3,{evalScripts:true,asynchronous:true})}})}});}
var refresh_window=false;function handleUnloadEvent(){if(refresh_window){reload_parent_window(500);}else{jQuery(document).trigger("handleUnload");}}
var serializer={serialize:function(object){var values=[];var prefix='';values=this.recursive_serialize(object,values,prefix);param_string=values.join('&');return param_string;},recursive_serialize:function(object,values,prefix){for(key in object){if(typeof object[key]=='object'){if(prefix.length>0){prefix+='['+key+']';}else{prefix+=key;}
values=this.recursive_serialize(object[key],values,prefix);prefixes=prefix.split('[');if(prefixes.length>1){prefix=prefixes.slice(0,prefixes.length-1).join('[');}else{prefix=prefixes[0];}}
else{value=encodeURIComponent(object[key]);if(prefix.length>0){prefixed_key=prefix+'['+key+']'}else{prefixed_key=key}
prefixed_key=encodeURIComponent(prefixed_key);if(value)values.push(prefixed_key+'='+value);}}
return values;}};jQuery(document).ready(function(){jQuery("#nav-one li").hover(function(){jQuery("ul",this).fadeIn("fast");},function(){});if(document.all){jQuery("#nav-one li").hoverClass("sfHover");}});jQuery.fn.hoverClass=function(c){return this.each(function(){jQuery(this).hover(function(){jQuery(this).addClass(c);},function(){jQuery(this).removeClass(c);});});};(function($){$.extend($.fn,{livequery:function(type,fn,fn2){var self=this,q;if($.isFunction(type))
fn2=fn,fn=type,type=undefined;$.each($.livequery.queries,function(i,query){if(self.selector==query.selector&&self.context==query.context&&type==query.type&&(!fn||fn.$lqguid==query.fn.$lqguid)&&(!fn2||fn2.$lqguid==query.fn2.$lqguid))
return(q=query)&&false;});q=q||new $.livequery(this.selector,this.context,type,fn,fn2);q.stopped=false;$.livequery.run(q.id);return this;},expire:function(type,fn,fn2){var self=this;if($.isFunction(type))
fn2=fn,fn=type,type=undefined;$.each($.livequery.queries,function(i,query){if(self.selector==query.selector&&self.context==query.context&&(!type||type==query.type)&&(!fn||fn.$lqguid==query.fn.$lqguid)&&(!fn2||fn2.$lqguid==query.fn2.$lqguid)&&!this.stopped)
$.livequery.stop(query.id);});return this;}});$.livequery=function(selector,context,type,fn,fn2){this.selector=selector;this.context=context||document;this.type=type;this.fn=fn;this.fn2=fn2;this.elements=[];this.stopped=false;this.id=$.livequery.queries.push(this)-1;fn.$lqguid=fn.$lqguid||$.livequery.guid++;if(fn2)fn2.$lqguid=fn2.$lqguid||$.livequery.guid++;return this;};$.livequery.prototype={stop:function(){var query=this;if(this.type)
this.elements.unbind(this.type,this.fn);else if(this.fn2)
this.elements.each(function(i,el){query.fn2.apply(el);});this.elements=[];this.stopped=true;},run:function(){if(this.stopped)return;var query=this;var oEls=this.elements,els=$(this.selector,this.context),nEls=els.not(oEls);this.elements=els;if(this.type){nEls.bind(this.type,this.fn);if(oEls.length>0)
$.each(oEls,function(i,el){if($.inArray(el,els)<0)
$.event.remove(el,query.type,query.fn);});}
else{nEls.each(function(){query.fn.apply(this);});if(this.fn2&&oEls.length>0)
$.each(oEls,function(i,el){if($.inArray(el,els)<0)
query.fn2.apply(el);});}}};$.extend($.livequery,{guid:0,queries:[],queue:[],running:false,timeout:null,checkQueue:function(){if($.livequery.running&&$.livequery.queue.length){var length=$.livequery.queue.length;while(length--)
$.livequery.queries[$.livequery.queue.shift()].run();}},pause:function(){$.livequery.running=false;},play:function(){$.livequery.running=true;$.livequery.run();},registerPlugin:function(){$.each(arguments,function(i,n){if(!$.fn[n])return;var old=$.fn[n];$.fn[n]=function(){var r=old.apply(this,arguments);$.livequery.run();return r;}});},run:function(id){if(id!=undefined){if($.inArray(id,$.livequery.queue)<0)
$.livequery.queue.push(id);}
else
$.each($.livequery.queries,function(id){if($.inArray(id,$.livequery.queue)<0)
$.livequery.queue.push(id);});if($.livequery.timeout)clearTimeout($.livequery.timeout);$.livequery.timeout=setTimeout($.livequery.checkQueue,20);},stop:function(id){if(id!=undefined)
$.livequery.queries[id].stop();else
$.each($.livequery.queries,function(id){$.livequery.queries[id].stop();});}});$.livequery.registerPlugin('append','prepend','after','before','wrap','attr','removeAttr','addClass','removeClass','toggleClass','empty','remove');$(function(){$.livequery.play();});var init=$.prototype.init;$.prototype.init=function(a,c){var r=init.apply(this,arguments);if(a&&a.selector)
r.context=a.context,r.selector=a.selector;if(typeof a=='string')
r.context=c||document,r.selector=a;return r;};$.prototype.init.prototype=$.prototype;})(jQuery);