//
//Function to obfuscate email address
//
function obfus(obj) {
hidnav=document.getElementById(obj);
//alert(hidnav.firstChild.nodeValue);
hidnav.firstChild.nodeValue='sharrahdesigns@verizon.net';
return (null);
}
////
//Function to handle change event on navigation selection
//
function onselectc(obj,pname,val) {
///document.shref.submit();
////    primak='runmfrm.php'+'?primak='+nxtfrm+'$'+primk;
selpag=document.getElementById(obj).selectedIndex;
///alert(' id    '+obj+' name  '+name+' value  '+val+' selidx  '+selpag);
primak='produc.php'+'?cpage='+val;
location.href=primak;
return (null);
}
//
//Function to handle Navigation buttons
//
function navigate(obj,pname,cpage) {
/*    
///<input type="hidden" name="cmdHidnav" id="cmdHidnav" value="???????" />
hidnav=document.getElementById("cmdNav");
if (hidnav== null){
   return (null);    
}
*/
cursel=document.getElementById("navRec").selectedIndex;
 nlis=document.getElementById("navRec").childNodes;
 totopt=(nlis.length-1)/2-1;                // the count starts with 0 !!!
 if (brw !='ff'){
     totopt=(nlis.length/2);
 }
switch (pname){    
    case "cmdFirst":
        cpag='ccablew';
     break;
    case "cmdPrev":
        if(cursel<1){
            break;
        }
        document.getElementById("navRec").selectedIndex=cursel-1;
        cpag=document.getElementById("navRec").value;
        break;
    case "cmdNext":
        if (cursel>=totopt){
            break;
        }
        document.getElementById("navRec").selectedIndex=cursel+1;
        cpag=document.getElementById("navRec").value;
        break;
    case "cmdLast":
       cpag='omega';
     break;
}
  primak='produc.php'+'?cpage='+cpag;
  location.href=primak;
 window.event.returnValue=false;    // this is stupid for IE+FireFox
/*
return (null);
 if (brw !='ff'){
  window.event.returnValue=false;    // this is stupid
 }
///   setat(hidnav,'value',cpage);
return (null);
*/
}
////*
//// Function to handle Data Table hovering
//*
function onmvct(obj,pname) {
//***
/// Eliminate hoover for the table of data  5/8/9
//
return (null);
    cdvt=document.getElementById(obj);
    if (cdvt != null) {
         setat(cdvt,'class',"cdivth");
       }
return (null);
}
////*
//// Function to handle Data Table hovering
//*
function onmoct(obj,pname) {
    cdvt=document.getElementById(obj);
    if (cdvt != null) {
         setat(cdvt,'class',"cdivtab");
       }
return (null);
}
//
////*
//// Function to handle product selection
//*
function onprmo(objid,pname) {
// 
//*
////// 1st page selected 3rd attribute is class
//*
/// Find all div that are siblings
//
//
//// get the first thumbnail div prdyel
//
// make all div invisible
namfrm=frmnam;
///frmnam='';
showmsg=pname+' get in onprmo  '+objid;
mesagw(showmsg);
openDialog();
prdy=document.getElementById('prdyel');
visinvis(document.getElementById('prdyel'),'invisible');
visinvis(document.getElementById('prdwht'),'invisible');
visinvis(document.getElementById('prdear'),'invisible');
visinvis(document.getElementById('prdreg'),'invisible');
visinvis(document.getElementById('prdomg'),'invisible');
visinvis(document.getElementById(pname),'visible');
return ;
    prdy=document.getElementById('prdyel');
    if( prdy == null) {return (null)
    }
    prdpar=prdy.parentNode.childNodes;
    prdpl=prdpar.length;
    msgtxt='';
    if (document.getElementById('prdyel') !=null) {
        setat(document.getElementById('prdyel'),'class',"prdyuv");
        flrclc(1);
    }
    if (document.getElementById('prdwht') !=null) {
        setat(document.getElementById('prdwht'),'class',"prdyuv");
        flrclc(1);
    }
    if (document.getElementById('prdreg') !=null) {
        setat(document.getElementById('prdreg'),'class',"prdyuv");
        flrclc(1);
    }
    if (document.getElementById('prdear') !=null) {
        setat(document.getElementById('prdear'),'class',"prdyuv");
        flrclc(1);
    }
    if (document.getElementById('prdomg') !=null) {
        setat(document.getElementById('prdomg'),'class',"prdyuv");
        flrclc(1);
    }
    if (document.getElementById('prdovs') !=null) {
        setat(document.getElementById('prdovs'),'class',"prdyuv");
        flrclc(1);
    }
//
/// Make all product div invisible
//
/// Make This div visible
//
    prdy=document.getElementById(pname);
    if (prdy != null){
     messag("inpbut",'visible onprmo'+pname);
     setat(prdy,'class',"prdyel");
     flrclc(0);
    }
return (null);

    switch (pname) {
        case "prodyel":      
        case "prdyel":                
         messag("inpbut",'on mousover set visible');
          setat(prdy,'class',"prdyel");
        case "prdwht":
//*
//// Browser fix for attributes
//* obj-- Objct
//  onmouseover="onprmo(this.id,'prodwht')"
//* att== atribute name
/////function setat (obj,att,val)
         break;
      }
return (null);
}    
//*
//// Function to Start/Stop the Visual menu choices
//*
function onldmen(objid,pname) {
// 
//*
////// 1st page selected 3rd attribute is class
//*
//        case 1:
    prdy=document.getElementById(objid);
    if (pname == 'div')  {
          messag("inpbut",pname);
          visinvis(prdy,"invis");
          visinvis(document.getElementById('lc'),'invis');
          visinvis(document.getElementById('rc'),'invis');
          return (null);
     }
    if (prdy != null )  {
          messag("inpbut",pname);
///          pagnam='ipagnam='+obj;
          visinvis(prdy,"invis");
////          setat(prdy,'class',"prdyuv");
          primak='produc.php'+'?cpage='+pname;
          location.href=primak;
          return (null);
///             new Ajax.Request(yel, { method:'get' });
//          $.post(yel);
            if (ajxf() !=  true) {
                alert ("Cannot send page !");
            }
            if (xmlHttp==null){
                alert ("Your browser does not support AJAX!");
                return (null);
            }
            yel=yel+"?cpage="+pname;
            xmlHttp.open("POST",yel,true);
            xmlHttp.send(null);
            alert(' before whil;e  yel '+yel);
            while (xmlHttp.readyState != 4){
            }
            alert(' before xmlHttp')
            if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
                 alert (" HTTP DONE ready state "+xmlHttp.readyState);
             }
     }
return (null);
}
//*
//// Function to Flicker lc/rc
//*
function flrclc(onoff) {
    lcv=document.getElementById('lc');
    rcv=document.getElementById('rc');
if (lcv== null) {
    return(null);
}
switch (onoff){
    case 1:
      setat(lcv,'class',"lc");
      setat(rcv,'class',"rc");
      break;
    case 0:
      setat(lcv,'class',"prdyuv");
      setat(rcv,'class',"prdyuv");
      break;
}
return (null);
}
