grFlLdr={},grFlLdr.isIE=navigator.appVersion.indexOf("MSIE")!=-1?!0:!1,grFlLdr.isWin=navigator.appVersion.toLowerCase().indexOf("win")!=-1?!0:!1,grFlLdr.isOpera=navigator.userAgent.indexOf("Opera")!=-1?!0:!1,grFlLdr.ControlVersion=function(){var n,t,i;try{t=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"),n=t.GetVariable("$version")}catch(i){}if(!n)try{t=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"),n="WIN 6,0,21,0",t.AllowScriptAccess="always",n=t.GetVariable("$version")}catch(i){}if(!n)try{t=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3"),n=t.GetVariable("$version")}catch(i){}if(!n)try{t=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3"),n="WIN 3,0,18,0"}catch(i){}if(!n)try{t=new ActiveXObject("ShockwaveFlash.ShockwaveFlash"),n="WIN 2,0,0,11"}catch(i){n=-1}return n},grFlLdr.GetSwfVer=function(){var t=-1;if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var e=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"",f=navigator.plugins["Shockwave Flash"+e].description,i=f.split(" "),r=i[2].split("."),o=r[0],u=r[1],n=i[3];n==""&&(n=i[4]),n[0]=="d"?n=n.substring(1):n[0]=="r"&&(n=n.substring(1),n.indexOf("d")>0&&(n=n.substring(0,n.indexOf("d")))),t=o+"."+u+"."+n}}else navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1?t=4:navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1?t=3:navigator.userAgent.toLowerCase().indexOf("webtv")!=-1?t=2:grFlLdr.isIE&&grFlLdr.isWin&&!grFlLdr.isOpera&&(t=grFlLdr.ControlVersion());return t},grFlLdr.DetectFlashVer=function(n,t,i){versionStr=grFlLdr.GetSwfVer();if(versionStr==-1)return!1;if(versionStr!=0){grFlLdr.isIE&&grFlLdr.isWin&&!grFlLdr.isOpera?(tempArray=versionStr.split(" "),tempString=tempArray[1],versionArray=tempString.split(",")):versionArray=versionStr.split(".");var u=versionArray[0],r=versionArray[1],f=versionArray[2];if(u>parseFloat(n))return!0;if(u==parseFloat(n)){if(r>parseFloat(t))return!0;if(r==parseFloat(t))if(f>=parseFloat(i))return!0}return!1}},grFlLdr.AC_AddExtension=function(n,t){return n.indexOf("?")!=-1?n.replace(/\?/,t+"?"):n+t},grFlLdr.AC_Generateobj=function(n,t,i){var u="",r;if(grFlLdr.isIE&&grFlLdr.isWin&&!grFlLdr.isOpera){u+="<object ";for(r in n)u+=r+'="'+n[r]+'" ';u+=">";for(r in t)u+='<param name="'+r+'" value="'+t[r]+'" /> ';u+="</object>"}else{u+="<embed ";for(r in i)u+=r+'="'+i[r]+'" ';u+="> </embed>"}return u},grFlLdr.AC_FL_RunContent=function(){var n=grFlLdr.AC_GetArgs(arguments,".swf","movie","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash");return grFlLdr.AC_Generateobj(n.objAttrs,n.params,n.embedAttrs,parent)},grFlLdr.AC_GetArgs=function(n,t,i,r,u){var e={},f,o;for(e.embedAttrs={},e.params={},e.objAttrs={},f=0;f<n.length;f=f+2){o=n[f].toLowerCase();switch(o){case"classid":break;case"pluginspage":e.embedAttrs[n[f]]=n[f+1];break;case"src":case"movie":n[f+1]=grFlLdr.AC_AddExtension(n[f+1],t),e.embedAttrs.src=n[f+1],e.params[i]=n[f+1];break;case"onafterupdate":case"onbeforeupdate":case"onblur":case"oncellchange":case"onclick":case"ondblClick":case"ondrag":case"ondragend":case"ondragenter":case"ondragleave":case"ondragover":case"ondrop":case"onfinish":case"onfocus":case"onhelp":case"onmousedown":case"onmouseup":case"onmouseover":case"onmousemove":case"onmouseout":case"onkeypress":case"onkeydown":case"onkeyup":case"onload":case"onlosecapture":case"onpropertychange":case"onreadystatechange":case"onrowsdelete":case"onrowenter":case"onrowexit":case"onrowsinserted":case"onstart":case"onscroll":case"onbeforeeditfocus":case"onactivate":case"onbeforedeactivate":case"ondeactivate":case"type":case"codebase":e.objAttrs[n[f]]=n[f+1];break;case"id":case"width":case"height":case"align":case"vspace":case"hspace":case"class":case"title":case"accesskey":case"name":case"tabindex":e.embedAttrs[n[f]]=e.objAttrs[n[f]]=n[f+1];break;default:e.embedAttrs[n[f]]=e.params[n[f]]=n[f+1]}}return e.objAttrs.classid=r,u&&(e.embedAttrs.type=u),e},grFlLdr.windowOpen=function(n){var i=function(n){var t=!1;try{t=typeof n=="undefined"?!0:n&&n.closed?!1:n&&n.test?!1:!0}catch(i){}return t},t=window.open(n+(n.indexOf("?")>-1?"&":"?")+"r="+Math.random()*99999999,"screenX=100");return i(t)},Sys&&Sys.Application&&Sys.Application.notifyScriptLoaded();window.grWriteFlash=function(n,t,i,r,u,f,e,o,s){var v=10,k=0,w=0,b=grFlLdr.DetectFlashVer(6,0,65),l=grFlLdr.DetectFlashVer(v,k,w),c,p,a,y,h;b&&!l?(p=grFlLdr.isIE==!0?"ActiveX":"PlugIn",a=window.location,document.title=document.title.slice(0,47)+" - Flash Player Installation",y=document.title,c="<br />For your security, Loogla only runs on Flash Player 10. <br /> <br /> <a href=http://www.adobe.com/go/getflash/>Get Flash</a>"):c=l?grFlLdr.AC_FL_RunContent("src",o+r,"width",f,"height",e,"align","middle","id",i,"FlashVars",u,"quality","high","bgcolor",s,"name",r,"allowScriptAccess","always","type","application/x-shockwave-flash","pluginspage","http://www.adobe.com/go/getflashplayer","wmode","opaque"):"<br />Loogla: <br /> No Flash Player detected. If you've already installed it, please check your <a href='http://kb2.adobe.com/cps/191/tn_19166.html#main_VerifyIE' alt='Flash Player Settings'>Flash Player settings</a><br /> <br /> <a href=http://www.adobe.com/go/getflash/>Get Flash</a>",h=document.createElement("DIV"),h.id=t,n.appendChild(h),h.innerHTML=c,e=="100%"&&(h.style.position="absolute",h.style.left=h.style.right=h.top="0",h.style.height="100%")},Sys&&Sys.Application&&Sys.Application.notifyScriptLoaded();function findPos(n){var t=curtop=0;if(n.offsetParent)do t+=n.offsetLeft,curtop+=n.offsetTop;while(n=n.offsetParent);return[t,curtop]}function f_clientWidth(){return f_filterResults(window.innerWidth?window.innerWidth:0,document.documentElement?document.documentElement.clientWidth:0,document.body?document.body.clientWidth:0)}function f_clientHeight(){return f_filterResults(window.innerHeight?window.innerHeight:0,document.documentElement?document.documentElement.clientHeight:0,document.body?document.body.clientHeight:0)}function f_scrollLeft(){return f_filterResults(window.pageXOffset?window.pageXOffset:0,document.documentElement?document.documentElement.scrollLeft:0,document.body?document.body.scrollLeft:0)}function f_scrollTop(){return f_filterResults(window.pageYOffset?window.pageYOffset:0,document.documentElement?document.documentElement.scrollTop:0,document.body?document.body.scrollTop:0)}function f_filterResults(n,t,i){var r=n?n:0;return t&&(!r||r>t)&&(r=t),i&&(!r||r>i)?i:r}function detectDoctype(){var t=/\s+(X?HTML)\s+([\d\.]+)\s*([^\/]+)*.*/gi,n=!1;return n=typeof document.namespaces!="undefined"?document.all[0].nodeType==8?t.test(document.all[0].nodeValue):!1:document.doctype!=null?t.test(document.doctype.publicId):!1,n?(n={},n.xhtml=RegExp.$1,n.version=RegExp.$2,n.importance=RegExp.$3,n.isDtd=document.all[0].nodeValue.match(t)[0].endsWith(".dt"),n):null}function setBodyHeightToContentHeight(){var t=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),n=document.body.style.height;t>n+20&&(n=t+"px")}setBodyHeightToContentHeight();function trimOverride(){return this.replace(/^[\s\xA0]+|[\s\xA0]+$/g,"")}Sys.Application.add_init(function(){String.prototype.trim=trimOverride});if(Sys.Browser.agent==Sys.Browser.InternetExplorer){var grDocType=detectDoctype();Sys.Browser.version>6||grDocType&&grDocType.isDtd?Sys.UI.DomElement.getLocation=function(n){var r,t,f;if(n.self||n.nodeType===9)return new Sys.UI.Point(0,0);if(n==document.body||n.ownerDocument.documentElement==n)return new Sys.UI.Point(0,0);r=n.getClientRects();if(!r||!r.length)return new Sys.UI.Point(0,0);var u=n.ownerDocument.parentWindow,e=u.screenLeft-top.screenLeft-top.document.documentElement.scrollLeft+2,o=u.screenTop-top.screenTop-top.document.documentElement.scrollTop+2,i=u.frameElement||null;return i&&(t=i.currentStyle,e+=(i.frameBorder||1)*2+(parseInt(t.paddingLeft)||0)+(parseInt(t.borderLeftWidth)||0)-n.ownerDocument.documentElement.scrollLeft,o+=(i.frameBorder||1)*2+(parseInt(t.paddingTop)||0)+(parseInt(t.borderTopWidth)||0)-n.ownerDocument.documentElement.scrollTop),f=r[0],new Sys.UI.Point(f.left-e,f.top-o)}:(grDocType||$addHandler(window,"resize",setBodyHeightToContentHeight),Sys.UI.DomElement.getLocation=function(n){var o=Function._validateParams(arguments,[{name:"element",domElement:!0}]),r,t,u;if(o)throw o;if(n.self||n.nodeType===9)return new Sys.UI.Point(0,0);if(n==document.body||n.ownerDocument.documentElement==n)return new Sys.UI.Point(0,0);r=n.getClientRects();if(!r||!r.length)return new Sys.UI.Point(0,0);var f=n.ownerDocument.parentWindow,e=f.screenLeft-top.screenLeft-f_scrollLeft()+2,s=f.screenTop-top.screenTop-f_scrollTop()+2,i=f.frameElement||null;return i&&(t=i.currentStyle,e+=(i.frameBorder||1)*2+(parseInt(t.paddingLeft)||0)+(parseInt(t.borderLeftWidth)||0)-f_scrollLeft(),s+=(i.frameBorder||1)*2+(parseInt(t.paddingTop)||0)+(parseInt(t.borderTopWidth)||0)-f_scrollTop()),u=r[0],new Sys.UI.Point(u.left-e,u.top-s)})}Sys&&Sys.Application&&Sys.Application.notifyScriptLoaded();Type.registerNamespace("Grammit"),window.$grGlob=function(){window.grSys=Sys,window.$grCreate=$create,typeof $AA!="undefined"&&(window.$gAn=$AA),Sys.Application.remove_init($grGlob)},typeof grSys=="undefined"&&Sys.Application.add_init($grGlob),Grammit.Avatar=function(n){Grammit.Avatar.initializeBase(this,[n]),this._clickDel=null,this._act=null,this._preAct=null,this._g=null,this._d},Grammit.Avatar.prototype={initialize:function(){Grammit.Avatar.callBaseMethod(this,"initialize"),this._clickDel===null&&(this._clickDel=Function.createDelegate(this,this.clickHandler)),$addHandler(this._element,"click",this._clickDel)},dispose:function(){var n,t,u,r,f,i;if(this._d)return;this._d=!0,n=this.get_element(),this._clickDel&&$removeHandler(n,"click",this._clickDel),delete this._clickDel,this._act&&(this._act._g=null,this._act.dispose.call(this._act));if(t=this._preAct)for(u in t.vars)(r=t.vars[u])&&(f=t._txt[u])&&($rCSS(r,"grDecoy"),r.innerHTML=f),this._preAct=null;this._g&&(i=this._g._av)&&(Array.remove(i,this),i.length||(this._g._av=null)),n!=undefined&&(n.parentNode.removeChild(n),delete n),Grammit.Avatar.callBaseMethod(this,"dispose")},clickHandler:function(n){return this._preAct&&Grammit.AM.initAct(this,n),!1}},Grammit.Avatar.registerClass("Grammit.Avatar",Sys.UI.Control),Grammit.TextSpan=function(n){Grammit.TextSpan.initializeBase(this,[n]),this._mouseDownDelegate=null,this._mouseUpDelegate=null,this._clickDel=null,this._av=null,this._nAvID=0,this._dragVisual=null,this._oldVisibility=null,this._isHdn=!1,this._fla=null},Grammit.TextSpan.prototype={initialize:function(){Grammit.TextSpan.callBaseMethod(this,"initialize");var n=this.get_element();this._clickDel===null&&(this._clickDel=Function.createDelegate(this,this.clickHandler)),$addHandler(n,"click",this._clickDel)},dispose:function(){this.disposeMouseDown(),$AM.highlight("act",null,this.get_element(),!1),this._clickDel&&$removeHandler(this.get_element(),"click",this._clickDel),delete this._clickDel,Grammit.TextSpan.callBaseMethod(this,"dispose")},clickHandler:function(n){if(n.altKey&&(!this._av||!this._av.length)){var i=["grMN","grMD","grMT"],t=this.get_element();return t.style.cursor=="pointer"&&i.push("grYon"),Grammit.PM.showPopup(t,3,"<b>"+t.innerHTML+"</b> detail","gr_"+$grmKey(t),null,i),n.stopPropagation(),!1}},flash:function(n){this._fla={g:this,t:n}},initMouseDown:function(){this._mouseDownDelegate===null&&(this._mouseDownDelegate=Function.createDelegate(this,this.mouseDownHandler),$addHandler(this._element,"mousedown",this._mouseDownDelegate))},disposeMouseDown:function(){this._mouseDownDelegate&&$removeHandler(this.get_element(),"mousedown",this._mouseDownDelegate),this._mouseDownDelegate=null,delete this._mouseDownDelegate},mouseDownHandler:function(n){var t,r,e,i,f,u;if(n.ctrlKey&&this._fla){for(window._event=n,this._visual==null&&(t=this.get_element(),this._visual=t.cloneNode(!0),this._visual.id="drag"+t.id,document.body.appendChild(this._visual),Sys.UI.DomElement.addCssClass(this._visual,"grDgWd"),r=Sys.UI.DomElement.getLocation(t),Sys.UI.DomElement.setLocation(this._visual,r.x,r.y)),e=document.getElementsByTagName("img"),i=0;f=e[i];i++)u=new Grammit.grImageDropTargetBehavior(f),u.initialize();this._mouseUpDelegate===null&&(this._mouseUpDelegate=Function.createDelegate(this,this.mouseUpHandler),$addHandler(this._element,"mouseup",this._mouseUpDelegate)),Sys.Extended.UI.DragDropManager.startDragDrop(this,this._visual,null)}},mouseUpHandler:function(){for(var i=Sys.Application._disposableObjects,r=Grammit.grImageDropTargetBehavior,t=0;t<i.length;t++)r.isInstanceOfType(i[t])&&i[t].dispose();this._mouseUpDelegate&&$removeHandler(this.get_element(),"mouseup",this._mouseUpDelegate),this._mouseUpDelegate=null,delete this._mouseUpDelegate},get_dragDataType:function(){return"wordDragData"},getDragData:function(){return this._fla},get_dragMode:function(){return Sys.Extended.UI.DragMode.Copy},onDragStart:function(){},onDrag:function(){},onDragEnd:function(){this._visual&&(this._visual.parentNode.removeChild(this._visual),this._visual=null)},disposeActs:function(){while(this._av&&this._av.length>0)this._av[0].dispose()}},Grammit.TextSpan.registerClass("Grammit.TextSpan",Sys.UI.Control),Grammit.grImgDrop=function(n,t,i){var r=Grammit.grImgDrop,u,f;r.live&&(u=$find(r.live.id),r.undoFlashable(u)),r.live=n,u=r.gCom=$find(n.id),u.flash.call(u,t),u.initMouseDown(),$AM.highlight("act",null,n,!0),r._closePopDelegate=Function.createDelegate(r,r.closePop),$GP.addPopClosedListener(r._closePopDelegate),f="<strong>Create an Image Flashcard</strong><br /><hr /><u>Instructions</u>:<br/>[CTRL]+Drag the word <i>"+n.innerText+"</i> onto any image in the web page and it will create a flashcard for that word/translation.  <br /><br /> If there isn't a usable image or you want to make a video flashcard, you can create one for this word in the <a href=\""+$grBasePath+"learn/VocabFlashcardStudio.aspx?tID="+t+'" target="_blank">Flashcard Maker</a>.<br /><br />',i==="1"&&(f+='To manage flashcards, go to your <a href="'+$grBasePath+'FlashCards/Flashcard-Bank.aspx" target="_blank">FlashCard Bank</a>.'),Grammit.PM.showPopup(n,3,"Making Flash Card",(i==="1"?"flaReq":"flaAnon")+"_"+t,f,[],-40)},Grammit.grImgDrop.closePop=function(){this._closePopDelegate&&Grammit.grImgDrop.undoFlashable(this.gCom)},Grammit.grImgDrop.live=null,Grammit.grImgDrop.undoFlashable=function(n){var i,r,t;for(n._fla=null,i=Sys.Application._disposableObjects,r=Grammit.grImageDropTargetBehavior,t=0;t<i.length;t++)r.isInstanceOfType(i[t])&&i[t].dispose();this._closePopDelegate&&$GP.removePopClosedListener(this._closePopDelegate),this._closePopDelegate=null,delete this._closePopDelegate,n.disposeMouseDown.call(n.disposeMouseDown),Grammit.grImgDrop.live=null,$AM.highlight("act",null,n.get_element(),!1)},Grammit.grImageDropTargetBehavior=function(n){Grammit.grImageDropTargetBehavior.initializeBase(this,[n]),this._bdThick=null,this._bdColor=null,this._bdStyle=null},Grammit.grImageDropTargetBehavior.prototype={get_dropTargetElement:function(){return this.get_element()},canDrop:function(n,t,i){return t=="wordDragData"&&i},drop:function(n,t,i){if(t=="wordDragData"&&i){Grammit.PM.showPopup(i.g.get_element(),2,"Flash Card","fla_"+i.t+"_"+($GP.IE?this.get_element().href:this.get_element().src),"",[]);this.onDragLeaveTarget(n,t,i);Grammit.grImgDrop.undoFlashable(i.g)}},onDragEnterTarget:function(n,t,i){if(t=="wordDragData"&&i){var r=this.get_element();r.o_borderStyle=r.style.borderStyle,r.o_borderWidth=r.style.borderWidth,r.o_borderColor=r.style.borderColor,r.style.borderStyle="dashed",r.style.borderWidth="2px",r.style.borderColor="#FFBE40"}},onDragLeaveTarget:function(n,t,i){if(t=="wordDragData"&&i){var r=this.get_element();r.style.borderStyle=r.o_borderStyle,r.style.borderWidth=r.o_borderWidth,r.style.borderColor=r.o_borderColor}},onDragInTarget:function(){},initialize:function(){Grammit.grImageDropTargetBehavior.callBaseMethod(this,"initialize"),Sys.Extended.UI.DragDropManager.registerDropTarget(this)},dispose:function(){Sys.Extended.UI.DragDropManager.unregisterDropTarget(this),Grammit.grImageDropTargetBehavior.callBaseMethod(this,"dispose"),Sys.Application.unregisterDisposableObject(this)}},Grammit.regGrImgDrop=function(n){Sys.Extended!=undefined&&(Grammit.grImageDropTargetBehavior.registerClass("Grammit.grImageDropTargetBehavior",Sys.UI.Behavior,Sys.Extended.UI.IDropTarget,Sys.IDisposable),n==Sys.Application&&Sys.Application.remove_load(Grammit.regGrImgDrop))},Sys.Application._loaded?Grammit.regGrImgDrop():Sys.Application.add_load(Grammit.regGrImgDrop),Sys&&Sys.Application&&Sys.Application.notifyScriptLoaded();Type.registerNamespace("Grammit"),Grammit.enableSection=function(n){var i=n.target,t;n.target.tagName.toUpperCase()=="G"&&($find(n.target.id)||(t=$create(Grammit.TextSpan,{element:{style:{fontWeight:"normal"}}},null,null,n.target),t._clickDel(n)))},window.$rCSS=Sys.UI.DomElement.removeCssClass,window.$aCSS=Sys.UI.DomElement.addCssClass,Grammit.Activity=function(n){Grammit.Activity.initializeBase(this,[n]),this._type,this._content=null,this._sub=null,this._act=null,this._cs=[],this._gram=null,this._av=null,this._expr=null,this._strings=[],this._ansType="ans",this._submitDelegate=null,this._vars=null,this._txt=null,this._eval=!1,this._disp=!1,this._submitters=[],this._showBtn=null,this._showDel=null,this._shown=!1,this._hidable=!1},Grammit.Activity.prototype={initialize:function(){this._submitDelegate===null&&(this._submitDelegate=Function.createDelegate(this,this.submit))},submit:function(n){var u,i,t,r,f;n&&n.stopPropagation(),u=-1,i=!1;switch(this._type){case 2:r=n.target;while(r.id==="")r=r.parentNode;u=r.id.split("_")[1],i=eval(this._expr[u]),t=this._strings[u];break;case 4:case 1:case 3:case 6:i=eval(this._expr[0]),t=i?this._strings[0]:this._strings[1]}t||(t=i?Grammit.AM._defCor:Grammit.AM._defInCor),t="<div style='text-align:center;'>"+t+"</div>",f=[this._ansType,this._gram.id,i,this._sub,this._act,grPgID,this._eval].join("_"),$GP.showPopup(this._gram,2,i?"Muy Bien!":"Lo Siento",f,t),this.dispose()},addSubmitter:function(n){n?($addHandler(n,"click",this._submitDelegate),this._submitters.push(n)):alert("submit not found")},dispose:function(){var r,i,t,n;if(this._disp)return;this._disp=!0,r=$find(this._gram.id),$AM.highlight("act",null,this._gram,!1);while(i=this._submitters.pop())$removeHandler(i,"click",this._submitDelegate);$GP.disposeMenu(this._content),this._content!=null&&(this._content.parentNode.parentNode.removeChild(this._content.parentNode),delete this._content);for(t in this._vars)$rCSS(this._vars[t],"grHigh"),$rCSS(this._vars[t],"grDecoy"),$rCSS(this._vars[t],"grEmpty");n=this._gram;while((n=n.parentNode)&&n.nodeType===1)n.tagName.toUpperCase()=="A"&&$AM.toggleAnchor(n,!1);this._vars=null,this._gram=null,this._txt=null,Grammit.Activity.callBaseMethod(this,"dispose"),this.disposeComp(),Sys.Application.unregisterDisposableObject(this._av),this._av._element&&this._av.dispose()},disposeComp:function(){for(var n,t=0;t<this._cs.length;t++)n=$find(this._cs[t]),n&&n._element&&n.dispose();Array.clear(this._cs)},subDesc:function(){return this._strings[this._strings.length-1]},shrinkHandle:function(){this._showBtn=this._av._element,this._showDel=Function.createDelegate(this,this.toggleShow),$addHandler(this._showBtn,"click",this._showDel,!0)},toggleShow:function(){this._shown=!this._shown;var n=this._shown?$AA.FadeOutAnimation:$AA.FadeInAnimation;n.play(this._content,.3,30,.2,1,!0)},get_content:function(){return this._content},set_content:function(n){this._content=n},get_gram:function(){return this._gram},set_gram:function(n){this._gram=n},get_av:function(){return this._av},set_av:function(n){this._av=n},get_type:function(){return this._type},set_type:function(n){this._type=n},get_strings:function(){return this._strings},set_strings:function(n){this._strings=n},get_sub:function(){return this._sub},set_sub:function(n){this._sub=n},get_act:function(){return this._act},set_act:function(n){this._act=n},get_vars:function(){return this._vars},set_vars:function(n){this._vars=n},get_txt:function(){return this._txt},set_txt:function(n){this._txt=n},get_expr:function(){return this._expr},set_expr:function(n){this._expr=n},add_Comp:function(n){Array.add(this._cs,n)},get_eval:function(){return this._eval},set_eval:function(n){this._eval=n},get_ansType:function(){return this._ansType},set_ansType:function(n){this._ansType=n===""?"ans":n}},Grammit.Activity.registerClass("Grammit.Activity",Sys.UI.Control),Grammit._AM=function(){this._div=null,this.spacer="  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;",this._defInCor="La respuesta no fue corecta.",this._defCor="La respuesta fue corecta!",this._enableGramsDel,this.avElm,this.actCont,this.actComp,this.IE=Sys.Browser.agent==Sys.Browser.InternetExplorer},Grammit._AM.prototype={init:function(){this._div=$get("grActCont"),$AM.IE||(HTMLElement.prototype.click=function(){var n=this.ownerDocument.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,this.ownerDocument.defaultView,1,0,0,0,0,!1,!1,!1,!1,0,null),this.dispatchEvent(n)}),this._enableGramsDel=Function.createDelegate(this,Grammit.enableSection),$addHandler(document.body,"click",this._enableGramsDel)},dispose:function(){$removeHandler(document.body,"click",this._enableGramsDel),delete this._enableGramsDel},onTimeout:function(n){alert("Timed out"+n.get_message())},addContent:function(n){if(n!=""){var t=document.createElement("div");return t.innerHTML=n,t.firstChild.style.zIndex=99999,this._div.appendChild(t),t}},createActs:function(n){for(var b=typeof $G.hidden!="undefined",t,o,h,r,s,l,f,e,i,u,a=0;t=n[a];a++)if(t.ActType==14){if(b){var v=parseInt(t.ActID),w=parseInt(t.SubID),y=$G.hidden;for(Sys.Debug.trace("unhide "+v+" - "+w),o=v;o<=w;o++)h=y[o],h&&(h.style.color=h.style.backgroundColor="",delete y[o])}}else{r=$get(t.GramID);if(!r)continue;s=$find(t.GramID),s==null&&($clearHandlers(r),s=$create(Grammit.TextSpan,null,null,null,r));var k=$AM.addAvatar(s,t.ActType+".png"),p=Sys.Serialization.JavaScriptSerializer.deserialize,c=t.vars=p(t.vars);for(l in c)c[l]="$get('gr"+c[l]+"')";t.vars.grRoot||(t.vars.grRoot=r),t.css=p(t.css),t._txt={},f=null;for(e in t.css)t.css[e]==0&&(i=t.vars[e],typeof i=="string"&&(i=t.vars[e]=eval(i)),t._txt[e]=$AM.IE?i.innerText:i.innerHTML,f&&(i.previousSibling==f||i.nextSibling==f)?($aCSS(i,"grEmpty"),i.innerHTML=""):($aCSS(i,"grDecoy"),i.innerHTML=Grammit.AM.spacer),f=i);k._preAct=t,u=r;while((u=u.parentNode)&&u.nodeType===1)u.tagName.toUpperCase()=="A"&&$AM.toggleAnchor(u,!0)}},clearActs:function(){for(var r=Grammit.Avatar,t=Array.clone(Sys.Application._disposableObjects),n=0,i=t.length;n<i;n++)r.isInstanceOfType(t[n])&&t[n].dispose()},unhideAll:function(){var t=$G.hidden,r,i,n;if(t)for(r in t)i=t[r],i&&(n=i.style,n.textShadow=n.color=n.backgroundColor="",delete r);delete $G.hidden,$get("grPopHdr").innerHTML.indexOf("Creating")>-1&&$GP.hidePopup()},addAvatar:function(n,t){var i=document.createElement("img"),f,u,r,e;i.src=$grBasePath+"images/act/"+t,i.alt="Click to show activity.",$aCSS(i,"grAv"),f=n._element,i.id=f.id+"_a"+n._nAvID++,f.parentNode.insertBefore(i,f),u=$create(Grammit.Avatar,null,null,null,i);if(n._av&&n._av.length>0)for(e=0;n._av!=undefined&&(r=n._av[e]);e++)r._act?r._act.dispose():r.dispose();return n._av=[],n._av.push(u),u._g=n,u},initAct:function(n,t){var a,e,r,u,v,o,h,s,c;if(n._act)return;a=$AM.avElm=n.get_element(),e=n._g.get_element(),$AM.highlight("act",null,e,!0);var i=n._preAct,f=$AM.actCont=$AM.addContent(i.HTML).firstChild,l=$find(f.id);for(l&&l.dispose(),r=$AM.actComp=$create(Grammit.Activity,{content:f,act:i.ActID,sub:i.SubID,vars:i.vars,txt:i._txt,gram:e,av:n,type:i.ActType,strings:i.Feedback,expr:i.Exp,gramCSS:i.GramCSS,auxCSS:i.AuxCSS,eval:i.eval,ansType:i.Ct},null,null,f),u=0;u<i.CompCreate.length;u++)v=eval(i.CompCreate[u]),r.add_Comp(v.get_id()),i.CompCreate[u].indexOf("Float")>0&&(r._hidable=!0);for(o in r._vars)h=r._vars[o],typeof h=="string"&&(r._vars[o]=eval(h));n._act=r,eval(i.Init),$GP.hookClickableIDs.apply($GP,[f,e]),$AM.IE&&typeof $grHov!="undefined"&&$grHov(f),s=a._events.click,c=s.length,c>0&&s[c-1].handler(t),r._hidable&&r.shrinkHandle.apply(r)},createGrams:function(n,t,i){var f=i?$get(n,eval(i)):$get(n),s,o,h,u,r,e;if(f){for(o=0;s=f.children[o];o++)(oGc=$find(s.id))&&oGc.dispose();f.innerHTML="",typeof t=="string"&&(t=Sys.Serialization.JavaScriptSerializer.deserialize(t));for(u in t)($AM.IE||u!="keys")&&(r=document.createElement("G"),r.id="gr"+u,r.innerHTML=t[u],f.appendChild(r),e=$find(r.id),e!=null&&e.dispose())}else alert("No element to create Grams within")},highlight:function(n,t,i,r){var u,o="grHigh",e,f;n=="act"?(o="grHasAct",u=i):n=="cue"?(e=$find(t),u=e._vars[i]):n=="gr"&&(u=$get(t)),u&&(f=r?$aCSS:$rCSS,f(u,o))},clear:function(n,t){var i=parent?$get(n,eval(t)):$get(n);i.innerHTML=""},disposeAct:function(n){var t;(t=$find(n))&&t.dispose.call(t)},toggleAnchor:function(n,t){if(t){var i=n.getAttribute("href");i&&i!=""&&i!=null&&n.setAttribute("href_bak",i),n.removeAttribute("href")}else n.setAttribute("href",n.attributes.href_bak.nodeValue)},dynPop:function(n,t,i,r,u,f){if("FL"===$G.mode)$G.getGrammit().webCall({contextKey:i},t,f,$grBasePath+r+"/"+u);else if("H5"===$G.mode)$G.sendGrammit({service:$grBasePath+r+"/"+u,parms:{contextKey:i},cbFunc:f,context:t});else{var e=$find(n);e._dynamicPopulateBehavior||(e._DynamicContextKey=i,e._DynamicServicePath=$grBasePath+r,e._DynamicServiceMethod=u,e._DynamicControlID=t,e._dynamicPopulateBehavior=$create(Sys.Extended.UI.DynamicPopulateBehavior,{id:e.get_id()+"_DynamicPopulateBehavior",ContextKey:i,ServicePath:$grBasePath+r,ServiceMethod:u,ClearContentsDuringUpdate:!1},null,null,$get(t)))}}},Grammit._AM.registerClass("Grammit._AM"),$AM=Grammit.AM=new Grammit._AM,$grLog=Grammit.AM.logAnswer,Sys.Application.add_init(Function.createDelegate(Grammit.AM,Grammit.AM.init)),Sys.Application.add_unload(Function.createDelegate(Grammit.AM,Grammit.AM.dispose)),Sys&&Sys.Application&&Sys.Application.notifyScriptLoaded();Type.registerNamespace("Grammit"),Grammit._PM=function(){this._drillHis=[],this._popupEx=null,this._pBhr=null,this._pDpb=null,this._initDel=null,this._dispDel=null,this._drillbackDel=null,this._grPopupLoadedDel=null,this._transDel=null,this._takeNoteDel=null,this._alreadyYonderDel=null,this.popElm=null,this._menus=null,this._ld=null,this._bdy=null,this._db=null,this._clkMens={subHis:["Subject Detail",[]],pro:["Pronunciation",["grMD","grMN","grMT"]],note:["Word Notes",[]],conj:["Conjugation",["grMD","grMN"]]},this._regSpClk=/^(?:les|voc|phrVoc|catSv|fl(?:a|Del|Flip)|notEd|notAdd|grCap)/,this.IE=Sys.Browser.agent==Sys.Browser.InternetExplorer,this._events=null},Grammit._PM.prototype={init:function(){var r=$get("grPopupClose"),i,n,t;r&&$addHandler(r,"click",this.hidePopup),i=$get("grBotClose"),i&&$addHandler(i,"click",this.hidePopup),this._ld=$get("grImgLd"),this._drillbackDel===null&&(this._drillbackDel=Function.createDelegate(this,this.drillBack)),_db=$get("grDrillback"),_db&&($addHandler(_db,"click",this._drillbackDel),_db.style.display="none"),this._grPopupLoadedDel===null&&(this._grPopupLoadedDel=Function.createDelegate(this,this.grPopupLoaded)),this._transDel==null&&(this._transDel=Function.createDelegate(this,this.trans)),this._takeNoteDel==null&&(this._takeNoteDel=Function.createDelegate(this,this.takeLoadNote)),this._alreadyYonderDel==null&&(this._alreadyYonderDel=Function.createDelegate(this,this.alreadyYonder)),this._popupEx=$find("grPopupBhvr"),this.popElm=this._popupEx.get_element(),this._pBhr=$find(this._popupEx._id+"PopupBehavior"),this._menus={grMT:this._transDel,grMN:this._takeNoteDel,grYon:this._alreadyYonderDel},$find("grAnimExp")&&(this._menus.grMD=this.moveDB);for(n in this._menus)t=$get(n,this.popElm),t&&$addHandler(t,"click",this._menus[n]);this._popupEx._bodyClickHandler&&$removeHandler(document.body,"click",this._popupEx._bodyClickHandler),this._popupEx._bodyClickHandler=null,this._bdy=$get("grPopupBody"),Sys.Application.remove_load(this._initDel),this.grAddCss($grBasePath+"css/grammit.css"),$G.mode=$get("grDashBoard")?"H5":$get("grLGMenu")?"FL":null},dispose:function(){var u=$get("grDrillback"),r,i,t,n;this._drillbackDel&&u!=null&&$removeHandler(u,"click",this._drillbackDel);for(r in this._menus)i=$get(r,this.popElm),i&&$removeHandler(i,"click",this._menus[r]);delete this._transDel,delete this._alreadyYonderDel,delete this._drillbackDel,delete this._grPopupLoadedDel,delete this._intDel,delete this._dispDel,t=$get("grPopupClose"),t&&$removeHandler(t,"click",this.hidePopup),n=$get("grBotClose"),n&&$removeHandler(n,"click",this.hidePopup),this.disposeMenu(this._bdy)},disposeMenu:function(n){var f,u,r,i,e,t;if(typeof n=="undefined"||!n)return;for(f=n.getElementsByTagName("div"),u=0;i=f[u];u++)e=i.id.split("_"),t=i._events,t&&t.click&&t.click[0]&&(r=t.click[0].handler)&&($removeHandler(i,"click",r),delete r);$GP.IE&&this.hov(n)},bodyClick:function(n){this._oldBodyClick(n)},toggleMenu:function(n){var i,t;for(i in this._menus)t=$get(i,this.popElm),t&&(t.style.display=n&&Array.contains(n,i)?"":"none")},setDynBehav:function(n){var i=this._popupEx,t=this._pDpb;t&&(t.dispose(),t=null),this._pDpb=t=$create(Sys.Extended.UI.DynamicPopulateBehavior,{id:this._popupEx.get_id()+"_DynamicPopulateBehavior",ContextKey:n?n:"",ServicePath:$grBasePath+"services/GrammitService.asmx",ServiceMethod:"Popup"},null,null,$get("grPopupBody",this.popElm)),i._dynamicPopulateBehavior=t,t.add_populated(this._grPopupLoadedDel),this._popupEx._DynamicControlID="grPopupBody",this._popupEx._DynamicServiceMethod="Popup",this._popupEx._DynamicServicePath=t._servicePath},showPopup:function(n,t,i,r,u,f){var h=!n,l,o,s;n||(n=$GP._pBhr._parentElement?$GP._pBhr._parentElement:$get("grLGMenuHolder")),n.nodeName.toUpperCase()==="G"&&$AM.highlight("gr",n.id,n.srcGrmId,!0),t=h?1:t,l=h?210:0,$GP._drillHis.push({elm:n,posMode:t,title:i,key:r,staticTxt:u,defMens:f}),$GP._drillHis.length>1&&(_db.style.display=""),$GP.toggleMenu.call($GP,f),$GP._pBhr.set_parentElement(n);var c=$GP.popElm,e=$GP._popupEx,a=$GP._pDpb;$GP.clearDyn(),r&&r.length?($GP._ld.style.display="block","FL"===$G.mode?$G.getGrammit().webCall({contextKey:r},$GP._bdy.id,"$GP._grPopupLoadedDel",$grBasePath+"services/grammitService.asmx/Popup"):"H5"===$G.mode?$G.sendGrammit({service:$grBasePath+"services/grammitService.asmx/Popup",parms:{contextKey:r},cbFunc:"$GP._grPopupLoadedDel",context:$GP._bdy.id}):($GP.setDynBehav(r),$GP._pDpb._contextKey=r,$GP._pDpb._populateTriggerID=n.id)):($GP._pDpb&&$GP._pDpb.set_ServiceMethod(null),$GP._ld.style.display="none"),$get("grPopHdr",c).innerHTML=i,$GP._pBhr.set_positioningMode(t),e.set_OffsetX(l),$get("grStaticTxt",c).innerHTML=u?u:"",o=window.event,o&&($GP.IE?o.cancelBubble=!0:window.event.stopPropagation()),s=Sys.Extended.UI.PopupControlBehavior,e!==s.__VisiblePopup&&(s.__VisiblePopup=null),e.showPopup(),$GP.IE&&$GP.hov($GP._bdy)},grPopupLoaded:function(n,t){var i,r;n!=t?(i=$get(t),t&&i&&(i.innerHTML=n)):i=this._bdy,i==this._bdy&&(this._ld.style.display="none",r=$GP._pBhr.get_parentElement(),this.hookClickableIDs(this._bdy,r),$GP.IE&&this.hov(this._bdy))},hookClickableIDs:function(n,t){for(var f=n.getElementsByTagName("div"),i,u,r=0;i=f[r];r++)i.id&&(u=i.id.split("_"),$GP._clkMens[u[0]]?$addHandler(i,"click",Function.createDelegate(t,this.callPopUp)):u[0].match(this._regSpClk)&&$addHandler(i,"click",this.specialClick))},drillBack:function(n){var t=this._drillHis;n&&t.pop(),t=t.pop(),typeof t=="undefined"&&(t={elm:$get("grDashDrillBack"),posMode:2,title:"Empty",key:"",staticTxt:"You're at the beginning"}),this.showPopup(t.elm,t.posMode,t.title,t.key,t.staticTxt,t.defMens)},callPopUp:function(n){var t=n.target,r,i;while(t.id=="")t=$GP.IE?t.parentElement:t.parentNode;r=t.id.split("_"),i=$GP._clkMens[r[0]],$GP.showPopup.call($GP,this,2,i[0],t.id,"",i[1]),$GP.disposeMenu(this._bdy)},alreadyYonder:function(){var r=this._pBhr._parentElement,n=r.style,u=r.id.substring(2),t,i;n.cursor=n.color=n.backgroundColor="",setTimeout($GP.hidePopup),typeof $G.getGrammit!="undefined"?(t={randomPageId:grPgID,gramID:u},i={service:$grBasePath+"services/GrammitService.asmx/NotYonder",parms:t,cbFunc:null,context:null},$G.sendGrammit(i)):Loogla.Services&&Loogla.Services.grammitService.NotYonder(grPgID,u,null,null,null)},specialClick:function(n){var o,t=this.id.split("_"),s,h,r,u;switch(t[0]){case"les":var f=t[2],e=t[1],i=t[3];"H5"===$G.mode?$G.sendGrammit({service:$grBasePath+"services/GrammitService.asmx/GetAct",parms:{randomPageId:grPgID,actID:e,gramId:f,subjectID:i},cbFunc:"$AM.createActs",context:null}):"FL"===$G.mode?$G.getGrammit().webCall({randomPageId:grPgID,actID:e,gramId:f,subjectID:i},"contextObj","$AM.createActs",$grBasePath+"services/GrammitService.asmx/GetAct"):Loogla.Services&&Loogla.Services.grammitService.GetAct(grPgID,e,f,i,$AM.createActs,$AM.onTimeout,null),$GP.hidePopup();break;case"voc":case"phrVoc":case"catSv":"H5"===$G.mode?$G.sendGrammit({service:$grBasePath+"services/grammitService.asmx/Popup",parms:{contextKey:n.target.id+"_"+grPgID},cbFunc:"$GP.execCB",context:this.id}):"FL"===$G.mode?$G.getGrammit().webCall({contextKey:n.target.id+"_"+grPgID},this.id,"$GP.execCB",$grBasePath+"services/grammitService.asmx/Popup"):Loogla.Services&&Loogla.Services.grammitService.Popup(n.target.id+"_"+grPgID,$GP.execCB,$AM.onTimeout,null),Sys.UI.DomElement.removeCssClass(n.target,"grLGItem");break;case"notEd":s="notEd_"+t[1],this.showPopup(null,2,"Sticky Note edit",s,null,null);break;case"notAdd":h=[{cat:t[1],id:t[2],desc:"Note about: "+t[3]}],$GP.takeLoadNote.apply($GP,[null,h]);break;case"grCap":Grammit.enableSection(n);break;case"flFlip":$GP.flipFlash.call($GP),o=!0;break;case"flaReq":$GP.showPopup($GP._pBhr._parentElement,2,"Internet Images.",this.id,"These images are the result of an Internet image search.  No claims are being made regarding their availability for publication.");break;case"flaDel":$GP.showPopup($GP._pBhr._parentElement,2,"Goodbye flashcard.",this.id,"deleting...");break;case"fla":r=$GP._pBhr._parentElement,r.tagName.toUpperCase()=="G"?Grammit.grImgDrop(r,t[1],t[2]):window.open($grBasePath+"learn/VocabflashCardStudio.aspx?tID="+t[1],"flashCard")}u=this._events,!o&&u!==undefined&&u.click.length>0&&$removeHandler(this,"click",$GP.specialClick),n&&($GP.IE?n.cancelBubble=!0:n.stopPropagation())},hidePopup:function(n){var t=$GP._pBhr._parentElement,i;t&&t.nodeName&&t.nodeName.toUpperCase()==="G"&&$AM.highlight("gr",t.id,t.srcGrmId,!1),i=$GP._popupEx.get_element(),$GP.clearDyn(),$GP._popupEx.hidePopup(),n&&(n=n.rawEvent?n.rawEvent:n,n&&($GP.IE?n.cancelBubble=!0:n.stopPropagation())),$GP._raiseEvent.apply($GP,["popClosed",Sys.EventArgs.Empty])},addPopClosedListener:function(n){this.get_events().addHandler("popClosed",n)},removePopClosedListener:function(n){this.get_events().removeHandler("popClosed",n)},get_events:function(){return this._events||(this._events=new Sys.EventHandlerList),this._events},_raiseEvent:function(n,t){var i=this.get_events().getHandler(n);i&&(t||(t=Sys.EventArgs.Empty),i(this,t))},grAddCss:function(n){if($GP.IE){$GP.elEvalNode=document.createElement("div"),$GP.elEvalNode.id="js_grammit",$GP.elEvalNode.visiblity="hidden",document.body.appendChild($GP.elEvalNode),document.createStyleSheet(n);function i(){0<this.elEvalNode.offsetHeight&&(clearInterval(this.iIntervalId),this.elEvalNode.parentNode.removeChild(this.elEvalNode),this.hov(this.popElm))}this.iIntervalId=setInterval(function(){i.call($GP)},250)}else{var r="@import url(' "+n+" ');",t=document.createElement("link");t.rel="stylesheet",t.href="data:text/css,"+escape(r),t.addEventListener("load",function(){$GP.hov},!1),document.getElementsByTagName("head")[0].appendChild(t)}},clearDyn:function(){$GP.disposeMenu($GP._bdy),$GP._bdy.innerHTML=""},moveDB:function(n){var f,u,t,i,r;n=n&&n.target?null:n,f=$find("grAnimExp");if(!f)return;f.OnClick(),n?(i=Sys.UI.DomElement.getLocation(n),u=i.x,t=i.y):(u=f_scrollLeft()+f_clientWidth()/2-130,t=f_scrollTop()+f_clientHeight()/2);try{r=parseInt($G.getGrammit().height)+30,t=t>r?t-r:t+10,$AA.MoveAnimation.play($get("grLGMenuHolder"),.2,20,u,t,!1,"px")}catch(e){}},takeLoadNote:function(n,t){var u,i;try{n||(n=$GP._pBhr.get_parentElement()),i="notAdd_"+encodeURIComponent(Sys.Serialization.JavaScriptSerializer.serialize(t)),this.showPopup(n,2,"Sticky note (select category)",i,null,null)}catch(r){}},trans:function(){var n=$GP._pBhr.get_parentElement();$GP.showPopup(n,3,"Translation: "+n.innerHTML,"tra_"+$grmKey(n),"",["grMN","grMD"])},hov:function(n){typeof $grHov!="undefined"&&$grHov(n)},execCB:function(n,t){if(n!=""){var i=$get(t,this._bdy);Sys.Debug.trace("\neval("+n+")\n"),eval(n)}},flipFlash:function(){var i=$get("flFront",this.popElm),t=$get("flBack",this.popElm),n;n=i.style.display,i.style.display=t.style.display,t.style.display=n}},Grammit._PM.registerClass("Grammit._PM"),window.$GP=Grammit.PM=new Grammit._PM,$GP._initDel=Function.createDelegate($GP,$GP.init),$GP._dispDel=Function.createDelegate($GP,$GP.dispose),Sys.Application.add_load($GP._initDel),Sys.Application.add_unload($GP._dispDel),window.$grmKey=function(n){return n.id.substr(2)+"_"+grPgID},Sys&&Sys.Application&&Sys.Application.notifyScriptLoaded()
