function addBehaviors() { 
    // Check that the browser is DOM compliant 
    if (window.document.getElementById && window.document.createElement && window.document.appendChild) 
    { 
        // Find all links     
        var link; 
        var links = document.getElementsByTagName('a'); 
        for (var i = 0; i < links.length; i++) 
        { 
            link = links[i]; 
            // Find all links with a class name of "non-html" 
        //    alert(link.hostname + " " + document.location.hostname)
          // if (link.hostname!=document.location.hostname && link.hostname!=""  && link.href.indexOf("javascript")==-1)
          //  {
            //     link.onclick = openInNewWindow; 
        //     }     
        } 
       var imgs = document.getElementsByTagName('div'); 
       var img;
       for (var i = 0; i < imgs.length; i++) { 
            img = imgs[i]; 
            // Find all links with a class name of "non-html" 
            if (img.className.indexOf("portFolioImageLeft")>-1)
            {
                    addImageMoveOverLeft(img);
            }  
            if (img.className.indexOf("portFolioImageRight")>-1)
            {
                    addImageMoveOverRight(img);
            }      
        } 
        objWarningText = null; 
    }
 
} 
function openInNewWindow() 
{ 
    // Change "_blank" to something like "newWindow" to load all links in the same new window 
    var newWindow = window.open(this.getAttribute('href'), '_blank'); 
    newWindow.focus(this.getAttribute('href')); 
    return false; 
} 
function addImageMoveOverLeft(oElement)
{
    oElement.attachEvent("onmouseenter",goLargeLeft);
    oElement.attachEvent("onmouseout",goSmallLeft);
    oElement.attachEvent("onmouseleave",goSmallLeft);
    }
   function goLargeLeft()
    {
    if (navigator.appName.indexOf("Microsoft")>-1 && navigator.appVersion.indexOf('MSIE 7')>-1)
    {}
    else
    {
        
         //GetImage(this,0).style.left="325px";*/
         this.event.srcElement.style.left="325px";
        GetImage(this.event.srcElement,0).style.width="400px";
       }
    }
     function goSmallLeft()
    {
    if (navigator.appName.indexOf("Microsoft")>-1 && navigator.appVersion.indexOf('MSIE 7')>-1)
    {}
    else
    {
       // this.style.width="200px";
        GetImage(this.event.srcElement,0).style.width="200px";
        this.event.srcElement.style.left="525px";
       }
    }
   
function addImageMoveOverRight(oElement)
{
    oElement.attachEvent("onmouseenter",goLargeRight);
    oElement.attachEvent("onmouseout",goSmallRight);
    oElement.attachEvent("onmouseleave",goSmallRight);
    }
   function goLargeRight()
    {
    if (navigator.appName.indexOf("Microsoft")>-1 && navigator.appVersion.indexOf('MSIE 7')>-1)
    {}
    else
    {
  
    
        oImage=GetImage(this.event.srcElement,0);
        //this.element.style.left="325px";
        oImage.style.width="400px";
        this.event.srcElement.style.left="325px";
        this.event.srcElement.style.top="8.5em";
        this.event.srcElement.style.zIndex=10000;
        oImage.style.zIndex=10000;
       }
    }
     function goSmallRight()
    {
    if (navigator.appName.indexOf("Microsoft")>-1 && navigator.appVersion.indexOf('MSIE 7')>-1)
    {}
    else
    {
        //this.style.width="200px";
        //this.element.style.left="525px";
        this.event.srcElement.style.left="525px";
        GetImage(this.event.srcElement,0).style.width="200px";
        this.event.srcElement.style.top="19.0em";
        this.event.srcElement.style.zIndex=10;
        oImage.style.zIndex=10;
       }
    }
    function GetImage(oHtml, level)
    {
        if (level>2)
        {
            return false;
        }
        else
        {
            if (oHtml.tagName.toLowerCase()=="img")
            {
            return oHtml;
            }
            else
            {
            for (i=0;i<oHtml.childNodes.length;i++)
            {
                oChild=oHtml.childNodes[i];
                if (oChild.childNodes.length>0)
                {
                    return GetImage(oChild,level+1);
                }
                else
                {
                    if(oChild.nodeName=="IMG" || oChild.nodeName=="img" )
                    {
                        return oChild;
                    }
                }
          
            }
            }
        }
    }
window.onload =addBehaviors;

