function xmlhttpPost(strURL,strSRC) {
    var xmlHttpReq = false;
    var self = this;
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('GET', strURL, true);
    self.xmlHttpReq.setRequestHeader("Accept-Language", "ru, en");
    self.xmlHttpReq.setRequestHeader("Accept-Charset", "windows-1251"); 
    self.xmlHttpReq.setRequestHeader("Content-Type", "text/html; charset=Windows-1251"); 
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepage(self.xmlHttpReq.responseText,strSRC);
        }
    }
    self.xmlHttpReq.send(strURL);
}

function updatepage(str,strSRC){
	if (str.length==0) {str="Шрифт входит в библиотеку ParaType. "}
    document.getElementById(strSRC).innerHTML = str;
}
function showdescription(fontcode, foundry, divname)
{
       xmlhttpPost("description.asp?fontcode="+fontcode+"&f="+foundry,divname);
}
function checkEnter(e){ var characterCode; if(e && e.which){ e = e; characterCode = e.which;} else{ e = event; characterCode = e.keyCode; } if(characterCode == 13){ document.forms[1].submit(); return false; } else{ return true; }}
function onSelectEnc (z)
{
    selected = 0;
    frm = document.forms['asearch'];
    frm.flang.value = 0;
    frm.flang.options.length=3;
    for (i=1;i<EAVs.length;i++){

	if (z==EACe[i]) {
		frm.flang.options[i+2] = new Option(EAVs[i],EACe[i],true, true);
		selected = i + 2;
	}
	else {
		frm.flang.options[i+2] = new Option(EAVs[i],EACe[i],false, false);
	}
    }
    frm.flang.selectedIndex = selected; //frm.flang.selectedIndex + 1;
}
function onSelectLang (z)
{
    selected = 0;
    frm = document.forms['asearch'];
    frm.flang.options.length=3;
    for (i=0;i<LAVs.length;i++)
	if (z==LACe[i]) {
		frm.flang.options[i+3] = new Option(LAVs[i],LACe[i],true, true); 
		selected = i + 3;
	}
	else 
		frm.flang.options[i+3] = new Option(LAVs[i],LACe[i],false);

    frm.flang.selectedIndex = selected;
}

 isOpera=(window.opera)?true:false;
 isIE=(document.all && document.all.item && !isOpera);

 function showSamples (fontCode, foundry, divname)
 { 
	if (fontCode == "") return;
	if (!document.all)
		el = eval ('document.getElementById("'+fontCode+'");');
	else
		el = eval (fontCode);
	elimage = eval('document.images["'+"i" + fontCode+'"]');
	if (el.style.display == "none") 
	{
		el.style.display = "block";
		elimage.src = "/pictures/li/redclose.gif";
	}
	else
	{ 
		el.style.display = "none";
		elimage.src = "/pictures/li/redopen.gif";
	}
	if (isIE) window.focus(); 
        for (i=1;i<300;i++)
        {
                if ((!((isIE)&&(document.all.item("im"+fontCode+"_"+i.toString()))))&&(!document.getElementById("im"+fontCode+"_"+i.toString()))) break;
                var pSamples = (!document.getElementById)?document.all.item("im"+fontCode+"_"+i.toString()):document.getElementById("im"+fontCode+"_"+i.toString());
                if (pSamples.src.indexOf("/pic") != 0) 
                        if (pSamples.className.indexOf("/linfo") >= 0) 
                                pSamples.src = "http://www.fontexplorer.com/isroot/FontStore/images/fe" + pSamples(i).className;
                        else 
                                pSamples.src = pSamples.className;
        }
	if ((foundry!='')&&(divname!='')) showdescription(fontCode, foundry, divname)
 }

 function gdo(oV){ if (oV==1000) window.location.href='default.asp?flang=1000';}

