me=null;  
mo=0;    

cm2='';

ie_select=true;
d.onselectstart=function(){
	return ie_select;
}
d.oncontextmenu=function(){
	return ie_select;
}

d.onmousedown=function(event){
  if(!event){
	event=window.event;
  }
  if(event.button<2){								                
    var ed=event.srcElement?event.srcElement:event.target;         
    var cm=false;                    
    var em=true;                       

    var cmsite=false;                         
    cm2='';

    while(ed&&ed.getAttribute){                            
      if(ed.getAttribute("nm")!=null&&ed.getAttribute("nm")!=''){    
        em=false;                         
        break;                                    
      }
      if(ed.getAttribute("modsite")!=null){   
       	cmsite=true;
        break;                            
      }
      ed=ed.parentNode;                
    }
             	
    if(cmsite&&em){
      ie_select=false;
	  mo=5;
      me=ed;
      me.X=event.clientX+d.body.scrollLeft;
      me.Y=event.clientY+d.body.scrollTop;
      me.A=parseInt(me.style.left);
      me.B=parseInt(me.style.top);
      
    }
  }
}

d.onmouseup=function(event){
  ie_select=true;
  me=null;
  mo=0;
}

galleryflag=0;

d.onmousemove=function(event){
  if(!event){
	event=window.event;
  }
  if((me)&&(event.button<2)){

    var intLeft=event.clientX+d.body.scrollLeft;
    var intTop=event.clientY+d.body.scrollTop;
      	
    if(mo==5){

      me.style.left=((intLeft-me.X+me.A<=0)?(intLeft-me.X+me.A):0)&&((intLeft-me.X+me.A>=40-parseInt(me.style.width))?(intLeft-me.X+me.A):40-parseInt(me.style.width));
      if ((parseInt(me.style.left)<-800)&&(galleryflag!=1)){
      	 if(galleryflag==0){
      	 	ge('ifr1').innerHTML='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="100%" height="100%" id="mediaidea" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="/-gallery-/mediaidea_2.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /><embed src="/-gallery-/mediaidea_2.swf" quality="high" wmode="transparent" bgcolor="#ffffff" width="100%" height="100%" name="mediaidea" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
      	 }
      	 galleryflag=1;

      	 ge('ifr2').style.display='';
      	 ge('ifr2').style.left='0px';
      }
      if ((parseInt(me.style.left)>-40)&&(galleryflag==1)){
      	 galleryflag=2;

      	 if(ie){
	      	 ge('ifr2').style.display='none';
      	 }else{
	      	 ge('ifr2').style.left=-3000;
      	 }
      }
    }
  }
}
