home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Minami 48
/
MINAMI48.ISO
/
Extra
/
MPSetup.exe
/
1033
/
RCDATA
/
CABINET
/
wmplayer.chm
/
glossary.js
< prev
next >
Wrap
Text File
|
2002-12-04
|
7KB
|
210 lines
/*
Glossary.js ver 1.00.5.a - 1:05 PM 7/24/2002
*/
/* Start Localize */
var L_EntryNotFound = "<SPAN STYLE='color:red; font-weight:bold'>No se encuentra la definici≤n.</SPAN>";
var L_PopUpTitle = "TΘrmino del glosario";
/* End Localize */
var bIE = 0;
var bNN = 0;
var glbPlatformCode = 0;
var glbBrowserCode = 0;
var glbVersion = 0;
var glbSubVersion = 0;
var uav = window.navigator.appVersion;
var uan = window.navigator.appName;
if (parseInt(uan.indexOf("Internet Explorer")) >= 0){
glbBrowserCode = 10;
glbVersion = parseInt(uav.substring(uav.indexOf("MSIE ") + 5,uav.indexOf("MSIE ") + 7));
glbSubVersion = parseInt(uav.substring(uav.indexOf("MSIE ") + 7,uav.indexOf("MSIE ") + 9));
bIE = 1;
}
if (parseInt(uan.indexOf("Netscape")) >= 0){
glbBrowserCode = 20;
glbVersion = parseInt(uav.substring(0,4));
glbSubVersion = parseInt(uav.substring(2,4));
bNN = 1;
}
if (uav.lastIndexOf("Win") >= 0){
glbPlatformCode = 10;
if ((uav.lastIndexOf("Windows 95") >= 0) || (uav.lastIndexOf("Win95") >= 0)){
glbPlatformCode = 11;
}
if ((uav.lastIndexOf("Windows 98") >= 0) || (uav.lastIndexOf("Win98") >= 0)){
glbPlatformCode = 12;
}
if ((uav.lastIndexOf("Windows NT") >= 0) || (uav.lastIndexOf("WinNT") >= 0)){
glbPlatformCode = 20;
}
}
else
{
if (uav.lastIndexOf("Mac") >= 0){
glbPlatformCode = 30;
}
}
var oPopup = 0;
var sDBGlossary = "../dbGlossary.csv";
var bDataSetComplete = 0;
var sPopUpBGColor = "lightblue"; // popup background color
var sPopUpShadowBGColor = "gray"; // popup background color
function InitializePopUp()
{
if (bIE && ( ( glbVersion >=5 && glbSubVersion >= 0) || (glbVersion >= 6) ) ){
enablePopUp();
}
else{
disablePopUp();
}
}
function enablePopUp(){
var sStyle = "";
sStyle += '<STYLE> #PopUp{cursor: hand; color: green; text-decoration: underline;}</STYLE>\n';
sStyle += '<STYLE> #idGlossary{cursor: hand; color: green; text-decoration: underline;}</STYLE>\n';
var sOnClickEvent = '';
sOnClickEvent += '<SCR' + 'IPT LANGUAGE="JScript" FOR="PopUp" EVENT="onclick">';
sOnClickEvent += ' getTermDefinition(this);' ;
sOnClickEvent += ' window.event.returnValue = false;';
sOnClickEvent += '</SCR' + 'IPT>' ;
var sOnMouseOverEvent = '';
sOnMouseOverEvent += '<SCR' + 'IPT LANGUAGE="JScript" FOR="PopUp" EVENT="onmouseover">';
sOnMouseOverEvent += ' this.title = "' + L_PopUpTitle + '";';
sOnMouseOverEvent += '</SCR' + 'IPT>';
var sObj = "";
sObj += '<OBJECT ID="dbGlossary" CLASSID="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83" STYLE="height: 0; width: 0; display:none; position:absolute;" ondatasetcomplete="bDataSetComplete = 1">';
sObj += ' <PARAM NAME="DataURL" VALUE="' + sDBGlossary + '">';
sObj += ' <PARAM NAME="UseHeader" VALUE="True">';
sObj += ' <PARAM NAME="TextQualifier" VALUE="|">';
sObj += '</OBJECT>\n';
var sEvtHandle = '';
sEvtHandle += '<SCR' + 'IPT LANGUAGE="JScript">';
sEvtHandle += ' document.onmousedown = hidePopUp;';
sEvtHandle += ' window.onresize = hidePopUp;';
sEvtHandle += '</SCR' + 'IPT >';
var sPopUp = '';
sPopUp += '<DIV ID="idPopUpTray" STYLE="display: none; z-index:1; width:400; height:10; position:absolute; padding: 0; border-style: inset; border-width:0;">';
sPopUp += ' <DIV ID="idPopUp" STYLE="z-index:3; width:400; height: 10; position:absolute; font:8pt Tahoma; line-height: 8pt; background-color:' + sPopUpBGColor + '; top: 0; left: 0; padding: 7; margin: 6; border-style: inset; border-left-width: 1; border-top-width: 1; border-right-width: 2; border-bottom-width: 2; border-right-color: black; border-bottom-color: black; "> </DIV>';
sPopUp += ' <DIV ID="idPopUpShadow" STYLE="z-index:2; width:400; height: 10; position:absolute; font:8pt Tahoma; line-height: 8pt; background-color:' + sPopUpShadowBGColor + '; color:' + sPopUpShadowBGColor + ';top: 6; left:-6; padding: 7; margin: 6; border-style: solid; border-left-width: 1; border-top-width: 1; border-right-width: 2; border-bottom-width: 2; border-right-color: black; border-color:' + sPopUpShadowBGColor + '; filter:alpha(opacity=50, style=0);"> </DIV>';
sPopUp += '</DIV>' ;
window.self.document.write(sStyle);
window.self.document.write(sOnClickEvent);
window.self.document.write(sOnMouseOverEvent);
window.self.document.write(sObj);
window.self.document.write(sPopUp);
window.self.document.write(sEvtHandle);
}
function disablePopUp(){
var sStyle = "";
sStyle += '<STYLE> #PopUp{color: black; text-decoration: none; cursor="default"}</STYLE>';
var sStyle1 = "";
sStyle1 += '<STYLE> #idGlossary{color: black; text-decoration: none; cursor="default"}</STYLE>';
window.self.document.write(sStyle);
var sOnClickEvent = "";
sOnClickEvent += '<SCR' + 'IPT LANGUAGE="JScript" FOR="PopUp" EVENT="onclick">';
sOnClickEvent += ' window.event.returnValue = false;';
sOnClickEvent += ' return false;';
sOnClickEvent += '</SCR' + 'IPT>\n' ;
window.self.document.write(sStyle);
window.self.document.write(sOnClickEvent);
}
function getTermDefinition(oObj){
var ar, sRid;
if (oObj.href){
ar = oObj.href.split("#");
ar.length > 1 ? sRid = ar[1] : sRid = "";
}
else{
sRid = oObj.RID;
}
var Gls = getDefinition(sRid);
setPopUpTray(idPopUpTray);
var sDef = "";
if (Gls.found){
sDef += formatTerm(Gls.term);
sDef += formatDefinition(Gls.definition);
}
else{
sDef += L_EntryNotFound;
}
idPopUp.innerHTML = sDef;
idPopUpShadow.innerHTML = sDef;
displayPopUp(1);
}
function getDefinition(sKey){
var oRecordSet = dbGlossary.recordset;
oRecordSet.MoveFirst();
var def = new DEF();
for(var i = 0; i < oRecordSet.RecordCount; i++)
{
if(sKey.toLowerCase() == oRecordSet.fields.item('rid').value.toLowerCase())
{
def.term = oRecordSet.fields.item('key').value;
def.definition = oRecordSet.fields.item('def').value;
def.found = 1;
return def;
}
oRecordSet.MoveNext();
}
def.term = sKey;
def.definition = L_EntryNotFound;
return def;
}
function DEF(){
this.term = "";
this.definition = "";
this.found = 0;
}
function formatTerm(sStr){
return ("<B>" + sStr + "</B><BR>");
}
function formatDefinition(sStr){
return (" " + sStr + " ");
}
function setPopUpTray(oObj)
{
var offSetLeft = window.event.clientX + document.body.scrollLeft ;
var offSetTop = window.event.clientY + document.body.scrollTop ;
var offSetWidth = document.body.offsetWidth;
if (((offSetLeft + 430) > offSetWidth) && (offSetWidth > 430 ))
{
offSetLeft = offSetWidth - parseInt(oObj.style.width) - 34 ;
}
oObj.style.left = offSetLeft; // set new x coordinate
oObj.style.top = offSetTop; // set new y coordinate
}
function displayPopUp(nState){
if(nState == 0)
{
idPopUpTray.style.display = "none";
}
else if(nState == 1)
{
idPopUpTray.style.display = "";
fadeIn(idPopUp);
idPopUpShadow.focus();
}
}
function hidePopUp(){
if(window.event.srcElement == null)
{
displayPopUp(0);
}
else if (window.event.srcElement.id != "idGlossary")
{
displayPopUp(0);
}
}
function fadeIn(oObj){
oObj.style.filter="blendTrans(duration=.30";
if (oObj.filters.blendTrans.status != 2)
{
oObj.style.visibility="hidden";
oObj.filters.blendTrans.apply();
oObj.style.visibility="visible";
oObj.filters.blendTrans.play();
}
}
InitializePopUp();