var agent=navigator.userAgent.toLowerCase();
var noFlash
if ((agent.indexOf('iphone')!=-1) || (agent.indexOf('ipad')!=-1) || (agent.indexOf('Android')!=-1)) noFlash = true;

function toggleShowHide(element, clicker) {
    var selected = document.getElementById(element);
    var toggleDivs = new Array("events", "clients", "news");

    $(".newsList").removeClass("active");

    
    $("#" + clicker).addClass("active");
   
    for (i = 0; i < toggleDivs.length; i++) 
        document.getElementById(toggleDivs[i]).style.display = "none";

    selected.style.display = "block";

}

function showWP(WPID)
{
    $.fn.colorbox({ width: "470px", height: "485px", href: "/forms/RequestWhitePaper.aspx?chkID=" + WPID, opacity: 0.3, close: "Close <img src=\"/images/close-x.gif\" />", iframe: true });
}

function showKml()
{
    $.fn.colorbox({ width: "470px", height: "375px", href: "/forms/RequestKML.aspx", opacity: 0.3, close: "Close <img src=\"/images/close-x.gif\" />", iframe: true });
}

$(document).ready(function() {
    var url = window.location;
    var promoAnchor = url.hash.substring(1).toLowerCase();
    switch(promoAnchor)
    {
    case "videdu":
      $.colorbox({ width: "500px", height: "320px", href: "/flash/education.aspx?hotlink=true", opacity: 0.3, close: "Close <img src=\"/images/close-x.gif\" />", iframe: true });
      var hotlinkTestimonialEducation = true;
      break;
    case "vidhc":
      $.colorbox({ width: "500px", height: "320px", href: "/flash/Healthcare.aspx?hotlink=true", opacity: 0.3, close: "Close <img src=\"/images/close-x.gif\" />", iframe: true });
      var hotlinkTestimonialHealthcare = true;
      break;
    case "wphc":
      $.colorbox({ width: "470px", height: "485px", href: "/forms/RequestWhitePaper.aspx?hotlink=true&chkID=3", opacity: 0.3, close: "Close <img src=\"/images/close-x.gif\" />", iframe: true });
      var hotlinkWhitePaperHealthcare = true;
      break;
    case "wpk12":
      $.colorbox({ width: "470px", height: "485px", href: "/forms/RequestWhitePaper.aspx?hotlink=true&chkID=2", opacity: 0.3, close: "Close <img src=\"/images/close-x.gif\" />", iframe: true });
      var hotlinkWhitePaperK12 = true;
      break;
    case "wpent":
      $.colorbox({ width: "470px", height: "485px", href: "/forms/RequestWhitePaper.aspx?hotlink=true&chkID=1", opacity: 0.3, close: "Close <img src=\"/images/close-x.gif\" />", iframe: true });
      var hotlinkWhitePaperEnterprise = true;
      break;
    }
    
    $(".testimonialHealthcare").colorbox({ width: "500px", height: "320px", href: "/flash/Healthcare.aspx", opacity: 0.3, close: "Close <img src=\"/images/close-x.gif\" />", iframe: true });
    $(".testimonialEducation").colorbox({ width: "500px", height: "320px", href: "/flash/education.aspx", opacity: 0.3, close: "Close <img src=\"/images/close-x.gif\" />", iframe: true });
    
    $(".openContactForm").colorbox({ width: "470px", height: "730px", href: "/forms/RequestInfo.aspx", opacity: 0.3, close: "Close <img src=\"/images/close-x.gif\" />", iframe: true });
    
    $(".openEmailForm").colorbox({ width: "470px", height: "685px", href: "/forms/EmailSunesys.aspx", opacity: 0.3, close: "Close <img src=\"/images/close-x.gif\" />", iframe: true });
    
    $(".openNotifyForm").colorbox({ width: "470px", height: "380px", href: "/forms/GetNotified.aspx", opacity: 0.3, close: "Close <img src=\"/images/close-x.gif\" />", iframe: true });
    
    $(".openKMLForm").colorbox({ width: "470px", height: "380px", href: "/forms/RequestKML.aspx", opacity: 0.3, close: "Close <img src=\"/images/close-x.gif\" />", iframe: true });

    $(".openKML2Form").colorbox({ width: "470px", height: "380px", href: "/forms/RequestKML2.aspx", opacity: 0.3, close: "Close <img src=\"/images/close-x.gif\" />", iframe: true });

    $(".openHolidayCard").colorbox({ width: "565px", height: "475px", href: "/marketing/html/Holiday.htm", opacity: 0.3, close: "Close <img src=\"/images/close-x.gif\" />", iframe: true });

});
