// JavaScript Document
var btfolder="local/nv/";
function Bt(p_alink,p_img,p_caller){
	var thisobj=this;
	thisobj.alink=p_alink;
	thisobj.caller=p_caller;
	thisobj.img;
	if(p_img!=null){
		thisobj.nsrc=rtPh()+btfolder+p_img+".png";
		thisobj.osrc=rtPh()+btfolder+p_img+"o.png";
		thisobj.dsrc=rtPh()+btfolder+p_img+"d.png";
		thisobj.asrc=rtPh()+btfolder+p_img+"a.png";
		thisobj.aosrc=rtPh()+btfolder+p_img+"ao.png";
		thisobj.img=new Image();
		if((isIE())&&(!isIEM())){
			thisobj.img.src=rtPh()+"scripts/ie/tmp.png";
			thisobj.img.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+thisobj.nsrc+"',sizingMethod='scale')";
		}else{			
			thisobj.img.src=thisobj.nsrc;
		}
		if(enPos()){
			thisobj.img.style.position=thisobj.alink.style.position;
			thisobj.img.style.left=thisobj.alink.style.left;
			thisobj.img.style.top=thisobj.alink.style.top;
		}
		thisobj.img.style.width=thisobj.alink.style.width;
		thisobj.img.style.height=thisobj.alink.style.height;
		thisobj.alink.parentNode.insertBefore(thisobj.img,thisobj.alink);
		thisobj.alink.style.backgroundColor="transparent";
	}
	thisobj.ident=0;
	thisobj.sident=0;
	if(thisobj.alink.id!=""){
		var count=-1;
		for(var i=thisobj.alink.id.length;i>0;i--){
			if(thisobj.alink.id.substr(i,1)=="_"){
				if(count==-1){
					try{
						thisobj.sident=Number(thisobj.alink.id.substring(i+1));
						count=i;
						if(thisobj.sident>0){
							thisobj.alink.style.display="none";
							thisobj.img.style.display="none";
						}
					}catch(e){
					}
				}else{
					try{
						thisobj.ident=Number(thisobj.alink.id.substring(i+1,count));
						break;
					}catch(e){
					}
				}
			}
		}
	}
	//event handling
	thisobj.alink.onmouseover=function(){
		thisobj.mover();	
	};
	thisobj.alink.onfocus=function(){
		thisobj.mover();
	};
	thisobj.alink.onmouseout=function(){
		thisobj.mout();	
	};
	thisobj.alink.onblur=function(){
		thisobj.mout();	
	};
	thisobj.alink.onkeydown=function(p_event){
		if(!p_event){
			p_event=window.event;	
		}
		if(p_event.which){
			if(p_event.which==13){
				thisobj.mdown();
			}
		}else if(p_event.keyCode){
			if(p_event.keyCode==13){
				thisobj.mdown();
			}
		}
	};
	thisobj.alink.onkeyup=function(p_event){
		if(!p_event){
			p_event=window.event;	
		}
		if(p_event.which){
			if(p_event.which==13){
				thisobj.mup();
			}
		}else if(p_event.keyCode){
			if(p_event.keyCode==13){
				thisobj.mup();
			}
		}
	};
	thisobj.alink.onmousedown=function(){
		thisobj.mdown();	
	};
	thisobj.alink.onmouseup=function(){
		thisobj.mup();	
	};
	thisobj.alink.onclick=function(){
		thisobj.mclick();	
	};
	thisobj.mover=function(){
		if(thisobj.img!=null){
			if(getFName(thisobj.img.src)==getFName(thisobj.asrc)){
				if((isIE())&&(!isIEM())){
					thisobj.img.src=rtPh()+"scripts/ie/tmp.png";
					thisobj.img.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+thisobj.aosrc+"',sizingMethod='scale')";
				}else{			
					thisobj.img.src=thisobj.aosrc;	
				}				
			}else{
				if((isIE())&&(!isIEM())){
					thisobj.img.src=rtPh()+"scripts/ie/tmp.png";
					thisobj.img.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+thisobj.osrc+"',sizingMethod='scale')";
				}else{			
					thisobj.img.src=thisobj.osrc;	
				}
			}
		}
		if(thisobj.caller!=null){
			thisobj.caller.btmover(thisobj);	
		}
	};
	thisobj.mout=function(){
		if(thisobj.img!=null){
			if(getFName(thisobj.img.src)==getFName(thisobj.aosrc)){
				if((isIE())&&(!isIEM())){
					thisobj.img.src=rtPh()+"scripts/ie/tmp.png";
					thisobj.img.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+thisobj.asrc+"',sizingMethod='scale')";
				}else{			
					thisobj.img.src=thisobj.asrc;	
				}
			}else if(getFName(thisobj.img.src)==getFName(thisobj.asrc)){
				if((isIE())&&(!isIEM())){
					thisobj.img.src=rtPh()+"scripts/ie/tmp.png";
					thisobj.img.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+thisobj.asrc+"',sizingMethod='scale')";
				}else{			
					thisobj.img.src=thisobj.asrc;	
				}
			}else{
				if((isIE())&&(!isIEM())){
					thisobj.img.src=rtPh()+"scripts/ie/tmp.png";
					thisobj.img.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+thisobj.nsrc+"',sizingMethod='scale')";
				}else{			
					thisobj.img.src=thisobj.nsrc;	
				}
			}
		}
		if(thisobj.caller!=null){
			thisobj.caller.btmout(thisobj);	
		}
	};
	thisobj.mdown=function(){
		if(thisobj.img!=null){
			if((isIE())&&(!isIEM())){
				thisobj.img.src=rtPh()+"scripts/ie/tmp.png";
				thisobj.img.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+thisobj.dsrc+"',sizingMethod='scale')";
			}else{			
				thisobj.img.src=thisobj.dsrc;	
			}
		}
		if(thisobj.caller!=null){
			thisobj.caller.btmdown(thisobj);	
		}
	};
	thisobj.mup=function(){
		if(thisobj.img!=null){
			if((isIE())&&(!isIEM())){
				thisobj.img.src=rtPh()+"scripts/ie/tmp.png";
				thisobj.img.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+thisobj.asrc+"',sizingMethod='scale')";
			}else{			
				thisobj.img.src=thisobj.asrc;	
			}
		}
		if(thisobj.caller!=null){
			thisobj.caller.btmup(thisobj);	
		}
	};
	thisobj.mclick=function(){
		if(thisobj.caller!=null){
			thisobj.caller.btmclick(thisobj);	
		}
	};
	thisobj.setVisible=function(p_visible){
		if(p_visible==true){
			thisobj.alink.style.display="inline";
			if(thisobj.img!=null){
				thisobj.img.style.display="inline";
			}
		}else{
			thisobj.alink.style.display="none";
			if(thisobj.img!=null){
				thisobj.img.style.display="none";
			}
		}
	};
}