var bGlossary=true;
var oDialog;
var oTimeout="";
var oTimein="";
var oLastNode;
var oNode;
var bInit=false;
var aTerms=new Array();
function CLDEF(){
if((event)&&(event.toElement!=null)){
if(typeof(oTimein)=="number"){
window.clearTimeout(oTimein);
}
if(oDialog.dlg_status==true){
HIDEf();
}
}
}
function HIDEf(){
window.clearTimeout(oTimeout);
oTimeout="";
oDialog.style.display="none";
oDialog.dlg_status=false;
CEI();
}
function CP(){
window.clearTimeout(oTimeout);
oTimeout="";
oDialog.style.display="none";
oDialog.dlg_status=false;
CEI();
}
function SHDEF(oSource){
if(bInit==false){
glossaryInit();
bInit=true;
}
if(bGlossary==true){
if(typeof(arguments[0])=="object"){
oNode=oSource;
}
else{
oNode=window.event.srcElement;
}
var bStatus=oDialog.dlg_status; // BUGBUG: oDialog is null.
if((oLastNode!=oNode)||(bStatus==false)){
if((typeof(oTimein)=="number")&&(event)&&(event.fromElement!=null)){
window.clearTimeout(oTimein);
}
oTimein=window.setTimeout("openDialog(oNode," + event.x + "," + event.y + ")",iTimein*1000);
}
}
}
function CO(oSource){
if(bInit==false){
glossaryInit();
bInit=true;
}
if(bGlossary==true){
if(typeof(arguments[0])=="object"){
alert('D');
oNode=oSource;
}
else{
oNode=window.event.srcElement;
}
var bStatus=oDialog.dlg_status; // BUGBUG: oDialog is null.
if((oLastNode!=oNode)||(bStatus==false)){
if((typeof(oTimein)=="number")&&(event)&&(event.fromElement!=null)){
window.clearTimeout(oTimein);
}
oTimein=window.setTimeout("openDialog(oNode," + event.x + "," + event.y + ")",iTimein*1000);
}
}
}
function glossaryInit(){
if(typeof(g_glossary)=="object"){
oDialog=fnCreateDialog(LWidth,LHeight);
}
else{
alert("Fail");
}
}
function openDialog(oNode,x,y){
var bStatus=oDialog.dlg_status; // BUGBUG: This code assumes that oDialog has been initialized
if(bStatus==false){
oDialog.dlg_status=true;
oDialog.style.display="block";
}
else{
if(typeof(oTimeout)=="number"){
window.clearTimeout(oTimeout);
}
}
if (!oNode.getAttribute("G_RID"))
{
if (oNode.tagName == "FONT")
{
var oParent = oNode.parentNode;
sTerm =  oParent.getAttribute("G_RID");
}
else
{
HIDEf();
return 1;
}
}
else
{
var sTerm= oNode.getAttribute("G_RID");
}
oDialog.innerHTML=g_glossary[sTerm];
var iScrollLeft=document.body.scrollLeft;
var iScrollTop=document.body.scrollTop;
var iOffsetLeft
var iOffsetWidth=oNode.offsetWidth;
var oParent=oNode.parentElement;
var iOffsetParentLeft=0//getAbsoluteLeft(oParent);
var iOffsetTop //- iScrollTop;
var iOffsetDialogWidth=oDialog.offsetWidth;
iOffsetTop=y;
iOffsetLeft=x;
if((iOffsetLeft + iOffsetWidth) > (iOffsetParentLeft + oParent.offsetWidth)){
iOffsetLeft=iOffsetParentLeft;
if(iOffsetLeft - iOffsetDialogWidth>0){
iOffsetTop+=oNode.offsetHeight;
}
}
var iLeft=0;
var iTop=0;
if((iOffsetLeft + iOffsetWidth - iScrollLeft + iOffsetDialogWidth) < document.body.offsetWidth ){
iLeft=iOffsetLeft + iOffsetWidth;
}
else{
if(iOffsetLeft - iOffsetDialogWidth>0){
iLeft=iOffsetLeft - iOffsetDialogWidth;
}
else{
iLeft=iOffsetParentLeft;
}
}
if(iOffsetTop - iScrollTop<oDialog.offsetHeight){
iTop=iOffsetTop + oNode.offsetHeight;
}
else{
iTop=iOffsetTop - oDialog.offsetHeight;
}
oDialog.style.position="absolute";
oDialog.style.top=y+iScrollTop+Offset_Top;
oDialog.style.left=x+iScrollLeft+Offset_Left;
oTimeout=window.setTimeout("HIDEf()",iTimeout*1000);
}
function fnCreateDialog(iWidth,iHeight){
document.body.insertAdjacentHTML("BeforeEnd","<DIV></DIV>");
oNewDialog=document.body.children(document.body.children.length-1);
oNewDialog.style.width=iWidth;
oNewDialog.style.height=iHeight;
oNewDialog.dlg_status=false;
return oNewDialog;
}
function CEG(src,clrOver){
if ((typeof(src)=="object")&&(src!=null)) {
if (!src.contains(event.fromElement)){
src.className = clrOver;
}
}
}
function CN(src,clrOver){
if ((typeof(src)=="object")&&(src!=null)) {
if (!src.contains(event.fromElement)){
src.className = clrOver;
}
}
}
function CEF(src,clrOver){
if ((typeof(src)=="object")&&(src!=null)) {
if (!src.contains(event.fromElement)){
src.className = clrOver;
}
}
}
function CM(src,clrOver){
if ((typeof(src)=="object")&&(src!=null)) {
if (!src.contains(event.fromElement)){
src.className = clrOver;
}
}
}
function CED(src,clrOver){
if ((typeof(src)=="object")&&(src!=null)) {
src.className = clrOver;
}
}
function CL(src,clrOver){
if ((typeof(src)=="object")&&(src!=null)) {
src.className = clrOver;
}
}
function CEDD(theURL,winName) {
window.open(theURL,winName);
}
function CK(theURL,winName) {
window.open(theURL,winName);
}
function CEA(src,clrOver){
if ((typeof(src)=="object")&&(src!=null)) {
src.className = clrOver;
}
}
function CJ(src,clrOver){
if ((typeof(src)=="object")&&(src!=null)) {
src.className = clrOver;
}
}
function CEB(src,clrOver){
if ((typeof(src)=="object")&&(src!=null)) {
src.className = clrOver;
}
}
function CI(src,clrOver){
if ((typeof(src)=="object")&&(src!=null)) {
src.className = clrOver;
}
}
function CEC(src,clrOver){
if ((typeof(src)=="object")&&(src!=null)) {
src.className = clrOver;
}
}
function CH(src,clrOver){
if ((typeof(src)=="object")&&(src!=null)) {
src.className = clrOver;
}
}
function Test(){
alert('Test');
}
function notSupported(){
}
function CDP(src){
try {
if(document.getElementById){
var element=src;//document.getElementById(src);
if(element.scrollIntoView){
element.scrollIntoView(true);
}
else
{
notSupported();
}
}
else
{
notSupported();
}
}
catch(e) {
}
}
function CG(src){
try {
if(document.getElementById){
var element=src;//document.getElementById(src);
if(element.scrollIntoView){
element.scrollIntoView(true);
}
else
{
notSupported();
}
}
else
{
notSupported();
}
}
catch(e) {
}
}
function CEH(src,NameSrc){
try {
if(document.getElementById){
var element=src;//document.getElementById(src);
if ((typeof(src)=="object")&&(src!=null)) {
if(element.scrollIntoView){
element.scrollIntoView(true);
}
else
{
notSupported();
}
}
}
else
{
notSupported();
}
}
catch(e) {
}
}
function CF(src,NameSrc){
try {
if(document.getElementById){
var element=src;//document.getElementById(src);
if ((typeof(src)=="object")&&(src!=null)) {
if(element.scrollIntoView){
element.scrollIntoView(false);
}
else
{
notSupported();
}
}
}
else
{
notSupported();
}
}
catch(e) {
}
}
function CFA(src,NameSrc){
try {
if(document.getElementById){
var element=src;//document.getElementById(src);
if ((typeof(src)=="object")&&(src!=null)) {
if(element.scrollIntoView){
element.scrollIntoView(false);
}
else
{
notSupported();
}
}
}
else
{
notSupported();
}
}
catch(e) {
}
}
function CDP_old(theURL){
document.location.href=CurrentLocation+'#'+theURL
}
function CDP_old(src){
if ((typeof(src)=="object")&&(src!=null)) {
if (!src.contains(event.fromElement)){
if (src.offsetTop>25){
document.getElementById('DivDistintaProdotto').style.top=document.getElementById('DivContainerDistintaProdotto').scrollTop + (-src.offsetTop) + 20;
}
else {
document.getElementById('DivDistintaProdotto').style.top=document.getElementById('DivContainerDistintaProdotto').scrollTop + (-src.offsetTop);
}
}
}
}
function CDPF_old(src,NameSrc){
alert('src='+src);
if ((typeof(src)=="object")&&(src!=null)) {
if (!src.contains(event.fromElement)){
if (src.offsetTop>25){
document.getElementById('DivDistintaProdotto').style.top=document.getElementById('DivContainerDistintaProdotto').scrollTop + (-src.offsetTop) + 20;
}
else {
document.getElementById('DivDistintaProdotto').style.top=document.getElementById('DivContainerDistintaProdotto').scrollTop + (-src.offsetTop);
}
}
}
}
function CEI(){
try{
if (document.getElementById('DivDistintaProdotto').style.top!='0px')
document.getElementById('DivDistintaProdotto').style.top='0px';
}
catch(e){
}
}
function CE(){
try{
if (document.getElementById('DivDistintaProdotto').style.top!='0px')
document.getElementById('DivDistintaProdotto').style.top='0px';
}
catch(e){
}
}
function CWP(theURL,winName,features) {
window.open(theURL,winName,features);
}
function CD(theURL,winName,features) {
window.open(theURL,winName,features);
}
function CDJ() {
var i, args=CDJ.arguments;
for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
function CDT(theURL) {
document.location.href=theURL
}
function CEL(Parm){
return document.getElementById(Parm)
}
function CC(Parm){
return document.getElementById(Parm)
}
function CEM(theURL)
{
opener.document.location.href = theURL;
window.close();
}
function CB(theURL)
{
opener.document.location.href = theURL;
window.close();
}
function CEN(theURL) {
document.location.href=theURL;
}
function CA(theURL) {
document.location.href=theURL;
}
function FlashLoadedTrue(){
FlashLoaded=true;
}
function CE5CheckAllout(elm)
{
for (var i=0; i<(document.CARRELLO.elements.length); i++)
{
var e=document.CARRELLO.elements[i];
e.checked=elm.checked;
}
}
function CE5CheckAllAdd()
{
for (var i=0; i<(document.CEPARTSLIST.elements.length); i++)
{
var e=document.CEPARTSLIST.elements[i];
e.checked=true;
}
}
function CE5CheckAllClear()
{
for (var i=0; i<(document.CEPARTSLIST.elements.length); i++)
{
var e=document.CEPARTSLIST.elements[i];
e.checked=false;
}
}
function CE5CheckAllAddSeleted()
{
var Valori='|';
for (var i=0; i<(document.CEPARTSLIST.elements.length); i++)
{
var e=document.CEPARTSLIST.elements[i];
if (e.checked==true) {
Valori=Valori + e.value + '|';
}
}
if (Valori=='|'){
return '';
}
else {
return Valori;
}
}

