function highlightrow(itemid){
  var theOBJA = (document.getElementById) ? document.getElementById(itemid+'a') : eval("document.all['" + itemid + "a']");
  var theOBJB = (document.getElementById) ? document.getElementById(itemid+'b') : eval("document.all['" + itemid + "b']");
  var theOBJC = (document.getElementById) ? document.getElementById(itemid+'ln') : eval("document.all['" + itemid + "ln']");
  theOBJA.style.backgroundColor = "#DCEEFF";
  theOBJB.style.backgroundColor = "#DCEEFF";
  theOBJC.style.color = "#005fa9";
}

function lowlightrow(itemid){
  var theOBJA = (document.getElementById) ? document.getElementById(itemid+'a') : eval("document.all['" + itemid + "a']");
  var theOBJB = (document.getElementById) ? document.getElementById(itemid+'b') : eval("document.all['" + itemid + "b']");
  var theOBJC = (document.getElementById) ? document.getElementById(itemid+'ln') : eval("document.all['" + itemid + "ln']");
  theOBJA.style.backgroundColor = "#FFFFFF";
  theOBJB.style.backgroundColor = "#FFFFFF";
  theOBJC.style.color = "#444444";
}


function highlightrow2(itemid, itxt){
  var theOBJA = (document.getElementById) ? document.getElementById(itemid+'a') : eval("document.all['" + itemid + "a']");
  var theOBJB = (document.getElementById) ? document.getElementById(itemid+'b') : eval("document.all['" + itemid + "b']");
  var theOBJC = (document.getElementById) ? document.getElementById(itemid+'ln') : eval("document.all['" + itemid + "ln']");
  var theOBJD = (document.getElementById) ? document.getElementById(itemid+'txt') : eval("document.all['" + itemid + "txt']");
  theOBJA.style.backgroundColor = "#DCEEFF";
  theOBJB.style.backgroundColor = "#DCEEFF";
  theOBJC.style.color = "#005fa9";
  theOBJD.innerHTML = itxt;

}

function lowlightrow2(itemid, itxt){
  var theOBJA = (document.getElementById) ? document.getElementById(itemid+'a') : eval("document.all['" + itemid + "a']");
  var theOBJB = (document.getElementById) ? document.getElementById(itemid+'b') : eval("document.all['" + itemid + "b']");
  var theOBJC = (document.getElementById) ? document.getElementById(itemid+'ln') : eval("document.all['" + itemid + "ln']");
  var theOBJD = (document.getElementById) ? document.getElementById(itemid+'txt') : eval("document.all['" + itemid + "txt']");
  theOBJA.style.backgroundColor = "#FFFFFF";
  theOBJB.style.backgroundColor = "#FFFFFF";
  theOBJC.style.color = "#444444";
  theOBJD.innerHTML = itxt;
}




function headhigh(itemid){
  var theOBJA = (document.getElementById) ? document.getElementById('head'+itemid+'a') : eval("document.all['head" + itemid + "a']");
  var theOBJB = (document.getElementById) ? document.getElementById('head'+itemid+'b') : eval("document.all['head" + itemid + "b']");
  theOBJA.className= "headbuthover";
  theOBJB.className= "headbuthover";
}

function headlow(itemid){
  var theOBJA = (document.getElementById) ? document.getElementById('head'+itemid+'a') : eval("document.all['head" + itemid + "a']");
  var theOBJB = (document.getElementById) ? document.getElementById('head'+itemid+'b') : eval("document.all['head" + itemid + "b']");
  theOBJA.className= "headbut";
  theOBJB.className= "headbut";
}



function mainpreload(){

 heada= new Image;
 heada.src = "images/menu_selected.gif";

 headb = new Image;
 headb.src = "images/menu_hover.gif";

 headc = new Image;
 headc.src = "images/menu_regular.gif";

 headd = new Image;
 headd.src = "images/menu_phone.gif";

}



var bloaded = false;

function preload(){

 bchat_on = new Image;
 bchat_on.src = "images/btn_chat_down.gif";

 bchat_off = new Image;
 bchat_off.src = "images/btn_chat.gif";

 blogin_on = new Image;
 blogin_on.src = "images/btn_login_down.gif";

 blogin_off = new Image;
 blogin_off.src = "images/btn_login.gif";

 bloaded = true;

}

function bu1(imgName){
  if (bloaded){
    var theOBJ = (document.getElementById) ? document.getElementById(imgName) : eval("document.all['" + imgName + "']");
    theOBJ.src= eval(imgName + "_on.src");
  }
}

function bu0(imgName){
  if (bloaded){
    var theOBJ = (document.getElementById) ? document.getElementById(imgName) : eval("document.all['" + imgName + "']");
    theOBJ.src= eval(imgName + "_off.src");
  }
}





function nextitem(){



 if (curitem<maxitem&&maxitem>1){

    curitem++;


    //var theOBJA = (document.getElementById) ? document.getElementById('mainpic') : eval("document.all['mainpic']");

    //theOBJA.src= itempath+'photo'+curitem+'.jpg';
    loadportimg(1, itempath+'photo'+curitem+'.jpg');   
  }
}

function previtem(){

 if (curitem>1&&maxitem>1){

    curitem=curitem-1;
    
    //var theOBJA = (document.getElementById) ? document.getElementById('mainpic') : eval("document.all['mainpic']");
    //theOBJA.src= itempath+'photo'+curitem+'.jpg';
    loadportimg(0, itempath+'photo'+curitem+'.jpg');    
  }

}


var bloaded2 = false;

function preload2(){

 photo_on = new Image;
 photo_on.src = "images/folio_photo_selected.gif";

 photo_off = new Image;
 photo_off.src = "images/folio_photo.gif";

 print_on = new Image;
 print_on.src = "images/folio_print_selected.gif";

 print_off = new Image;
 print_off.src = "images/folio_print.gif";

 digital_on = new Image;
 digital_on.src = "images/folio_digital_selected.gif";

 digital_off = new Image;
 digital_off.src = "images/folio_digital.gif";

 portloader = new Image;
 portloader.src = "images/folio_loader.gif";


 bloaded2 = true;

}

function pbu1(imgName){
  if (bloaded2){
    var theOBJ = (document.getElementById) ? document.getElementById(imgName) : eval("document.all['" + imgName + "']");
    theOBJ.src= eval(imgName + "_on.src");
  }
}

function pbu0(imgName){
  if (bloaded2){
    var theOBJ = (document.getElementById) ? document.getElementById(imgName) : eval("document.all['" + imgName + "']");
    theOBJ.src= eval(imgName + "_off.src");
  }
}


function loadportimg(dirctn, imgName){

  var theOBJ = (document.getElementById) ? document.getElementById('mainpic') : eval("document.all['mainpic']");
  theOBJ.src= portloader.src;
  
  portimg = new Image;
  portimg.src = imgName;

  if (dirctn==1) {
    portimg.onload=new function() { swapportimg1(imgName); }
    portimg.onerror=new function() { swapportimg1(imgName); }
  } else {
    portimg.onload=new function() { swapportimg0(imgName); }
    portimg.onerror=new function() { swapportimg0(imgName); }
  }

}

function swapportimg1(imgName){

    var theOBJB = (document.getElementById) ? document.getElementById('btnnext') : eval("document.all['btnnext']");
    var theOBJC = (document.getElementById) ? document.getElementById('btnprev') : eval("document.all['btnprev']");
    var theOBJD = (document.getElementById) ? document.getElementById('lnknext') : eval("document.all['lnknext']");
    var theOBJE = (document.getElementById) ? document.getElementById('lnkprev') : eval("document.all['lnkprev']");


  var theOBJ = (document.getElementById) ? document.getElementById('mainpic') : eval("document.all['mainpic']");
  theOBJ.src= imgName;

    if (curitem>=maxitem&&maxitem>1) {
      theOBJB.src= 'images/folio_no_next.gif';
      theOBJD.className= 'nopointer';
    }
    
    if (curitem>1&&maxitem>1) {
      theOBJC.src= 'images/folio_prev.gif';
      theOBJE.className= '';

    }

}

function swapportimg0(imgName){

    var theOBJB = (document.getElementById) ? document.getElementById('btnprev') : eval("document.all['btnprev']");
    var theOBJC = (document.getElementById) ? document.getElementById('btnnext') : eval("document.all['btnnext']");
    var theOBJD = (document.getElementById) ? document.getElementById('lnknext') : eval("document.all['lnknext']");
    var theOBJE = (document.getElementById) ? document.getElementById('lnkprev') : eval("document.all['lnkprev']");


  var theOBJ = (document.getElementById) ? document.getElementById('mainpic') : eval("document.all['mainpic']");
  theOBJ.src= imgName;

    if (curitem<=1&&maxitem>1) {
      theOBJB.src= 'images/folio_no_prev.gif';
      theOBJE.className= 'nopointer';

    }
    
    if (curitem<=maxitem&&maxitem>1) {
      theOBJC.src= 'images/folio_next.gif';
      theOBJD.className= '';

   
    }

}

mainpreload();