var isFirefox=(navigator.userAgent.indexOf("Firefox")!=-1);var isOpera=(navigator.userAgent.indexOf("Opera")!=-1);var hasFrames=checkFrames();function unescapeIt(A){if(!A){return""}A=A.replace(new RegExp("{apos}","g"),"'");A=A.replace(new RegExp("{","g"),"<");A=A.replace(new RegExp("}","g"),">");return A}function checkFrames(){try{return(parent.frames.main!=null)}catch(A){return true}}function setObjectOnMousePos(E,D,B,A){E=E||window.event;if(D!=null){var C;if(hasFrames){C=E.clientX+document.documentElement.scrollLeft+B}else{C=E.clientX+document.documentElement.scrollLeft+B}if((C+D.offsetWidth)>document.body.clientWidth){C=document.body.clientWidth-D.offsetWidth}D.style.left=C+"px";if(hasFrames){C=E.clientY+document.documentElement.scrollTop+A}else{C=E.clientY+document.documentElement.scrollTop+A}if((C+D.offsetHeight)>document.body.clientHeight){}D.style.top=C+"px"}}var spDiv=null;var spFocus=null;var sp;var lastFocus=null;function keyLC(A){if(lastFocus!=null){lastFocus.value+=A;lastFocus.focus()}return false}function keyUC(B){if(lastFocus!=null){var A=lastFocus.value;A=A.substr(0,A.length-1);lastFocus.value=A+B.toUpperCase();lastFocus.focus()}return false}function spCharClick(A,D,C,B){B=B||window.event;if(hasFrames){spFocus=document.getElementById(C)}else{spFocus=document.getElementById(C)}spMouseOut(B);spDiv=document.createElement("div");spDiv.className="spCharMap";setObjectOnMousePos(B,spDiv,-5,-5);spDiv.style.zIndex=9000;spDiv.innerHTML='<img src="'+D+'" usemap="#'+A+'" border="0"/>';document.body.appendChild(spDiv)}function keyLCOff(A){if(spFocus!=null){if(window.event){if(window.event.shiftKey){spFocus.value+=A.toUpperCase()}else{spFocus.value+=A}}else{spFocus.value+=A}spFocus.focus()}return false}function keyUCOff(B){if(spFocus!=null){var A=spFocus.value;if(window.event){A=A.substring(0,A.length-1)}else{A=A.substring(0,A.length-2)}spFocus.value=A+B.toUpperCase();spFocus.focus()}}function spMouseOver(A,B){B=B||window.event;A=unescapeIt(A);spDiv=document.createElement("div");spDiv.className="spAllCorect";setObjectOnMousePos(B,spDiv,0,10);spMouseMove(B);spDiv.style.zIndex=9000;spDiv.innerHTML=A;document.body.appendChild(spDiv)}function spMouseOut(){if(spDiv!=null){document.body.removeChild(spDiv);spDiv=null}return false}function spMouseMove(A){A=A||window.event;setObjectOnMousePos(A,spDiv,0,10)}function cbMouseOver(E){var B=E.split("_");var C=document.getElementById(B[0]);var D=Math.pow(2,B[1]);var A=document.getElementById(E);if((C.value&D)>0){A.style.backgroundPosition="-57px"}else{A.style.backgroundPosition="-19px"}}function cbMouseOut(E){var B=E.split("_");var C=document.getElementById(B[0]);var D=Math.pow(2,B[1]);var A=document.getElementById(E);if((C.value&D)>0){A.style.backgroundPosition="-38px"}else{A.style.backgroundPosition="0px"}}function cbClick(D){var A=D.split("_");var B=document.getElementById(A[0]);var C=Math.pow(2,A[1]);if((B.value&C)>0){B.value&=(~C)}else{B.value|=C}cbMouseOver(D)}function rdMouseOver(E){var B=E.split("_");var C=document.getElementById(B[0]);var D=B[1];var A=document.getElementById(E);if(C.value==D){A.style.backgroundPosition="-54px"}else{A.style.backgroundPosition="-18px"}}function rdMouseOut(E){var B=E.split("_");var C=document.getElementById(B[0]);var D=B[1];var A=document.getElementById(E);if(C.value==D){A.style.backgroundPosition="-36px"}else{A.style.backgroundPosition="0px"}}function rdClick(F){var C=F.split("_");var D=document.getElementById(C[0]);for(i=0;i<20;i++){var B=C[0]+"_"+i;var A=document.getElementById(B);if(A==null){break}var E=i;if(B==F){D.value=E;A.style.backgroundPosition="-54px"}else{A.style.backgroundPosition="0px"}}}var ddDiv=null;var ddTimerID=null;var ddCanHide=1;function ddwinSize(){var B=0,A=0;if(typeof (window.innerWidth)=="number"){B=window.innerWidth;A=window.innerHeight}else{B=document.documentElement.clientWidth;A=document.documentElement.clientHeight}return[B,A]}function ddgetScrollXY(){var B=0,A=0;if(typeof (window.pageYOffset)=="number"){A=window.pageYOffset;B=window.pageXOffset}else{A=document.documentElement.scrollTop;B=document.documentElement.scrollLeft}return[B,A]}function ddMouseClick(B,I){if(ddDiv==null){var D=document.getElementById(B);var C=document.getElementById(B+"_a");var A=document.getElementById(I).innerHTML;var E=ddFindPos(D);var G=ddFindPos(C);var H=ddgetScrollXY();var F=ddwinSize();posLeft=E[0]+H[0];posTop=E[1]+H[1];ddDiv=document.createElement("div");ddDiv.className="ddAnswerList";ddDiv.style.left=(posLeft)+"px";ddDiv.style.top=(posTop+D.offsetHeight+1)+"px";ddDiv.innerHTML=A;document.body.appendChild(ddDiv);if((H[1]+F[1])<(posTop+ddDiv.offsetHeight+23)){ddDiv.style.top=(posTop+D.offsetHeight-20-ddDiv.offsetHeight)+"px"}ddCanHide=0;ddClearTimer()}else{ddCanHide=1;ddDelayedHideAnswers(1)}}function ddHideAnswers(){if(ddCanHide==0){return }if(ddDiv!=null){document.body.removeChild(ddDiv);ddDiv=null;ddTimerID=null}}function ddDelayedHideAnswers(){ddClearTimer();var A=500;ddTimerID=window.setTimeout("ddHideAnswers()",A)}function ddMouseOverOut(C,A){var B=document.getElementById(C);B.src=A;ddCanHide=1;ddDelayedHideAnswers()}function ddFindPos(B){var C=0;var A=0;if(B.offsetParent){C=B.offsetLeft;A=B.offsetTop;while(B=B.offsetParent){C+=(B.offsetLeft-B.scrollLeft);A+=(B.offsetTop-B.scrollTop)}}return[C,A]}function ddClearTimer(){if(ddTimerID!=null){clearTimeout(ddTimerID);ddTimerID=null}}function ddHighLight(A){ddCanHide=0;A.className="ddSelected"}function ddDownLight(A){ddCanHide=1;A.className="";ddDelayedHideAnswers()}function ddHighLightExample(B,A){ddCanHide=0;if(A==1){B.className="ddGoodAnswerSelected"}else{B.className="ddWrongAnswerSelected"}}function ddDownLightExample(B,A){ddCanHide=1;if(A==1){B.className="ddGoodAnswer"}else{B.className="ddWrongAnswer"}ddDelayedHideAnswers()}function ddSelect(C,B){var A=C.innerHTML;document.getElementById(B+"_f").innerHTML=A;var D=C.id.split("_a");document.getElementById(B+"_res").value=D[1];ddCanHide=1;ddHideAnswers()}var rlComponentArray=new Array(1);var rlComponentIndex;var rlElemArray,rlPosArray,rlMaxElems;var rlMaxPos,rlMinPos,rlOffPos;var rlCurElem,rlCurIndex,rlCurPos,rlInnerOffset;var rlTimer,rlTimerElem,rlTimerPos;function rlLoad(G,F){var E=2;var A=0;rlCurElem=null;rlComponentIndex=G.charAt(2);var D=0;rlMaxElems=0;for(i=0;;i++){name=G+"_"+i;elem=document.getElementById(name);if(elem==null){break}D++;if(A<elem.offsetHeight){A=elem.offsetHeight}if(elem.className=="reorderFix"){continue}rlMaxElems++}rlElemArray=new Array(rlMaxElems);rlPosArray=new Array(rlMaxElems);A-=6;var B=0;rlMinPos=0;var C=F.split(",");for(i=0;i<D;i++){name=G+"_"+parseInt(C[i]);elem=document.getElementById(name);if(elem.className=="reorderFix"){elem.style.left=E+"px";E=E+elem.offsetWidth+1;elem.style.height=A+"px"}else{rlElemArray[B]=elem;elem.style.left=E+"px";rlPosArray[B]=E;if(rlMinPos==0){rlMinPos=E}E=E+elem.offsetWidth+1;elem.style.height=A+"px";rlMaxPos=E;B++}}rlOffPos=0;elem=document.getElementById(G+"_box");elem.style.width=rlMaxPos+"px";elem.style.height=(A+10)+"px";do{rlOffPos+=elem.offsetLeft;elem=elem.offsetParent}while(elem!=null);rlOffPos+=4;rlSaveComponentSet();rlStoreOrder()}function rlMouseOver(A){if(rlCurElem==null){A.className="reorderObjHover"}}function rlMouseOut(A){if(rlCurElem==null){A.className="reorderObj"}}function rlMouseUp(A){if(rlCurElem!=null){elem=rlCurElem;rlMoveElement(elem,rlPosArray[rlCurIndex]);rlCurElem=null;rlCurIndex=-1;if(A){rlMouseOver(elem)}else{rlMouseOut(elem)}}}function rlMouseDown(A,B){B=B||window.event;if(A.id.charAt(2)!=rlComponentIndex){rlSaveComponentSet();rlComponentIndex=A.id.charAt(2);rlLoadComponentSet()}rlMouseOver(A);rlCurElem=A;for(i=0;i<rlMaxElems;i++){if(rlElemArray[i].id==rlCurElem.id){rlCurIndex=i;break}}A.className="reorderObjSelect";rlInnerOffset=(B.clientX-rlOffPos-rlPosArray[rlCurIndex]+1);return false}function rlMouseMove(A){if(rlCurElem!=null){A=A||window.event;rlCurPos=A.clientX-rlOffPos-rlInnerOffset;if(rlCurPos<rlMinPos){rlCurPos=rlMinPos}p=rlMaxPos-rlCurElem.offsetWidth-1;if(rlCurPos>p){rlCurPos=p}rlCurElem.style.left=rlCurPos+"px";if(rlCurIndex<(rlMaxElems-1)){nextElem=rlElemArray[rlCurIndex+1];nextPos=rlPosArray[rlCurIndex+1];p=nextPos-rlCurElem.offsetWidth-1+(nextElem.offsetWidth/2);if(rlCurPos>p){p=nextPos-rlCurElem.offsetWidth-1;rlMoveElement(nextElem,p);rlElemArray[rlCurIndex+1]=rlCurElem;rlElemArray[rlCurIndex]=nextElem;rlPosArray[rlCurIndex+1]=rlPosArray[rlCurIndex]+nextElem.offsetWidth+1;rlCurIndex++;rlStoreOrder();return }}if(rlCurIndex>0){prevElem=rlElemArray[rlCurIndex-1];prevPos=rlPosArray[rlCurIndex-1];p=prevPos-1+(prevElem.offsetWidth/2);if(rlCurPos<p){p=prevPos+rlCurElem.offsetWidth+1;rlMoveElement(prevElem,p);rlElemArray[rlCurIndex-1]=rlCurElem;rlElemArray[rlCurIndex]=prevElem;rlPosArray[rlCurIndex]=rlPosArray[rlCurIndex-1]+rlCurElem.offsetWidth+1;rlCurIndex--;rlStoreOrder();return }}}}function rlStoreOrder(){var C="";var B;for(var A=0;A<rlElemArray.length;A++){if(C.length>0){C=C+","}B=rlElemArray[A].id.split("_");C=C+B[1]}var D=document.getElementById(B[0]);D.value=C}function rlMoveElement(B,A){if(rlTimer==null){rlTimerElem=B;rlTimerPos=A;rlTimer=self.setInterval("rlMoveElement2()",20)}else{rlTimerElem.style.left=rlTimerPos+"px";clearInterval(rlTimer);rlTimer=null;rlTimerPos=0;rlTimerElem=null;rlMoveElement(B,A)}}function rlMoveElement2(){delta=Math.round(rlTimerPos-rlTimerElem.offsetLeft)/2;if(Math.abs(delta)>=3){pos=rlTimerElem.offsetLeft+delta;if(pos<=0){pos=0}rlTimerElem.style.left=pos+"px"}else{rlTimerElem.style.left=rlTimerPos+"px";clearInterval(rlTimer);rlTimer=null;rlTimerPos=0;rlTimerElem=null}}function rlLoadComponentSet(){var A=rlComponentArray[rlComponentIndex];rlElemArray=A[0];rlPosArray=A[1];rlMaxElems=A[2];rlMaxPos=A[3];rlMinPos=A[4];rlOffPos=A[5]}function rlSaveComponentSet(){var A=new Array(6);A[0]=rlElemArray;A[1]=rlPosArray;A[2]=rlMaxElems;A[3]=rlMaxPos;A[4]=rlMinPos;A[5]=rlOffPos;while(rlComponentArray.length<=rlComponentIndex){rlComponentArray.push(null)}rlComponentArray[rlComponentIndex]=A}function phClick(G,F){var B=G.split("_");var C=document.getElementById(B[0]);var D=Math.pow(2,B[1]);var A=document.getElementById(G);var E=parseInt(C.value);if((E&D)>0){C.value=E&(~D);A.style.textDecoration="none"}else{C.value=E|D;A.style.textDecoration=F}A.blur()}var dgCurElem,dgCurIndex,dgMaxElems,dgInnerOffsetX,dgInnerOffsetY,dgCurBox,dgDmin,dgDmax;var dgTimer,dgTimerElem,dgTimerPosX,dgTimerPosY;var dgDragBoxArray,dgDropBoxArray,dgObjArray,dgObjLocationArray;function dgLoad(){var B,A;dgCurElem=null;dgCurIndex=-1;dgDmin=new Array(2);dgDmin[0]=10000;dgDmin[1]=10000;dgDmax=new Array(2);dgDmax[0]=0;dgDmax[1]=0;for(i=0;;i++){A="dg1_"+i;B=document.getElementById(A);if(B==null){break}if(dgDmin[0]>B.offsetWidth){dgDmin[0]=B.offsetWidth}if(dgDmin[1]>B.offsetHeight){dgDmin[1]=B.offsetHeight}if(dgDmax[0]<B.offsetWidth){dgDmax[0]=B.offsetWidth}if(dgDmax[1]<B.offsetHeight){dgDmax[1]=B.offsetHeight}dgMaxElems=i+1}dgDmin=dgFixDimensions(dgDmin);if(dgDmin[0]<50){dgDmin[0]=50}if(dgDmin[1]<20){dgDmin[1]=20}dgDmax=dgFixDimensions(dgDmax);dgDragBoxArray=new Array(dgMaxElems);dgObjArray=new Array(dgMaxElems);dgObjLocationArray=new Array(dgMaxElems);var C=new Array(2);for(i=0;i<dgMaxElems;i++){A="dg0_"+i;dgDragBoxArray[i]=document.getElementById(A);A="dg1_"+i;dgObjArray[i]=document.getElementById(A);dgObjLocationArray[i]=dgDragBoxArray[i];C[0]=dgObjArray[i].offsetWidth;C[1]=dgObjArray[i].offsetHeight;C=dgFixDimensions(C);dgDragBoxArray[i].style.width=C[0]+"px";dgDragBoxArray[i].style.height=C[1]+"px"}dgDropBoxArray=new Array();for(i=0;;i++){A="dp0_"+i;B=document.getElementById(A);if(B==null){break}B.style.width=dgDmin[0]+"px";B.style.height=dgDmin[1]+"px";dgDropBoxArray.push(B)}for(i=0;;i++){A="dm"+i;B=document.getElementById(A);if(B==null){break}B.style.width=dgDmax[0]+"px";B.style.height=((dgDmax[1]+2)*dgMaxElems)+"px";dgDropBoxArray.push(B)}dgSetObjLocations()}function dgSetObjLocations(){for(i=0;i<dgMaxElems;i++){if(dgIsDrop(dgObjLocationArray[i])){var D=new Array(2);D[0]=dgObjArray[i].offsetWidth;D[1]=dgObjArray[i].offsetHeight;D=dgFixDimensions(D);dgObjLocationArray[i].style.width=D[0]+"px";dgObjLocationArray[i].style.height=D[1]+"px"}}for(i=0;i<dgMaxElems;i++){if(!dgIsDrop(dgObjLocationArray[i])&&!dgIsDrag(dgObjLocationArray[i])){continue}var C=dgGetBoxPos(dgObjLocationArray[i]);dgObjArray[i].style.left=C[0]+"px";dgObjArray[i].style.top=C[1]+"px"}for(i=0;i<dgDropBoxArray.length;i++){var B=dgDropBoxArray[i];if(!dgIsMultiDrop(B)){continue}var C=dgGetBoxPos(B);for(j=0;j<dgMaxElems;j++){if(dgObjLocationArray[j]==B){var A=dgObjArray[j];A.style.left=C[0]+"px";A.style.top=C[1]+"px";C[1]+=(A.offsetHeight+2)}}}}function dgFixDimensions(A){if(isOpera){A[0]+=4;A[1]+=4}if(isFirefox){A[0]+=2;A[1]+=2}return A}function dgGetBoxPos(D){var A=4;var E=4;var C=D;if(isOpera){A=0;E=0}do{A+=C.offsetLeft;E+=C.offsetTop;if(!isFirefox){if(C.tagName.toLowerCase()=="table"){if(C.border>0){A+=1;E+=1}}}C=C.offsetParent}while(C!=null);if(D.tagName.toLowerCase()=="textarea"){A-=1;E-=1;if(isOpera){A+=3;E+=3}if(isFirefox){A+=1;E+=1}}if(D.tagName.toLowerCase()=="div"){A-=12;E-=2;if(isOpera){A+=15;E+=5}if(isFirefox){A+=12;E+=2}}var B=new Array(2);B[0]=A;B[1]=E;return B}function dgMouseOver(A){if(dgCurElem==null){A.className="dragObjHover"}}function dgMouseOut(A){if(dgCurElem==null){A.className="dragObj"}}function dgMouseUp(D,E){if(dgCurElem!=null){elem=dgObjLocationArray[dgCurIndex];if(D&&dgIsDrag(elem)){}else{if(dgIsDrop(elem)&&(elem!=dgCurBox)){elem.style.width=dgDmin[0]+"px";elem.style.height=dgDmin[1]+"px"}}var C=-1;if(dgIsDrop(dgCurBox)){for(var A=0;A<dgMaxElems;A++){if((dgObjLocationArray[A]==dgCurBox)&&(A!=dgCurIndex)){C=A;break}}}if(dgCurBox==null){dgCurBox=dgDragBoxArray[dgCurIndex]}dgObjLocationArray[dgCurIndex]=dgCurBox;dgSetDefaultClass(dgCurBox);if(C==-1){elem=dgCurElem;dgCurElem=null;dgCurIndex=-1;dgMouseOut(elem);var B=dgGetBoxPos(dgCurBox);dgMoveElement(elem,B)}else{elem=dgCurElem;var B=dgGetBoxPos(dgCurBox);elem.style.left=B[0]+"px";elem.style.top=B[1]+"px";dgCurElem=null;dgMouseOut(elem);dgObjLocationArray[C]=dgDragBoxArray[C];var B=dgGetBoxPos(dgDragBoxArray[C]);dgMoveElement(dgObjArray[C],B)}dgCurBox=null}}function dgSetDefaultClass(A){if(dgIsDrag(A)){A.className="dragBox"}else{A.className="dropBox"}}function dgMouseDown(A,B){B=B||window.event;dgMouseOver(A);dgCurElem=A;for(i=0;i<dgMaxElems;i++){if(dgObjArray[i].id==dgCurElem.id){dgCurIndex=i;break}}A.className="dragObjSelect";dgInnerOffsetX=(B.clientX-dgObjArray[dgCurIndex].offsetLeft+1);dgInnerOffsetY=(B.clientY-dgObjArray[dgCurIndex].offsetTop+1);dgCurBox=dgObjLocationArray[dgCurIndex];return false}function dgMouseMove(C){var D,B,A,E;if(dgCurElem!=null){C=C||window.event;D=C.clientX-dgInnerOffsetX;if(D<0){D=0}B=C.clientY-dgInnerOffsetY;if(B<0){B=0}dgCurElem.style.left=D+"px";dgCurElem.style.top=B+"px";E=null;for(i=0;i<dgDropBoxArray.length;i++){if(dgIsInBox(dgCurElem,dgDropBoxArray[i])){E=dgDropBoxArray[i].id;break}}if(E==null){if(dgIsInBox(dgCurElem,dgDragBoxArray[dgCurIndex])){E=dgDragBoxArray[dgCurIndex].id}}if((dgCurBox!=null)&&(dgCurBox.id!=E)){dgSetDefaultClass(dgCurBox)}dgCurBox=document.getElementById(E);if(dgCurBox!=null){dgCurBox.className="hoverBox"}}}function dgIsInBox(G,E){var H,B,A;var F=dgGetBoxPos(E);var D=G.offsetLeft+dgInnerOffsetX;var C=G.offsetTop+dgInnerOffsetY;return((D>=F[0])&&(D<=(F[0]+E.offsetWidth))&&(C>=F[1])&&(C<=(F[1]+E.offsetHeight)))}function dgMoveElement(B,A){if(dgTimer==null){dgTimerElem=B;dgTimerPosX=A[0];dgTimerPosY=A[1];dgTimer=self.setInterval("dgMoveElement2()",20)}else{dgTimerElem.style.left=dgTimerPosX+"px";dgTimerElem.style.top=dgTimerPosY+"px";clearInterval(dgTimer);dgTimer=null;dgTimerPosX=0;dgTimerPosY=0;dgTimerElem=null;rlMoveElement(B,A)}}function dgMoveElement2(){var C;var B=Math.round(dgTimerPosX-dgTimerElem.offsetLeft)/2;if(Math.abs(B)>=3){var C=dgTimerElem.offsetLeft+B;if(C<=0){C=0}dgTimerElem.style.left=C+"px"}else{dgTimerElem.style.left=dgTimerPosX}var A=Math.round(dgTimerPosY-dgTimerElem.offsetTop)/2;if(Math.abs(A)>=3){var C=dgTimerElem.offsetTop+A;if(C<=0){C=0}dgTimerElem.style.top=C+"px"}else{dgTimerElem.style.top=dgTimerPosY}if((Math.abs(B)<3)&&(Math.abs(A)<3)){dgTimerElem.style.left=dgTimerPosX+"px";dgTimerElem.style.top=dgTimerPosY+"px";clearInterval(dgTimer);dgTimer=null;dgTimerPosX=0;dgTimerPosY=0;dgTimerElem=null;dgSetObjLocations()}}function dgIsDrag(A){if(A==null){return false}var B=A.id.substring(0,2);return(B=="dg")}function dgIsDrop(A){if(A==null){return false}var B=A.id.substring(0,2);return(B=="dp")}function dgIsMultiDrop(A){if(A==null){return false}var B=A.id.substring(0,2);return(B=="dm")}function tfOnMouseOver(C){var A=C.split("_");var B=document.getElementById(A[0]);if(B.value==A[1]){document.getElementById(C).style.backgroundPosition="-57px"}else{document.getElementById(C).style.backgroundPosition="-19px"}}function tfOnMouseOut(C){var A=C.split("_");var B=document.getElementById(A[0]);if(B.value==A[1]){document.getElementById(C).style.backgroundPosition="-38px"}else{document.getElementById(C).style.backgroundPosition="0px"}}function tfOnClick(D){var A=D.split("_");var B=document.getElementById(A[0]);if(B.value==A[1]){document.getElementById(D).style.backgroundPosition="0px";B.value=-1}else{if(B.value==-1){document.getElementById(D).style.backgroundPosition="-38px";B.value=A[1]}else{document.getElementById(D).style.backgroundPosition="-38px";var C=A[0]+"_"+B.value;document.getElementById(C).style.backgroundPosition="0px";B.value=A[1]}}tfOnMouseOver(D)}var trDiv=null;function trMouseOver(B,A,C){C=C||window.event;B=unescapeIt(B);w=parseInt(A);trDiv=document.createElement("div");if(w<=512){trDiv.className="translation512"}else{if(w>=1024){trDiv.className="translation1024"}else{trDiv.className="translation"}}trDiv.innerHTML=B;document.body.appendChild(trDiv);setObjectOnMousePos(C,trDiv,0,20)}function trMouseOut(){if(trDiv!=null){document.body.removeChild(trDiv);trDiv=null}}function trMouseMove(A){A=A||window.event;setObjectOnMousePos(A,trDiv,0,20)}function gfxPreviewImage(E,B,A,D){var G="width="+B+",height="+A+",";G+="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+(D?"yes":"no")+",resizable=no";var F="<html><body style='margin: auto; text-align: center; vertical-align: middle;'>";if(D){F+="<img src='"+E+"'>"}else{F+="<img src='"+E+"' width='"+B+"' height='"+A+"'>"}F+="</body></html>";var C=window.open("","preview",G);C.moveTo(Math.round((screen.width-B)/2),Math.round((screen.height-A)/2));C.document.open();C.document.write(F);C.document.close();C.focus()}function onVideoDialog(){this.ed.windowManager.open({url:url+"/video.htm",width:465+parseInt(ed.getLang("learn.delta_width",0)),height:400+parseInt(ed.getLang("learn.delta_height",0)),inline:1},{plugin_url:url})}function gfxPreviewFlash(E,C,A,G,B){var F="width="+C+",height="+A+",";F+="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no";var D=window.open("/pages/learn/gfx.smnet?flak="+E+"&width="+C+"&height="+A+"&id="+G+"&loop="+B,"preview",F);D.moveTo(Math.round((screen.width-C)/2),Math.round((screen.height-A)/2));D.focus()}function getPreviewFlv(B,C,A){var E="width="+C+",height="+A+",";E+="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no";var D=window.open("/pages/learn/video.smnet?flashSrc="+B+"&width="+C+"&height="+A,"preview",E);D.moveTo(Math.round((screen.width)/2),Math.round((screen.height)/2));D.focus()}var dpDiv=null;var dpDragID=null;var dpOffsetElX=0;var dpOffsetElY=0;var dpDefaultDropSign="";var dpCurrentDropHighlighted=-1;var dpDropCount=0;var dpDropBoxesCoords=new Array();function dpFindPos(A){var B=curtop=0;if(A.offsetParent){B=A.offsetLeft;curtop=A.offsetTop;while(A=A.offsetParent){B+=(A.offsetLeft-A.scrollLeft);curtop+=(A.offsetTop-A.scrollTop)}}B+=document.documentElement.scrollLeft;curtop+=document.documentElement.scrollTop;return[B,curtop]}function dpHideDraggedObject(){if(dpDiv!=null){document.body.removeChild(dpDiv);dpDiv=null;dpDragID=null}}function dpMoveDrag(D){if(dpDiv!=null){D=D||window.event;var B=D.clientX+dpOffsetElX;var A=D.clientY+dpOffsetElY;dpDiv.style.left=B+"px";dpDiv.style.top=A+"px";var C=dpCheckCollision(D);if(C!=-1){for(i=0;i<dpDropCount;i++){if(i!=C){dpSwitchOff(i)}}document.getElementById("dp"+C).className="dpDropHighlighted";dpCurrentDropHighlighted=C}else{if(dpCurrentDropHighlighted!=-1){document.getElementById("dp"+dpCurrentDropHighlighted).className="dpDropDefault";dpCurrentDropHighlighted=-1}}}}function dpStartDrag(E,D){if((document.getElementById(E.id+"_id").value!="")&&(document.getElementById(E.id+"_id").value!=-1)){if(dpDiv!=null){dpHideDraggedObject()}D=D||window.event;for(i=0;i<dpDropBoxesCoords.length;i++){var C=dpSetDropSourcePosition(document.getElementById("dp"+i),dpDropBoxesCoords[i][4]);dpDropBoxesCoords[i]=C}dpDragID=E.id.substring(2);var F=dpFindPos(E);dpOffsetElX=F[0]-D.clientX-1;dpOffsetElY=F[1]-D.clientY-1;if(dpOffsetElX>0){dpOffsetElX-=F[0]-D.clientX+10}if(dpOffsetElY<-25){dpOffsetElY-=F[1]-D.clientY+10}dpDiv=document.createElement("div");dpDiv.className="dpDraggedElement";dpDiv.style.left=D.clientX+dpOffsetElX+"px";dpDiv.style.top=D.clientY+dpOffsetElY+"px";var A=E.innerHTML;var B=A.replace(/(<([^>]+)>)/ig,"");if(B.length<5){dpDiv.innerHTML=A}else{if((B.length<24)||((B.length>=24)&&(B.indexOf(" ",24)==-1))){dpDiv.innerHTML=B}else{dpDiv.innerHTML=B.substr(0,B.indexOf(" ",24))+"..."}}document.body.appendChild(dpDiv)}return false}function dpSetDropAvailable(A,B){dpDropBoxesCoords[A][4]=B}function dpDropHere(B){if((dpDiv!=null)&&(document.getElementById(B.id+"_id").value=="")){B.innerHTML=document.getElementById("dg"+dpDragID).innerHTML;B.innerHTML='<span class="dpDragDropped">'+B.innerHTML+"</span>";document.getElementById(B.id+"_id").value=dpDragID;document.getElementById(B.id+"_img").style.display="";document.getElementById("dg"+dpDragID+"_id").value="";document.getElementById("dg"+dpDragID).className="dpDragDisabled";for(i=0;i<dpDropBoxesCoords.length;i++){var A=dpSetDropSourcePosition(document.getElementById("dp"+i),dpDropBoxesCoords[i][4]);dpDropBoxesCoords[i]=A}dpSetDropAvailable(B.id.substring(2),false)}}function dpDropHereLeaveDrag(B){if((dpDiv!=null)&&(document.getElementById(B.id+"_id").value=="")){B.innerHTML=document.getElementById("dg"+dpDragID).innerHTML;B.innerHTML='<span class="dpDragDropped">'+B.innerHTML+"</span>";document.getElementById(B.id+"_id").value=dpDragID;document.getElementById(B.id+"_img").style.display="";for(i=0;i<dpDropBoxesCoords.length;i++){var A=dpSetDropSourcePosition(document.getElementById("dp"+i),dpDropBoxesCoords[i][4]);dpDropBoxesCoords[i]=A}dpSetDropAvailable(B.id.substring(2),false)}}function dpDragMatchDrop(B,A){B=B||window.event;var C=dpCheckCollision(B);if(C!=-1){if(document.getElementById("dp"+C+"_id").value==""){if(A==1){dpDropHereLeaveDrag(document.getElementById("dp"+C))}else{dpDropHere(document.getElementById("dp"+C))}}}dpHideDraggedObject();if(dpCurrentDropHighlighted!=-1){document.getElementById("dp"+dpCurrentDropHighlighted).className="dpDropDefault";dpCurrentDropHighlighted=-1}}function dpCheckCollision(B){B=B||window.event;if((B.pageX)||(B.pageY)){var D=B.pageX;var C=B.pageY}else{var D=B.clientX+document.documentElement.scrollLeft;var C=B.clientY+document.documentElement.scrollTop}for(i=dpDropBoxesCoords.length-1;i>=0;i--){var A=dpDropBoxesCoords[i];if(A[4]){if((D>=A[0])&&(D<=A[2])&&(C>=A[1])&&(C<=A[3])){return i}}}return -1}function dpInitDragDrop(){dpDiv=null;dpDragID=null}function dpSwitchOff(A){document.getElementById("dp"+A).className=""}function dpInitDrop(C,D){var B=document.getElementById("dp"+C+"_id");dpDefaultDropSign=D;var A=dpSetDropSourcePosition(B,true);dpDropBoxesCoords.push(A);dpDropCount++}function dpSetDropSourcePosition(C,D){var A=dpFindPos(C);var B=new Array();B.push(A[0]);B.push(A[1]);B.push(C.offsetWidth+A[0]);B.push(C.offsetHeight+A[1]);B.push(D);return B}function dpReleaseDrop(D){D.style.display="none";var C=D.id.split("_");var E=C[0];var A=E.substring(2);var F="dg"+document.getElementById(E+"_id").value;document.getElementById(E).innerHTML=dpDefaultDropSign;document.getElementById(E).className="dpDropDefault";document.getElementById(F).className="dpDragDefault";document.getElementById(F+"_id").value=F;document.getElementById(E+"_id").value="";for(i=0;i<dpDropBoxesCoords.length;i++){var B=dpSetDropSourcePosition(document.getElementById("dp"+i),dpDropBoxesCoords[i][4]);dpDropBoxesCoords[i]=B}dpSetDropAvailable(A,true)}var mdDiv=null;var mdDragID=null;var mdOffsetElX=0;var mdOffsetElY=0;var mdCurrentDropHighlighted=-1;var mdDropCount=0;var mdImgBusy="";var mdDropBoxesCoords=new Array();function mdFindPos(A){var B=curtop=0;if(A.offsetParent){B=A.offsetLeft;curtop=A.offsetTop;while(A=A.offsetParent){B+=(A.offsetLeft-A.scrollLeft);curtop+=(A.offsetTop-A.scrollTop)}}B+=document.documentElement.scrollLeft;curtop+=document.documentElement.scrollTop;return[B,curtop]}function mdHideDraggedObject(){if(mdDiv!=null){document.body.removeChild(mdDiv);mdDiv=null;mdDragID=null}}function mdMoveDrag(D){if(mdDiv!=null){D=D||window.event;var B=D.clientX+mdOffsetElX;var A=D.clientY+mdOffsetElY;mdDiv.style.left=B+"px";mdDiv.style.top=A+"px";var C=mdCheckCollision(D);if(C!=-1){for(i=0;i<mdDropCount;i++){if(i!=C){mdSwitchOff(i)}}document.getElementById("md"+C).className="mdDropHighlighted";mdCurrentDropHighlighted=C}else{if(mdCurrentDropHighlighted!=-1){mdSwitchOff(mdCurrentDropHighlighted);mdOldDropHighlighted=-1;mdCurrentDropHighlighted=-1}}}}function mdSwitchOff(A){document.getElementById("md"+A).className=""}function mdStartDrag(E,D){if(document.getElementById(E.id+"_id").value!=""){if(mdDiv!=null){mdHideDraggedObject()}D=D||window.event;for(i=0;i<mdDropBoxesCoords.length;i++){var C=mdSetDropSourcePosition(document.getElementById("md"+i));mdDropBoxesCoords[i]=C}mdDragID=E.id.substring(2);var F=mdFindPos(E);mdOffsetElX=F[0]-D.clientX-1;mdOffsetElY=F[1]-D.clientY-1;if(mdOffsetElX>0){mdOffsetElX-=F[0]-D.clientX+10}if(mdOffsetElY<-25){mdOffsetElY-=F[1]-D.clientY+10}mdDiv=document.createElement("div");mdDiv.className="mdDraggedElement";mdDiv.style.left=D.clientX+mdOffsetElX+"px";mdDiv.style.top=D.clientY+mdOffsetElY+"px";var A=E.innerHTML;var B=A.replace(/(<([^>]+)>)/ig,"");if(B.length<5){mdDiv.innerHTML=A}else{if((B.length<24)||((B.length>=24)&&(B.indexOf(" ",24)==-1))){mdDiv.innerHTML=B}else{mdDiv.innerHTML=B.substr(0,B.indexOf(" ",24))+"..."}}document.body.appendChild(mdDiv)}return false}function mdDropHere(E){if(mdDiv!=null){var D=document.getElementById("md"+E+"_table");var B=document.getElementById("md_dropped").value;var A=D.insertRow(-1);var C=A.insertCell(-1);C.innerHTML='<img src="'+mdImgBusy+'" id="md'+B+'_img" onclick="mdReleaseDrop(this, '+E+');"><input type="Hidden" id="md'+B+'_id" value="'+mdDragID+'" />';C=A.insertCell(-1);C.innerHTML=document.getElementById("dg"+mdDragID).innerHTML;document.getElementById("dg"+mdDragID+"_id").value="";document.getElementById("dg"+mdDragID).className="mdDragDisabled";B++;document.getElementById("md_dropped").value=B;var F=mdGetAnswer(E);F.push(mdDragID);mdSetAnswer(F,E)}mdHideDraggedObject()}function mdDropHereLeaveDrag(E){if(mdDiv!=null){var D=document.getElementById("md"+E+"_table");var B=document.getElementById("md_dropped").value;var A=D.insertRow(-1);var C=A.insertCell(-1);C.innerHTML='<img src="'+mdImgBusy+'" id="md'+B+'_img" onclick="mdReleaseDrop(this, '+E+');"><input type="Hidden" id="md'+B+'_id" value="'+mdDragID+'" />';C=A.insertCell(-1);C.innerHTML=document.getElementById("dg"+mdDragID).innerHTML;B++;document.getElementById("md_dropped").value=B;var F=mdGetAnswer(E);F.push(mdDragID);mdSetAnswer(F,E)}mdHideDraggedObject()}function mdDragMatchDrop(B,A){B=B||window.event;var C=mdCheckCollision(B);if(C!=-1){if(A==1){mdDropHereLeaveDrag(C)}else{mdDropHere(C)}}mdHideDraggedObject();if(mdCurrentDropHighlighted!=-1){document.getElementById("md"+mdCurrentDropHighlighted).className="";mdCurrentDropHighlighted=-1}}function mdCheckCollision(B){B=B||window.event;if((B.pageX)||(B.pageY)){var D=B.pageX;var C=B.pageY}else{var D=B.clientX+document.documentElement.scrollLeft;var C=B.clientY+document.documentElement.scrollTop}for(i=0;i<mdDropBoxesCoords.length;i++){var A=mdDropBoxesCoords[i];if((D>=A[0])&&(D<=A[2])&&(C>=A[1])&&(C<=A[3])){return i}}return -1}function mdInitDragDrop(A){mdDiv=null;mdDragID=null;mdImgBusy=A}function mdInitDrop(C){var B=document.getElementById("md"+C);var A=mdSetDropSourcePosition(B);mdDropBoxesCoords.push(A);mdDropCount++}function mdSetDropSourcePosition(C){var A=mdFindPos(C);var B=new Array(2);B[0]=A[0];B[1]=A[1];B[2]=C.offsetWidth+A[0];B[3]=C.offsetHeight+A[1];return B}function mdReleaseDrop(D,C){var I=D.id.split("_");var B=I[0];var G=document.getElementById(B+"_id").value;var A="dg"+G;document.getElementById(A).className="mdDragDefault";document.getElementById(A+"_id").value=A;var E=D.parentNode.parentNode;var J=E.parentNode;var H=-1;while(E!=null){H++;E=E.previousSibling}J.deleteRow(H);var F=mdGetAnswer(C);H=mdSearchIdx(F,G);F.splice(H,1);mdSetAnswer(F,C)}function mdSearchIdx(A,B){for(i=0;i<A.length;i++){if(B==A[i]){return i}}return -1}function mdGetAnswer(B){var C=document.getElementById("md"+B+"_answer").value;if(C.length>0){var A=C.split(",");return A}else{return new Array()}}function mdSetAnswer(B,A){document.getElementById("md"+A+"_answer").value=B.join()}function assessItem(B){var A=top.getForm();A.Grade.value=B;A.Action.value="10009";A.submit();return false}function showItemPreview(C,B){var A=window.open("/pages/learn/preview.smnet?pgcid="+C+"&pginumb="+B+"&prevGinumb="+B,"ShowItem","width=720,height=540,left=30,top=30,toolbar=no,location=no,directories=no,menubar=no,resizable=no,scrollbards=no");A.focus()};
