/**/
function cx_trim(str){
		return str.replace(/(^\\s*)|(\\s*$)/g,"");
}
function view_img(obj)
{
	if(!document.getElementById("d_img"))
	{
		document.body.innerHTML+="<div id='d_img' style='cursor:pointer;display:none;position:absolute;border:5px solid silver;' onclick='hide_img();' style='cursor:pointer;' onmouseover='mouse_over(this);' onmouseout='mouse_out(this);'><img src='"+obj.src+"' id='img_detail' /></div>";
	}
	$("#d_img").show("fast",function(){
		centerLayer('d_img');
	});
}
function mouse_over(obj)
{
	obj.style.border = "5px solid silver";
}
function mouse_out(obj)
{
	obj.style.border = "5px solid black";
}
function hide_img()
{
	$("#d_img").remove();
}
function centerLayer(id)
{
	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}

	obj = document.getElementById("img_detail");
	
	$("#"+id).animate({
	left: parseInt((myWidth/2)) - parseInt(obj.width/2)  +"px",
	top: ((myHeight/2)+(document.documentElement.scrollTop) - parseInt(obj.height/2))+"px"
	}, 500 );
}
/*over*/
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
/*pop*/
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
/*from*/
function online_request(id)
{
	if(screen.height >= 1024)
	{
		pop_height = 920
	}
	else
	{
		pop_height = 700
	}
	window.open('http://manager.dataok.jp/online/register.php?compa='+id, 'online_request', 'status=no, scrollbars=yes , width=730, height=700, top=10');
}

function scrolling(objId,sec1,sec2,speed,height)
{ 
  this.objId=objId; 
  this.sec1=sec1; 
  this.sec2=sec2; 
  this.speed=speed; 
  this.height=height; 
  this.h=0; 
  this.div=document.getElementById(this.objId); 
  this.htmltxt=this.div.innerHTML; 
  this.div.innerHTML=this.htmltxt+this.htmltxt; 
  this.div.isover=false; 
  this.div.onmouseover=function(){this.isover=true;} 
  this.div.onmouseout=function(){this.isover=false;} 
  var self=this; 
  this.div.scrollTop=0; 
  window.setTimeout(function(){self.play()},this.sec1); 
} 
scrolling.prototype={ 
  play:function(){ 
    var self=this; 
    if(!this.div.isover){ 
      this.div.scrollTop+=this.speed; 
      if(this.div.scrollTop>this.div.scrollHeight/2){ 
        this.div.scrollTop=0; 
      }else{ 
        this.h+=this.speed; 
        if(this.h>=this.height){ 
          if(this.h>this.height|| this.div.scrollTop%this.height !=0){ 
            this.div.scrollTop-=this.h%this.height; 
          } 
          this.h=0; 
          window.setTimeout(function(){self.play()},this.sec1); 
          return; 
        } 
      } 
    } 
    window.setTimeout(function(){self.play()},this.sec2); 
  }, 
  prev:function(){ 
    if(this.div.scrollTop == 0) 
    this.div.scrollTop = this.div.scrollHeight/2; 
    this.div.scrollTop -= this.height; 
  }, 
  next:function(){ 
    if(this.div.scrollTop ==  this.div.scrollHeight/2) 
    this.div.scrollTop =0; 
    this.div.scrollTop += this.height; 
  } 
}; 