﻿function changeColorOn(divName, imgName)
{
document.getElementById(divName).style.backgroundColor='#E88A1C';
document.getElementById(divName).style.color='#E88A1C';
imageOn(imgName);
}
function changeColorOff(divName, imgName)
{
document.getElementById(divName).style.backgroundColor='#AFBCBA';
document.getElementById(divName).style.color='#AFBCBA';
imageOff(imgName);
}

if (document.images)
{

aboutusimageon = new Image(12,54); 
aboutusimageon.src="http://www.vanstin.com/_img/about-us-orange.gif";

contactusimageon = new Image(12,54); 
contactusimageon.src="http://www.vanstin.com/_img/contact-us-orange.gif";

portfolioimageon = new Image(12,54); 
portfolioimageon.src="http://www.vanstin.com/_img/portfolio-orange.gif";

aboutusimageoff = new Image(12,54); 
aboutusimageoff.src="http://www.vanstin.com/_img/about-us.gif";

contactusimageoff = new Image(12,54); 
contactusimageoff.src="http://www.vanstin.com/_img/contact-us.gif";

portfolioimageoff = new Image(12,54); 
portfolioimageoff.src="http://www.vanstin.com/_img/portfolio.gif";

}

function imageOn(imgName)
 {
   if (document.images)
    {
      imgOn=eval(imgName + "on.src");
      document[imgName].src= imgOn;
    }
 }

function imageOff(imgName)
 {
   if (document.images)
    {
      imgOff=eval(imgName + "off.src");
      document[imgName].src= imgOff;
    }
 }

function confirmDeleteFile(fileID,fileName,clientID,clientIndex)
{
var result = confirm("Are you sure you want to delete the file:\n\"" + fileName +"\"?\n\nIt will be permanently removed from the server.");
if (result == true)
{
window.location="http://www.vanstin.com/admin/?delete=" + fileID + "&client=" + clientID + "&filename=" + fileName;
}
else
{
return false;
}
}

function confirmDeleteClientFile(fileID,fileName,clientID,clientIndex)
{
var result = confirm("Are you sure you want to delete the file:\n\"" + fileName +"\"?\n\nIt will be permanently removed from the server.");
if (result == true)
{
window.location="http://www.vanstin.com/admin/?deleteclientfile=" + fileID + "&client=" + clientID + "&filename=" + fileName;
}
else
{
return false;
}
}

function confirmDeleteUser(clientID,clientName)
{
var result = confirm("Are you sure you want to delete user " + clientName + "?\n\nThey will be permanently removed from the server.");
if (result == true)
{
window.location="http://www.vanstin.com/admin/?deleteuser=" + clientID;
}
else
{
return false;
}
}

function toggle( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}
