//popups 

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=1,statusbar=0,menubar=1,resizable=1,width=910,height=2000');");
}

function popUp2(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=1,statusbar=0,menubar=1,resizable=1,width=720,height=518');");
}

function popUp3(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=1,statusbar=0,menubar=1,resizable=1,width=720,height=582');");
}

function popUp4(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=1,statusbar=0,menubar=1,resizable=1,width=720,height=602');");
}


//Load Random DIV

function randDiv2(){
var divs=new Array()


divs[0]='<a href=\"realdirector.php\" class=\"rotate\"><img src=\"images/wit.gif\" border=\"0\" alt=\"REALDIRECTOR\" align="middle"/>&nbsp;<span class="orange"><font size="3">RealDirector</font></span><br />RealDirector gives you a powerful way to enhance your contact center through the web, enabling faster and <i>safer</i> real time modifications to call routing, hours of operation, holidays and more.<img src=\"images/arrow.gif\" alt=\"arrow\" width=\"11\" height=\"9\"  border=\"0\" /></a>';

divs[1]='<a href=\"seal.php\" class=\"rotate\"><img src=\"images/seal_rot.gif\" alt=\"SEAL\" border=\"0\" align="middle"/>&nbsp;<span class="orange"><font size="3">SEAL</font></span><br />SEAL (Site Emergency Agent Logoff) enables a resource management desk to remotely disconnect agents in an emergency or who have accidentally remained logged in.<img src=\"images/arrow.gif\" alt=\"arrow\" width=\"11\" height=\"9\"  border=\"0\" /></a>';

var rand_num=Math.floor(Math.random()*divs.length)
document.write(''+divs[rand_num])

}

function loadImgs() {
	
  pic1= new Image(); 
  pic1.src="images/company_on.gif";
  
  pic2= new Image(); 
  pic2.src="images/company.gif";
  
  pic3= new Image(); 
  pic3.src="images/products_on.gif";
  
  pic4= new Image(); 
  pic4.src="images/products.gif";
  
  pic5= new Image(); 
  pic5.src="images/services_on.gif";
  
  pic6= new Image(); 
  pic6.src="images/services.gif";
  
  pic7= new Image(); 
  pic7.src="images/news_on.gif"; 

  pic8= new Image(); 
  pic8.src="images/news.gif";
  
  pic9= new Image(); 
  pic9.src="images/contact_on.gif"; 

  pic10= new Image(); 
  pic10.src="images/contact.gif"; 

}




//Load Random DIV

function randDiv(){
var divs=new Array()

divs[0]='<a href=\"real_dash.php\" class=\"rotate\"><img src=\"images/real_dash.gif\" border=\"0\"  alt=\"Real Dash\" align="middle"/>&nbsp;<span class="orange"><font size="3">RealDash</font></span><br />Aceyus&#39; RealDash is a powerful product that enables users to create, modify and share customized real-time screens displaying contact center statistics – using a simple web-based user interface.<img src=\"images/arrow.gif\" width=\"11\" height=\"9\" border=\"0\ "alt=\"arrow\" /></a>';

divs[1]='<a href=\"cdr_vault.php\" class=\"rotate\"><img src=\"images/cdr_vault.gif\" border=\"0\" alt=\"CDR Vault"  align="middle"/>&nbsp;<span class="orange"><font size="3">CDR Vault</font></span><br />CDR Vault is a custom reporting tool that provides the unique functionality to drill down to a single call\, showing its entire life including the IVR port\, agent extension and call <br>disposition\.<img src=\"images/arrow.gif\" width=\"11\" height=\"9\"  border=\"0\" alt=\"arrow\" /></a>';


var rand_num=Math.floor(Math.random()*divs.length)
document.write(''+divs[rand_num])

}

//load everything before executing simpleSwapSetup script

function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            if (oldonload) {
                oldonload();
            }
            func();
        }
    }
}

addLoadEvent(function() {
   
    SimpleSwapSetup(); return true;
	loadImgs(); return true;

   
})


// swap images

function SimpleSwap(el,which){
   el.src=el.getAttribute(which||"origsrc"); 
}
 

function SimpleSwapSetup(){
  var x = document.getElementsByTagName("img");
  for (var i=0;i<x.length;i++){
    var oversrc = x[i].getAttribute("oversrc");
    if (!oversrc) continue;
    // preload image
    // comment the next two lines to disable image pre-loading
     x[i].oversrc_img = new Image();
     x[i].oversrc_img.src=oversrc;
    // set event handlers
    x[i].onmouseover = new Function("SimpleSwap(this,'oversrc');");
    x[i].onmouseout = new Function("SimpleSwap(this);");
    // save original src
    x[i].setAttribute("origsrc",x[i].src);
  }
}


//Show and hide layers 


function toggleBox(szDivID, iState) // 1 visible, 0 hidden
{
    if(document.layers)	   //NN4+
    {
       document.layers[szDivID].visibility = iState ? "show" : "hide";
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
        obj.style.visibility = iState ? "visible" : "hidden";
    }
    else if(document.all)	// IE 4
    {
        document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
	
    }
}

function toggleBox(szDivID, iState) // 1 visible, 0 hidden
{
   var obj = document.layers ? document.layers[szDivID] :
   document.getElementById ?  document.getElementById(szDivID).style :
   document.all[szDivID].style;
   obj.visibility = document.layers ? (iState ? "show" : "hide") :
   (iState ? "visible" : "hidden");
}
 
// Random Images 

function RandomImageLong(images,iparams)
{
/* si: start index 
** i: current index
** ei: end index
** cc: current count
*/
 si = 0; 
 ci=0;
 cc=0;
 imageSet = new Array();
 ei = images.length;
  for (i=1;i<ei;i++) {
    if (images.charAt(i) == ' ' || images.charAt(i) == ',') {
      imageSet[cc] = images.substring(si,i);
      cc++;
      si=i+1;
      }
    }
  ind = Math.floor(Math.random() *cc);
  
 
   
  document.write("<img "+iparams+" src="+imageSet[ind]+" alt=\"Aceyus Home\" >");

   
}

