﻿//---------------------------------------------------------------
    function ImageMouseOver(evt, ImgId, PlaceHolderId, Offset, SrcLarge, ToolTip)
	{
        var TopPos =0;
        var LeftPos = 0; 
		var img = document.getElementById(ImgId);
		var PlaceHolder = document.getElementById(PlaceHolderId);
		var iOffset = parseInt(Offset);
		var WinHeigth = GetClientHeight();
		var CalculatedHeigth = 0;
		// Set image attributes
		img.src = SrcLarge;
		img.alt = ToolTip;
		
		if(isIE())
	    {
 		    ev=window.event ||event;
            TopPos  = (((ev.clientY - ev.offsetY) - 3) + document.body.scrollTop);
	        LeftPos = (((ev.clientX -ev.offsetX )+ 75 ) +  document.body.scrollLeft) - iOffset;//(((ev.clientX -ev.offsetX )+ 60 ) +  scrollLleft) - iOffset ;
	    }
	    else
	    {
		    ev =evt;
            var PosArray = GetElementPosition(ev.currentTarget);
            TopPos = PosArray[0];
            LeftPos = PosArray[1] + 75;
        }
    
        CalculatedHeigth = ((WinHeigth + document.body.scrollTop)-TopPos);
        if( CalculatedHeigth < 190)
            TopPos = TopPos - 180;//(190 -CalculatedHeigth)

//        document.all("spnTestMsg").innerHTML= "H: " + WinHeigth + "<br>T: " + TopPos + "<br>L: " + LeftPos + "<br>T-H : " + ((WinHeigth + document.body.scrollTop)-TopPos) + "<br>SH: " + document.body.scrollTop ;
//        document.all("spnTestMsg").style.top = TopPos-100;   

        PlaceHolder.style.top  = TopPos;
        PlaceHolder.style.left = LeftPos;
		PlaceHolder.style.display ="block";
		return false;
	}
//---------------------------------------------------------------
//---------------------------------------------------------------
    function ProductTitleMouseOver(evt, sTextToShow, PlaceHolderId, Offset )
	{
        var TopPos =0;
        var LeftPos = 0; 
		var PlaceHolder = document.getElementById(PlaceHolderId);
		var iOffset = parseInt(Offset);
		var WinHeigth = GetClientHeight();
		var CalculatedHeigth = 0;
		// Set image attributes
		img.src = SrcLarge;
		img.alt = ToolTip;
		
		if(isIE())
	    {
 		    ev=window.event ||event;
            TopPos  = (((ev.clientY - ev.offsetY) - 3) + document.body.scrollTop);
	        LeftPos = (((ev.clientX -ev.offsetX )+ 75 ) +  document.body.scrollLeft) - iOffset;//(((ev.clientX -ev.offsetX )+ 60 ) +  scrollLleft) - iOffset ;
	    }
	    else
	    {
		    ev =evt;
            var PosArray = GetElementPosition(ev.currentTarget);
            TopPos = PosArray[0];
            LeftPos = PosArray[1] + 75;
        }
    
        CalculatedHeigth = ((WinHeigth + document.body.scrollTop)-TopPos);
        if( CalculatedHeigth < 190)
            TopPos = TopPos - 180;//(190 -CalculatedHeigth)

//        document.all("spnTestMsg").innerHTML= "H: " + WinHeigth + "<br>T: " + TopPos + "<br>L: " + LeftPos + "<br>T-H : " + ((WinHeigth + document.body.scrollTop)-TopPos) + "<br>SH: " + document.body.scrollTop ;
//        document.all("spnTestMsg").style.top = TopPos-100;   

        PlaceHolder.style.top  = TopPos;
        PlaceHolder.style.left = LeftPos;
		PlaceHolder.innerHTML = sTextToShow;
		PlaceHolder.style.display ="block";
		return false;
	}
//---------------------------------------------------------------

    function GetClientHeight()
    {
        var theHeight;
        
        if (window.innerHeight) 
        {
            theHeight=window.innerHeight;
        }
        else if (document.documentElement && document.documentElement.clientHeight) 
        {
            theHeight=document.documentElement.clientHeight;
        }
        else if (document.body) 
        {
            theHeight=document.body.clientHeight;
        }
        return theHeight;
    }
//---------------------------------------------------------------
    function GetClientWidth()
    {
    	var theWidth;
        // Window dimensions: 
        if (window.innerWidth) 
        {
            theWidth=window.innerWidth;
        }
        else if (document.documentElement && document.documentElement.clientWidth) 
        {
            theWidth=document.documentElement.clientWidth;
        }
        else if (document.body) 
        {
            theWidth=document.body.clientWidth;
        }
        
        return theWidth;
    }
//---------------------------------------------------------------
	function ImageMouseOut(ImgId, PlaceHolderId)
	{
		//Hide the placeholder
		var PlaceHolder = document.getElementById(PlaceHolderId);
		if (ImgId != "")
		{
		    var img = document.getElementById(ImgId);
		    img.src="";
		}
		
		PlaceHolder.style.display = "none";
		return false;
	}
//---------------------------------------------------------------