﻿
function doSomething(obj,e) 
{
    if(navigator.appName == "Microsoft Internet Explorer")
    {
        var imagePath = obj.firstChild.title;
    }
    else if(navigator.appName == "Netscape")
    {
        var imagePath = obj.childNodes[1].title;
    }
    else
    {
        var imagePath = obj.firstChild.title;
    }
    
    if(imagePath=="")
    {
        imagePath = "images/noImage.gif";
    }
    if(imagePath==null)
    {
        imagePath = "images/noImage.gif";
    }
    var LargeImage = document.getElementById('dynaLogin_htmlimage');
    LargeImage.src=imagePath;
    /**/
    var myWidth = 0, myHeight = 0;
          if( typeof( window.innerWidth ) == 'number' ) {
            //Non-IE
            myWidth = window.innerWidth + 80;
            myHeight = window.innerHeight;
          } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
            //IE 6+ in 'standards compliant mode'
            myWidth = document.documentElement.clientWidth + 80;
            myHeight = document.documentElement.clientHeight;
          } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
            //IE 4 compatible
            myWidth = document.body.clientWidth + 80;
            myHeight = document.body.clientHeight;
          }
          
    /**/
    var oDiv = document.getElementById('dynaLogin_popUpDiv');
    var objParentDIV = obj.parentNode;
    var left = objParentDIV.offsetLeft;
    var top = objParentDIV.offsetTop;
    left +=125;
    top +=93;
    /**/
    		if(myHeight - top > 250)
	    {
	        top=top;
	    }
	    else
	    {
	        top=top-310;
	    }
	    
	    if(myWidth - left > 250)
	    {
       left=left;
	    }
	    
	    else
	    {
	        left=left-290;
	    }
    /**/
    oDiv.style.left = (left).toString()+"px";   //padding added
    oDiv.style.top = top.toString()+"px";   //obj height added
    openImage();
}
var opValue = 0;
function openImage() 
{
    var popupWin = document.getElementById('dynaLogin_popUpDiv');
    if(opValue < 101)
    {
        popupWin.style.display='block';
        popupWin.style.filter="alpha(opacity="+opValue.toString()+")";
        opValue+=20;
        setTimeout(openImage,100);
    }	
    else
    {
        opValue=0;
    }
}
function closeByDivId()
{    
    var oDiv = document.getElementById('dynaLogin_popUpDiv');
    if(oDiv)
    {
        if(oDiv.style.display=='block' || oDiv.style.display=='inline')
        {
            oDiv.style.display='none';
        }
    }
}
function basketCard()
{
    var popupWin = document.getElementById('basket_items');
    if(popupWin.style.display=="block")
    {
        popupWin.style.height=0;
        popupWin.style.display="none"
    }
    else
    {
        popupWin.style.display="block"
    } 
}