if(!document.attachEvent)
{
    document.attachEvent = function(){document.addEventListener(arguments[0].substr(2),arguments[1],arguments[2])}
}


document.attachEvent("onmouseover",function(e)
{
	var theWidth, theHeight;		
	var theScrollLeft, theScrollTop;

	if (window.innerWidth) 
	{ 
		theWidth = window.innerWidth ;
		theHeight = window.innerHeight ;
		theScrollLeft = window.scrollLeft;
		theScrollTop = window.scrollTop;
	} 
	else if (document.documentElement && document.documentElement.clientWidth) 
	{ 
		theWidth = document.documentElement.clientWidth ;
		theHeight = document.documentElement.clientHeight ;
		theScrollLeft = document.documentElement.scrollLeft ;
		theScrollTop = document.documentElement.scrollTop ;
	} 
	else if (document.body) 
	{ 
		theWidth = document.body.clientWidth ;
		theHeight = document.body.clientHeight ;
		theScrollLeft = document.body.scrollLeft ;
		theScrollTop = document.body.scrollTop ;
	}

    var tip = "";


    if(typeof(event)=="undefined"){//ff
        tip = e.target.getAttribute("tips")
        //alert(tip)
    }else{//ie
        //alert(111);
        e    = window.event;
        
        tip = e.srcElement.tips;
    }

    
//    if(typeof(tip)!="undefined"&&tip.length>0)
//    {
//        var _tips = document.getElementById("myTip");
//        
//        if(typeof(_tips)=="undefined"||_tips == null)
//        {
//            _tips        = document.createElement("div");
//            _tips.id    = "myTip";
//            _tips.style.position        = "absolute";
//            _tips.style.width            = "201px";
//            _tips.style.height            = "220px";
//            _tips.style.fontSize        = "9pt";
//            _tips.style.backgroundColor    = "#ffffff";
//            _tips.style.color            = "#000";
//			
//            
//            _tips.style.filter            = "progid:DXImageTransform.Microsoft.Shadow(color=#999999,direction=135,strength=3)";
//            
//            _tips.style.filter+="Alpha(opacity=80)";
//            
//             _tips.style.background="url(images/1/tips_back.gif)  no-repeat ";
//            _tips.style.padding            = "5px 8px 3px 8px";
//            document.body.appendChild(_tips);            
//            _tips.style.display            = "none";
//        }
//
//            _tips.style.display    = "";
//            
//            _tips.innerHTML        = tip;
//            _tips.style.left = theScrollLeft + e.clientX+10; 
//            _tips.style.top = theScrollTop + e.clientY+10; 
//    }
}
);

document.attachEvent('onmouseout',function(e)
{   
    var _tips = document.getElementById("myTip");
    if(_tips!=null)
    {
        document.body.removeChild(_tips);
    }
}
)



function createTip(e,i)
{
    var theWidth, theHeight;		
	var theScrollLeft, theScrollTop;

//	if (window.innerWidth) 
//	{ 
//            alert(111)
//		theWidth = window.innerWidth ;
//		theHeight = window.innerHeight ;
//		theScrollLeft = window.scrollLeft;
//		theScrollTop = window.scrollTop;
//	} 
//	else 
            if (document.documentElement && document.documentElement.clientWidth) 
	{ 
		theWidth = document.documentElement.clientWidth ;
		theHeight = document.documentElement.clientHeight ;
		theScrollLeft = document.documentElement.scrollLeft ;
		theScrollTop = document.documentElement.scrollTop ;
	} 
	else if (document.body) 
	{ 
		theWidth = document.body.clientWidth ;
		theHeight = document.body.clientHeight ;
		theScrollLeft = document.body.scrollLeft ;
		theScrollTop = document.body.scrollTop ;
	}

    var tip = "";

    var x,y;
    if(typeof(event)=="undefined"){//ff
        tip = e.target.getAttribute("tips")
        
        
    }else{//ie
        e    = window.event;
        tip = e.srcElement.tips;
    }
    x = theScrollLeft +e.clientX+10
    y = theScrollTop +e.clientY+10
    
    if(theHeight-e.clientY<220)
    {
        y = y-(theHeight-e.clientY)
    }
        
    
    if(typeof(tip)!="undefined"&&tip.length>0)
    {
        _tips        = document.createElement("div");
        _tips.id    = "myTip";
        
        document.body.appendChild(_tips); 
        
        _tips.style.left =  x+'px'; 
        _tips.style.top =  y+'px'; 
        _tips.style.position        = "absolute";
        _tips.style.width            = "201px";
        _tips.style.height            = "220px";
        _tips.style.fontSize        = "9pt";
        _tips.style.backgroundColor    = "#ffffff";
        _tips.style.color            = "#000";
        _tips.zIndex = 1000;
        
 
        _tips.innerHTML        = tip;

        _tips.style.filter            = "progid:DXImageTransform.Microsoft.Shadow(color=#999999,direction=135,strength=3)";

        _tips.style.filter+="Alpha(opacity=80)";


        _tips.style.padding            = "5px 8px 3px 8px";
                  
        
        
        
    }
    
}
