var am_Req;
var am_AutocompleteDIV;
var am_AutocompleteHasFocus=false;
var GlobalDate=new Date();
function AM_TrimAll(sString){while(sString.substring(0,1)==' '){sString=sString.substring(1,sString.length);}while(sString.substring(sString.length-1,sString.length)==' '){sString=sString.substring(0,sString.length-1);}return sString;}
function AM_SetAutocompleteHasFocusTrue(){am_AutocompleteHasFocus=true;}
function AM_SetAutocompleteHasFocusFalse(){am_AutocompleteHasFocus=false;}
function AM_HideAutocompleteIfNotFocused(){if(am_AutocompleteHasFocus==false)document.getElementById('autocomplete').style.visibility='hidden'}
function AM_Initialize(){try{am_Req=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{am_Req=new ActiveXObject("Microsoft.XMLHTTP");}catch(oc){am_Req=null;}}
if(!am_Req && typeof XMLHttpRequest!="undefined")am_Req=new XMLHttpRequest();
}
function AM_SendQuery(key) { if (typeof AM_SendQuery.alreadyrunning == 'undefined') AM_SendQuery.alreadyrunning = '0'; if (typeof AM_SendQuery.keyshown == 'undefined') AM_SendQuery.keyshown = 'xxnothingxx'; if (typeof AM_SendQuery.currentkey == 'undefined') AM_SendQuery.currentkey = key; else AM_SendQuery.currentkey = key; if (AM_SendQuery.alreadyrunning = '0') { AM_SendQuery.alreadyrunning = '1'; window.setTimeout("later()", 400); } }
function later() { if (AM_SendQuery.keyshown != AM_SendQuery.currentkey) { AM_SendQuery.alreadyrunning = '0'; AM_SendQuery.keyshown = AM_SendQuery.currentkey; var keyInHtml = encodeURI(AM_SendQuery.currentkey); AM_Initialize(); var url = "./dict.aspx?k=" + keyInHtml + "&ref=" + window.location.href; if (am_Req != null) { am_Req.onreadystatechange = AM_Process; am_Req.open("GET", url, true); am_Req.send(null); } } }
function Expandthis(TheElement, inp_ExpandOrNot) { if (typeof Expandthis.StopExpansion == 'undefined') Expandthis.StopExpansion = 0; if (typeof Expandthis.ThisElement == 'undefined') Expandthis.ThisElement = TheElement; if (inp_ExpandOrNot == 1) { window.setTimeout("later2()", 400); Expandthis.StopExpansion = 0; } else if (inp_ExpandOrNot == 0) { Expandthis.StopExpansion = 1; } else if (inp_ExpandOrNot == -1) { TheElement.style.maxHeight = '21px'; TheElement.style.backgroundImage = 'url(./i/221b.gif)'; TheElement.style.backgroundColor = '#fff'; } }
function later2() { if (Expandthis.StopExpansion == 0) { Expandthis.ThisElement.style.backgroundColor = '#fff'; Expandthis.ThisElement.style.maxHeight = '100%'; Expandthis.ThisElement.style.backgroundImage = 'url(./i/221c.gif)'; } else { Expandthis.ThisElement.style.maxHeight = '21px'; Expandthis.ThisElement.style.backgroundImage = 'url(./i/221b.gif)'; Expandthis.ThisElement.style.backgroundColor = '#fff' } }
function AM_SendQuery2(key, am_divname, am_ajaxpage) {
    var keyInHtml = encodeURI(key); AM_Initialize(); var url = "./" + am_ajaxpage + ".aspx?key=" + keyInHtml + "&ref=" + window.location.href; am_AutocompleteDIV = am_divname;
    if (am_Req != null) { am_Req.onreadystatechange = AM_Process2; am_Req.open("GET", url, true); am_Req.send(null); }
}
function AM_Process(){if(am_Req.readyState==4){
if(am_Req.status==200){if(am_Req.responseText==""||am_Req.responseText==" "){HideDiv("autocomplete");}else{ShowDiv("autocomplete");HideDiv("defaulttext_am");document.getElementById("autocomplete").innerHTML=am_Req.responseText;}}
else{document.getElementById("autocomplete").innerHTML="Issue:<br/>"+am_Req.statusText;}}
}
function AM_Process2(){if(am_Req.readyState==4){
if(am_Req.status==200){if(am_Req.responseText==""||am_Req.responseText==" "){HideDiv(am_AutocompleteDIV);}else{ShowDiv(am_AutocompleteDIV);document.getElementById(am_AutocompleteDIV).innerHTML=am_Req.responseText;}}
else{document.getElementById(am_AutocompleteDIV).innerHTML="Issue:<br/>"+am_Req.statusText;}}
}
function ShowDiv(divid){if(document.layers)document.layers[divid].visibility="show";else document.getElementById(divid).style.visibility="visible";}
function HideDiv(divid){if(document.getElementById(divid)!=null){if(document.layers)document.layers[divid].visibility="hide";else document.getElementById(divid).style.visibility="hidden";}}
function UWT_Search_FindSelectionOn_Click(oToolbar,oButton,oEvent){
switch(oButton.Key){case'selection_google':q=document.selection.createRange().text;q=AM_TrimAll(q);location.target='_blank';if(q)window.open('http://www.google.com/search?hl=en&q='+encodeURI(q),'_blank');break;
case'selection_amazon':q=document.selection.createRange().text;q=AM_TrimAll(q);q=q.replace(" ","+");location.target='_blank';if(q)window.open('http://www.amazon.com/s/url=search-alias%3Daps&field-keywords='+encodeURI(q),'_blank');break;
case'selection_ebay':q=document.selection.createRange().text;q=AM_TrimAll(q);q=q.replace(" ","+");location.target='_blank';if(q)window.open('http://search.ebay.de/search/search.dll?cgiurl=http%3A%2F%2Fcgi.ebay.de%2Fws%2F&satitle='+encodeURI(q),'_blank');break;
case'selection_wikipedia':q=document.selection.createRange().text;q=AM_TrimAll(q);q=q.replace(" ","_");location.target='_blank';if(q)window.open('http://www.wikipedia.org/wiki/'+encodeURI(q),'_blank');break;
default:break;}
}
function AM_KeyPressHandler(e){var kC=(window.event)?event.keyCode:e.keyCode;var Esc=(window.event)?27:e.DOM_VK_ESCAPE;if(kC==Esc)document.getElementById('SuggesteField').value='';}
function AM_ShowAutocomplete(e){if(e.value!=''&this.value!=' ')document.getElementById('autocomplete').style.visibility='visible';}
function AM_HideAutocomplete(e){AM_HideAutocomplete.e=e;window.setTimeout("waitabit()",150);}
function waitabit(){try {document.getElementById(AM_HideAutocomplete.e).style.visibility='hidden';}catch(err){}}
function AM_FocusAndSelect(e){e.focus();e.select();} 
function AM_Row(e){e.rows=e.rows*2;}
function TabNav(DoNot){
if(DoNot!='tabnav_nav')H('tabnav_nav');
if(DoNot!='tabnav_color')H('tabnav_color');
if(DoNot!='tabnav_delete')H('tabnav_delete');
if(DoNot!='tabnav_edit')H('tabnav_edit');
if(DoNot!='tabnav_mark')H('tabnav_mark');
try{if(DoNot!='tabnav_modifier'){H('tabnav_modifier');document.getElementById('WT_ctl02_WARP_ModifierWords').style.width='38px';}}catch(e){H('tabnav_modifier');}
if(DoNot!='tabnav_number')H('tabnav_number');
if(DoNot!='tabnav_security')H('tabnav_security');
if(DoNot!='tabnav_select')H('tabnav_select');
if(DoNot!='tabnav_mark')document.getElementById('tabnav').style.height='100%';
TabHide(DoNot);}
function TabObj(DoNot) {
    if (DoNot != 'tabfocobj_duplicate')  H('tabfocobj_duplicate');
    try { if (DoNot != 'tabfocobj_transform') { H('tabfocobj_transform'); document.getElementById('WT_ctl05_WARP_FocusInstance_Transform').style.width = '30px'; } }
    catch(e){H('tabfocobj_transform');}
    if (DoNot != 'tabfocobj_color') H('tabfocobj_color');
    if (DoNot != 'tabfocobj_lang') H('tabfocobj_lang');
    if (DoNot != 'tabfocobj_lookup') H('tabfocobj_lookup');
    if (DoNot != 'tabfocobj_epi') H('tabfocobj_epi');
    if (DoNot != 'tabfocobj_fav') H('tabfocobj_fav');
    if (DoNot != 'tabfocobj_destroy') H('tabfocobj_destroy');
    if (DoNot != 'tabfocobj_delete') H('tabfocobj_delete');
    if (DoNot != 'prop') H('prop');
    if (DoNot != 'tabfocobj_status') H('tabfocobj_status');
    document.getElementById('tabfocobj').style.height = '100%';
    TabHide(DoNot);}
function TabHide(DoNot){if(DoNot!=''){document.getElementById(DoNot).style.visibility='visible';document.getElementById(DoNot).style.height='100%';}}
function H(Do){try { document.getElementById(Do).style.visibility = 'hidden'; document.getElementById(Do).style.height = '0px'; document.getElementById(Do).style.width = "auto"; } catch (e) { }  }
function In(N){N.style.color='#fff';N.style.width='0px';for(var x=0;N.childNodes[x];x++){for(var y=0;N.childNodes[x].childNodes[y]; y++){N.childNodes[x].childNodes[y].style.visibility='visible';N.childNodes[x].childNodes[y].style.width='auto';}}}
function Out(N,col){N.style.color=col;N.style.width='auto';for(var x=0;N.childNodes[x];x++){for(var y=0;N.childNodes[x].childNodes[y];y++){N.childNodes[x].childNodes[y].style.visibility='hidden';N.childNodes[x].childNodes[y].style.width='0px';}}}
function OutA(N) { Out(N, '#999') }
function OutIA(N) { Out(N, '#ddd') }
function TabTopIn(obj_this,str_tab){document.getElementById(str_tab).style.visibility = 'visible'; document.getElementById(str_tab).style.height = '110%'; obj_this.style.visibility = 'hidden'; obj_this.style.height = '0px'; document.getElementById('div_menue').style.marginBottom = '1.8%'; }
function TabTopClick(str_tab){document.getElementById(str_tab).style.height='0px';document.getElementById('men').style.height='0px';TabHide('');}
function TabClick(obj_this, str_tabtop) { TabHide(''); document.getElementById('men').style.height = '0px'; document.getElementById('mentop').style.backgroundImage = 'url(./i/221b.gif)'; document.getElementById('mentop').style.visibility = 'visible'; document.getElementById('mentop').style.height = '6px'; document.getElementById('div_menue').style.marginBottom = '0.5%'; }
function In2(N) 
{
    N.style.backgroundImage = 'url(./i/221f.gif)'; N.style.backgroundColor = '#fff'; N.style.marginLeft = ''; N.style.height = '';
    for (var x = 0; N.childNodes[x]; x++) { try { N.childNodes[x].style.visibility = 'visible';if (N.childNodes[x].type == 'textarea') N.focus(); } catch (e) { } } 
}
function Out2(N) 
{
            var HasText = 0;

            for (var x = 0; N.childNodes[x]; x++) 
                {
                    try {                        
                        if (
                                ((N.childNodes[x].type == 'textarea' || N.childNodes[x].type == 'text') && N.childNodes[x].value != '')
                                || (N.childNodes[x].type == 'select-one' && N.childNodes[x].options[N.childNodes[x].selectedIndex].text != '-') 
                            )
                        {
                            HasText = 1;                             
                        }
                    }                             
                    catch (e) { } 
                }
            if (HasText == 0) 
                {
                    N.style.backgroundImage = 'url(./i/221e.gif)';
                    N.style.backgroundColor = '#f9f9f9';
                    N.style.marginLeft = '10px';
                    N.style.height = '7px';
                    for (var x = 0; N.childNodes[x]; x++) 
                    {
                        try { N.childNodes[x].style.visibility = 'hidden'; }
                        catch (e) { }
                    }
                } 
}
function Cc(obj,evt){var e=(evt) ? evt : window.event;if(window.event){e.cancelBubble=true;}else{e.stopPropagation();}}

