/*
 *this file is part of Nseer cloud ERP
 *Copyright (C)2000-2010 Nseer Technology Co.,Ltd/http://www.nseer.com
 */
try{
 document.onmousedown=function (e){n_D.initDrag(e);}
 document.onmouseup=function (e){n_D.dragimg(e);}
 document.body.onmousemove=function (e){n_D.mouseStyle(e);}
 function Nseer_DivViewChange(name){
    this.Version = "NSEER ERP V7.0-js1.0";
	this.name=name;
    this.onmousedown = document.onmousedown;
    this.onmousemove = document.onmousemove;
    this.onmouseup = document.onmouseup;
    this.onselectstart = document.onselectstart;
	this.dE=document.getElementById&&!document.all;
	this.mouse_tag=0;
	this.isdrag=false;
	this.oDragObj=null;
	this.nseerZindex=0;
	this.port_X=0;
	this.port_Y=0;
	this.port_X1=0;
	this.port_Y1=0;
	this.left1=0;
	this.top1=0;
	this.tag=0;
	this.min_tag=0;
	this.max_tag=0;
	this.data=new Array();
	this.v=0;
	this.db_max_return=0;
	this.def=0;
	this.nseerDef=0;
	this.scrollW=document.body.scrollWidth;
	this.changeSize=function(){};

	this.detachEvent=function(){
		document.onselectstart=this.onselectstart;
	}
	this.coverSelect=function(div){
		var n_iframe=document.createElement('iframe');
		n_iframe.src="javascript:false";
		n_iframe.style.cssText="position:absolute;visibility:inherit;top:0px;left:0px;width:100%;height:100%;z-index:-1;filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)'";
		div.appendChild(n_iframe);
	}
	this.initDrag=function (e){
		e=e||window.event;
		this.mouse_tag=1;
		var oDragHandle = this.dE ? e.target : e.srcElement; 
		var topElement = "HTML"; 
		while (oDragHandle.tagName != topElement && oDragHandle.getAttribute("nseerDef") != "dragAble"&&oDragHandle.getAttribute("nseerDef") != "dragonly"&&oDragHandle.getAttribute("nseerDef") != "closeonly"){
			oDragHandle = this.dE ? oDragHandle.parentNode : oDragHandle.parentElement;
		} 
		if(oDragHandle.getAttribute("nseerDef")!=null&&oDragHandle.getAttribute("nseerDef")!='undefined'){
			if(oDragHandle.getAttribute("nseerDef")=="dragAble"){this.nseerDef=1;}
			if(oDragHandle.getAttribute("nseerDef")=="dragonly"){this.nseerDef=2;}
			if(oDragHandle.getAttribute("nseerDef")=="closeonly"){this.nseerDef=3;}
			if(this.nseerDef==1||this.nseerDef==2||this.nseerDef==3){
			this.isdrag = true;
			this.oDragObj = oDragHandle; 
			//*********************************************
			//this.oDragObj.style.zIndex=++this.nseerZindex;
			this.oDragObj.style.overflow='hidden';
			this.port_X1=e.clientX;
			this.port_Y1=e.clientY;
			var x12=parseInt(this.getStyle(this.oDragObj,"left","left"))+parseInt(this.getStyle(this.oDragObj,"width","width"));
			var y12=parseInt(this.getStyle(this.oDragObj,"top","top"))+parseInt(this.getStyle(this.oDragObj,"height","height"));
			this.left1=parseInt(this.getStyle(this.oDragObj,"left","left"));
			this.top1=parseInt(this.getStyle(this.oDragObj,"top","top"));
			this.loadDiv(this.oDragObj,0,e);
			//*****************************
			if(this.tag==0){
				document.onselectstart=this.onselectstart;
			}else{
				document.onselectstart = function() { return false;};
				if (oDragHandle.setCapture) {
					oDragHandle.setCapture();
				} else {
					e.preventDefault();
				}
			}
			eval('document.onmousemove=function (e){'+this.name+'.moveMouse(e);}');
			return false;
			}
		}
	}
	this.loadDiv=function (obj,t,e){
		e=e||window.event;
		var nseer_r=obj;
		var w = obj.offsetWidth;
		var h = obj.offsetHeight;
		var x = obj.offsetLeft;
		var y = obj.offsetTop;
		while(obj=obj.offsetParent){
			x += obj.offsetLeft;
			y += obj.offsetTop;
		}
		
		if(this.nseerDef==1){
		if(parseInt(e.clientX)>parseInt(x)&&parseInt(e.clientX)<parseInt(x)+10&&parseInt(e.clientY)<parseInt(y)+h-15&&parseInt(e.clientY)>parseInt(y)+15){
			if(t!=0){
				//nseer_r.style.cursor='e-resize';
			}else{
				//this.tag=8;
			}
		}else if(parseInt(e.clientX)<parseInt(x)+15&&parseInt(e.clientY)<parseInt(y)+15){
			if(t!=0){ 
				//nseer_r.style.cursor='nw-resize';
			}else{
				//this.tag=7;
			}
		}else if(parseInt(e.clientX)<parseInt(x)+w&&parseInt(e.clientX)>parseInt(x)+w-10&&parseInt(e.clientY)<parseInt(y)+h-15&&parseInt(e.clientY)>parseInt(y)+15){
			if(t!=0){
				//nseer_r.style.cursor='e-resize';
			}else{
				//this.tag=1;
			}
		}else if(parseInt(e.clientX)>parseInt(x)+w-5&&parseInt(e.clientY)<parseInt(y)+5){
			if(t!=0){
				//nseer_r.style.cursor='ne-resize';
			}else{
				//this.tag=5;
			}
		}else if(parseInt(e.clientY)<parseInt(y)+5&&parseInt(e.clientX)<parseInt(x)+w-15&&parseInt(e.clientX)>parseInt(x)+15){
			if(t!=0){
				//nseer_r.style.cursor='s-resize';
			}else{
				//this.tag=6;
			}
		}else if(parseInt(e.clientX)<parseInt(x)+15&&parseInt(e.clientY)>parseInt(y)+h-15){
			if(t!=0){
				//nseer_r.style.cursor='ne-resize';
			}else{
				//this.tag=9;
			}
		}else if(parseInt(e.clientY)<parseInt(y)+h+5&&parseInt(e.clientY)>parseInt(y)+h-5&&parseInt(e.clientX)<parseInt(x)+w-15&&parseInt(e.clientX)>parseInt(x)+15){
			if(t!=0){
				//nseer_r.style.cursor='s-resize';
			}else{
				//this.tag=2;
			}
		}else if(parseInt(e.clientX)>parseInt(x)+w-15&&parseInt(e.clientY)>parseInt(y)+h-15){
			if(t!=0){
				//nseer_r.style.cursor='nw-resize';
			}else{
				//this.tag=3;
			}
		}else if(parseInt(e.clientY)>parseInt(y)+10&&parseInt(e.clientY)<parseInt(y)+33&&parseInt(e.clientX)<parseInt(x)+parseInt(w)-70&&parseInt(e.clientX)>parseInt(x)){
			if(t!=0&&parseInt(y)!=0){
				nseer_r.style.cursor='move';
			}else{
				this.tag=4;
			}
		}else{
			if(t!=0){
				nseer_r.style.cursor='default';
			}else{
				this.tag=0;
			}
		}
		}else if(this.nseerDef==2){
			if(parseInt(e.clientY)>parseInt(y)+10&&parseInt(e.clientY)<parseInt(y)+33&&parseInt(e.clientX)<parseInt(x)+parseInt(w)-70&&parseInt(e.clientX)>parseInt(x)){
			if(t!=0){
				nseer_r.style.cursor='move';
			}else{
				this.tag=4;
			}
		}else{
			if(t!=0){
				nseer_r.style.cursor='default';
			}else{
				this.tag=0;
			}
		}
		}
	}
	this.moveMouse=function (e){
		if(this.isdrag==true&&this.max_tag==0){
			e=e||window.event;
			var x12=parseInt(this.getStyle(this.oDragObj,"left","left"))+parseInt(this.getStyle(this.oDragObj,"width","width"));
			var y12=parseInt(this.getStyle(this.oDragObj,"top","top"))+parseInt(this.getStyle(this.oDragObj,"height","height"));
			if(this.tag==0){
				this.port_X=e.clientX;
				this.port_Y=e.clientY;
				document.body.scrollTop=0;
				document.body.scrollLeft=0;
				this.left1=parseInt(this.getStyle(this.oDragObj,"left","left"));
				this.top1=parseInt(this.getStyle(this.oDragObj,"top","top"));
			}else  if(this.tag==1){
				this.port_X=e.clientX;
				this.port_Y=e.clientY;
				document.body.scrollTop=0;
				document.body.scrollLeft=0;
				if(this.port_X>0&&this.port_X>parseInt(this.left1)) this.oDragObj.style.width=this.port_X-parseInt(this.left1)+2;
			}else if(this.tag==8){
				this.port_X=e.clientX;
				this.port_Y=e.clientY;
				document.body.scrollTop=0;
				document.body.scrollLeft=0;
				if(this.port_X>0&&this.port_X<x12){
					this.oDragObj.style.left=this.port_X-2;
					this.oDragObj.style.width=x12-this.port_X+2;
				}
			}else if(this.tag==2){
				this.port_X=e.clientX;
				this.port_Y=e.clientY;
				document.body.scrollTop=0;
				document.body.scrollLeft=0;
				if(this.port_Y>0&&this.port_Y>parseInt(this.top1)) this.oDragObj.style.height=this.port_Y-parseInt(this.top1);
			}else if(this.tag==6){
				this.port_X=e.clientX;
				this.port_Y=e.clientY;
				document.body.scrollTop=0;
				document.body.scrollLeft=0;
				if(this.port_Y>0&&this.port_Y<y12){
					this.oDragObj.style.top=this.port_Y-2;
					this.oDragObj.style.height=y12-this.port_Y+2;
				}
			}else if(this.tag==3){
				this.port_X=e.clientX;
				this.port_Y=e.clientY;
				document.body.scrollTop=0;
				document.body.scrollLeft=0;
				if(this.port_X>0&&this.port_Y>0&&this.port_X>parseInt(this.left1)&&this.port_Y>parseInt(this.top1)){
					this.oDragObj.style.width=this.port_X-parseInt(this.left1);
					this.oDragObj.style.height=this.port_Y-parseInt(this.top1);
				}
			}else if(this.tag==5){
				this.port_X=e.clientX;
				this.port_Y=e.clientY;
				document.body.scrollTop=0;
				document.body.scrollLeft=0;
				if(this.port_X>0&&this.port_Y>0&&this.port_X>parseInt(this.left1)&&this.port_Y<y12){
					this.oDragObj.style.top=this.port_Y-2;
					this.oDragObj.style.width=this.port_X-parseInt(this.left1)+2;
					this.oDragObj.style.height=y12-this.port_Y+2;
				}
			}else if(this.tag==7){
				this.port_X=e.clientX;
				this.port_Y=e.clientY;
				document.body.scrollTop=0;
				document.body.scrollLeft=0;
				if(this.port_X>0&&this.port_Y>0&&this.port_X<x12&&this.port_Y<y12){
					this.oDragObj.style.top=this.port_Y-2;
					this.oDragObj.style.left=this.port_X-2;
					this.oDragObj.style.width=x12-this.port_X+2;
					this.oDragObj.style.height=y12-this.port_Y+2;
				}
			}else if(this.tag==9){
				this.port_X=e.clientX;
				this.port_Y=e.clientY;
				document.body.scrollTop=0;
				document.body.scrollLeft=0;
				if(this.port_X>0&&this.port_Y>0&&this.port_Y>parseInt(this.top1)&&this.port_X<x12){
					this.oDragObj.style.left=this.port_X-2;
					this.oDragObj.style.width=x12-this.port_X+2;
					this.oDragObj.style.height=this.port_Y-this.top1+2;
				}
			}else if(this.tag==4){
				this.port_X=e.clientX;
				this.port_Y=e.clientY;
				document.body.scrollTop=0;
				document.body.scrollLeft=0;
				this.oDragObj.style.left=(this.left1+this.port_X-this.port_X1)<0?"0px":this.left1+this.port_X-this.port_X1+"px";
				this.oDragObj.style.top=(this.top1+this.port_Y-this.port_Y1)<0?"0px":this.top1+this.port_Y-this.port_Y1+'px';
				if(parseInt(this.oDragObj.style.left)+parseInt(this.getStyle(this.oDragObj,"width","width"))>document.body.clientWidth){
					this.oDragObj.style.left=document.body.clientWidth-parseInt(this.getStyle(this.oDragObj,"width","width"));
				}
				if((document.body.clientHeight-parseInt(this.getStyle(this.oDragObj,"height","height")))<parseInt(this.getStyle(this.oDragObj,"top","top"))){
					this.oDragObj.style.top=document.body.clientHeight-parseInt(this.getStyle(this.oDragObj,"height","height"));
				}
			}
			return false;
		}
	} 
	this.getStyle=function (elem,IE,FF){   // fzw
		return navigator.appName=="Microsoft Internet Explorer"?elem.currentStyle[IE]:document.defaultView.getComputedStyle(elem, "").getPropertyValue(FF);
	}
	this.dragimg=function (e){
		this.mouse_tag=0;
		if(this.oDragObj!=null){
			//this.oDragObj.style.zIndex=++this.nseerZindex;
			if (this.oDragObj.releaseCapture) {
				this.oDragObj.releaseCapture();
			}
			if(this.tag!=0&&this.tag!=4){
				this.changeSize();
			}
		}
		this.isdrag=false;
		this.detachEvent();
	}
	this.mouseStyle=function (e){
		e=e||window.event;
		if(this.mouse_tag==0){
			var x12;
			var y12;
			var port_X;
			var port_Y;
			var oDragHandle1 = this.dE?e.target : event.srcElement;
			var topElement = "HTML";
			while (oDragHandle1.tagName != topElement && oDragHandle1.getAttribute("nseerDef") != "dragAble"&&oDragHandle1.getAttribute("nseerDef") != "dragonly") {
				oDragHandle1 = this.dE?oDragHandle1.parentNode:oDragHandle1.parentElement;
			}
			if(oDragHandle1.getAttribute("nseerDef")!=null&&oDragHandle1.getAttribute("nseerDef")!='undefined'){
			if(oDragHandle1.getAttribute("nseerDef")=="dragAble"){this.nseerDef=1;}
			if(oDragHandle1.getAttribute("nseerDef")=="dragonly"){this.nseerDef=2;}
			if(this.nseerDef==1||this.nseerDef==2){
				//eval('oDragHandle1.ondblclick=function(e){'+this.name+'.doubleClickDiv(e);}');
				x12=parseInt(this.getStyle(oDragHandle1,"left","left"))+parseInt(this.getStyle(oDragHandle1,"width","width"));
				y12=parseInt(this.getStyle(oDragHandle1,"top","top"))+parseInt(this.getStyle(oDragHandle1,"height","height"));
				port_X=e.clientX;
				port_Y=e.clientY;
				this.top1=parseInt(this.getStyle(oDragHandle1,"top","top"));
				this.left1=parseInt(this.getStyle(oDragHandle1,"left","left"));
			}
			}
			this.loadDiv(oDragHandle1,1,e);
		}
		if(document.body.scrollWidth>document.body.clientWidth){
		var run=document.getElementById("run");
		if(run){
		run.style.position='absolute'
		run.style.top=(document.body.clientHeight-25)+'px';
		run.style.left=0;
		}
		var run_button=document.getElementById("run_button");
		if(run_button){
		run_button.style.position='absolute';
		run_button.style.top=(document.body.clientHeight-25)+'px';
		run_button.style.left=3;
		}
		var run_bar=document.getElementById("run_bar");
		if(run_bar){
		run_bar.style.position='absolute'
		run_bar.style.top=(document.body.clientHeight-25)+'px';
		run_bar.style.left=0;
		run_bar.style.height=26;
		}
		}else{
		var run=document.getElementById("run");
		if(run){
		run.style.position='absolute'
		run.style.top=(document.body.clientHeight-25)+'px';
		run.style.left=0;
		}
		var run_button=document.getElementById("run_button");
		if(run_button){
		run_button.style.position='absolute';
		run_button.style.top=(document.body.clientHeight-25)+'px';
		run_button.style.left=3;
		}
		var run_bar=document.getElementById("run_bar");
		if(run_bar){
		run_bar.style.position='absolute'
		run_bar.style.top=(document.body.clientHeight-25)+'px';
		run_bar.style.left=0;
		run_bar.style.height=26;
		}
		}
	}
	this.mmcMouseStyle=function(obj){
		obj.style.cursor='pointer';
	}
	this.maxDiv=function (){
		if(this.nseerDef==2){return false;}
		this.max_tag=1;
		if(this.min_tag==0){
			var t=this.getStyle(this.oDragObj,"top","top");
			var l=this.getStyle(this.oDragObj,"left","left");
			var w=this.getStyle(this.oDragObj,"width","width");
			var h=this.getStyle(this.oDragObj,"height","height");
			var string_data=t+'#'+l+'#'+w+'#'+h;
			this.def=this.v;
			this.data[this.v]=string_data;
			this.v++;
		}
		this.oDragObj.style.top='0px';
		this.oDragObj.style.left='0px';
		this.oDragObj.style.width=document.body.clientWidth;
		this.oDragObj.style.height=document.body.clientHeight;
		//********************************************************
		var oDragObj_childNodes=this.oDragObj.getElementsByTagName('div');
		for(var i=0;i<oDragObj_childNodes.length;i++){
			if(oDragObj_childNodes[i].id=='expand'){
				oDragObj_childNodes[i].style.backgroundImage='url(http://src.nseer.com/images/pdiva/two/return.gif)';
				eval('oDragObj_childNodes[i].onclick=function(){'+this.name+'.returnDiv()}');
			}
			if(oDragObj_childNodes[i].id=='collapse'){
				oDragObj_childNodes[i].style.backgroundImage='url(http://src.nseer.com/images/pdiva/two/collapse.gif)';
				eval('oDragObj_childNodes[i].onclick=function(){'+this.name+'.minDiv();}');
			}
		}
		this.changeSize();
	}
	this.maxDivIndex=function (){
		if(this.nseerDef==2){return false;}
		this.max_tag=1;
		if(this.min_tag==0){
			var t=this.getStyle(this.oDragObj,"top","top");
			var l=this.getStyle(this.oDragObj,"left","left");
			var w=this.getStyle(this.oDragObj,"width","width");
			var h=this.getStyle(this.oDragObj,"height","height");
			var string_data=t+'#'+l+'#'+w+'#'+h;
			this.def=this.v;
			this.data[this.v]=string_data;
			this.v++;
		}
		this.oDragObj.style.top='0px';
		this.oDragObj.style.left='0px';
		cur_max_id=this.oDragObj.id;
		this.oDragObj.style.width=document.body.clientWidth;
		this.oDragObj.style.height=document.body.clientHeight-25;
		setMaxZ('max_div'+(this.oDragObj.id).substring(10));
		//********************************************************
		document.getElementById('work_div_txt'+(this.oDragObj.id).substring(10)).className='work_div_txt_max';
		document.getElementById('work_div_txt'+(this.oDragObj.id).substring(10)).innerHTML=document.getElementById('work_div_in'+(this.oDragObj.id).substring(10)).value;
		var oDragObj_childNodes=this.oDragObj.getElementsByTagName('div');
		for(var i=0;i<oDragObj_childNodes.length;i++){
			if(oDragObj_childNodes[i].id=='expand'){
				oDragObj_childNodes[i].innerHTML='<img src="http://src.nseer.com/images/pdiva/two/return.gif">';
				eval('oDragObj_childNodes[i].onclick=function(){'+this.name+'.returnDivIndex()}');
			}
			if(oDragObj_childNodes[i].id=='collapse'){
				oDragObj_childNodes[i].innerHTML='<img src="http://src.nseer.com/images/pdiva/two/collapse.gif">';
				eval('oDragObj_childNodes[i].onclick=function(){'+this.name+'.minDivIndex();}');
			}
		}
		this.changeSize();	
	}
	this.returnDiv=function (){
		this.min_tag=0;
		this.max_tag=0;
		var s=this.def;
		cur_max_id='';
		var da=this.data[s].split('#');
		this.oDragObj.style.top=da[0];
		this.oDragObj.style.left=da[1];
		this.oDragObj.style.width=da[2];
		this.oDragObj.style.height=da[3];
		var oDragObj_childNodes=this.oDragObj.getElementsByTagName('div');
		for(var i=0;i<oDragObj_childNodes.length;i++){
			if(oDragObj_childNodes[i].id=='expand'){
				oDragObj_childNodes[i].style.backgroundImage='url(http://src.nseer.com/images/pdiva/two/expand.gif)';
				eval('oDragObj_childNodes[i].onclick=function(){'+this.name+'.maxDiv();}');
			}
			if(oDragObj_childNodes[i].id=='collapse'){
				oDragObj_childNodes[i].innerHTML='<img src="http://src.nseer.com/images/pdiva/two/collapse.gif">';
				eval('oDragObj_childNodes[i].onclick=function(){'+this.name+'.minDivIndex();}');
			}
		}
		this.changeSize();
	}
	this.returnDivIndex=function (){
		this.min_tag=0;
		this.max_tag=0;
		var s=this.def;
		cur_max_id='';
		var da=this.data[s].split('#');
		this.oDragObj.style.top='50px';
		this.oDragObj.style.left=(Math.floor(Math.random()*100)+50)+'px';
		this.oDragObj.style.width=(document.body.clientWidth*0.9)+'px';
		this.oDragObj.style.height=(document.body.clientHeight*0.9)+'px';
		setMaxZ('max_div'+(this.oDragObj.id).substring(10));
		document.getElementById('work_div_txt'+(this.oDragObj.id).substring(10)).className='work_div_txt_max';
		document.getElementById('work_div_txt'+(this.oDragObj.id).substring(10)).innerHTML=document.getElementById('work_div_in'+(this.oDragObj.id).substring(10)).value;
		var oDragObj_childNodes=this.oDragObj.getElementsByTagName('div');
		for(var i=0;i<oDragObj_childNodes.length;i++){
			if(oDragObj_childNodes[i].id=='expand'){
				oDragObj_childNodes[i].innerHTML='<img src="http://src.nseer.com/images/pdiva/two/expand.gif">';
				eval('oDragObj_childNodes[i].onclick=function(){'+this.name+'.maxDivIndex();}');
			}
			if(oDragObj_childNodes[i].id=='collapse'){
				oDragObj_childNodes[i].innerHTML='<img src="http://src.nseer.com/images/pdiva/two/collapse.gif">';
				eval('oDragObj_childNodes[i].onclick=function(){'+this.name+'.minDivIndex();}');
			}
		}
		this.changeSize();
	}
	
	
	this.returnDiv1=function (){
		this.min_tag=0;
		this.max_tag=0;
		var s=this.def;
		var da=this.data[s].split('#');
		this.oDragObj.style.top=da[0];
		this.oDragObj.style.left=da[1];
		this.oDragObj.style.width=da[2];
		this.oDragObj.style.height=da[3];
		var oDragObj_childNodes=this.oDragObj.getElementsByTagName('div');
		for(var i=0;i<oDragObj_childNodes.length;i++){
			if(oDragObj_childNodes[i].id=='collapse'){
				oDragObj_childNodes[i].style.backgroundImage='url(http://src.nseer.com/images/pdiva/two/collapse.gif)';
				eval('oDragObj_childNodes[i].onclick=function(){'+this.name+'.minDiv();}');
			}
		}
		this.changeSize();
	}
	this.returnDivIndex1=function (){
		this.min_tag=0;
		this.max_tag=0;
		var s=this.def;
		cur_max_id='';
		var da=this.data[s].split('#');
		this.oDragObj.style.top=(Math.floor(Math.random()*100)+50)+'px';
		this.oDragObj.style.left='50px';
		this.oDragObj.style.width=(document.body.clientWidth*0.9)+'px';
		this.oDragObj.style.height=(document.body.clientHeight*0.9)+'px';
		setMaxZ('max_div'+(this.oDragObj.id).substring(10));
		document.getElementById('work_div_txt'+(this.oDragObj.id).substring(10)).className='work_div_txt_max';
		document.getElementById('work_div_txt'+(this.oDragObj.id).substring(10)).innerHTML=document.getElementById('work_div_in'+(this.oDragObj.id).substring(10)).value;
		var oDragObj_childNodes=this.oDragObj.getElementsByTagName('div');
		for(var i=0;i<oDragObj_childNodes.length;i++){
			if(oDragObj_childNodes[i].id=='collapse'){
				oDragObj_childNodes[i].innerHTML='<img src="http://src.nseer.com/images/pdiva/two/collapse.gif">';
				eval('oDragObj_childNodes[i].onclick=function(){'+this.name+'.minDivIndex();}');
			}
		}
		this.changeSize();
	}
	this.returnDivIndexIM=function (){
		this.min_tag=0;
		this.max_tag=0;
		var s=this.def;
		//alert(this.data);
		var lft=200*Math.random();
		this.oDragObj.style.top='150px';
		this.oDragObj.style.left=lft+'px';
		this.oDragObj.style.width='600px';
		this.oDragObj.style.height='438px';
		var oDragObj_childNodes=this.oDragObj.getElementsByTagName('div');
		for(var i=0;i<oDragObj_childNodes.length;i++){
			if(oDragObj_childNodes[i].id=='collapse'){
				oDragObj_childNodes[i].innerHTML='<img src="http://src.nseer.com/images/pdiva/two/collapse.gif">';
				eval('oDragObj_childNodes[i].onclick=function(){'+this.name+'.minDivIndexIM();}');
			}
		}
		this.changeSize();
	}
	
	this.returnDivIndexIM2=function (objwin){
		this.min_tag=0;
		this.max_tag=0;
		var s=this.def;
		var da=new Array();
		da[0]='150px';
		da[1]='150px';
		if(this.data[s]){
		da=this.data[s].split('#');
		}
		this.oDragObj = objwin;
		this.oDragObj.style.top=da[0];
		this.oDragObj.style.left=da[1];
		this.oDragObj.style.width='600px';
		this.oDragObj.style.height='438px';
		var oDragObj_childNodes=this.oDragObj.getElementsByTagName('div');
		for(var i=0;i<oDragObj_childNodes.length;i++){
			if(oDragObj_childNodes[i].id=='collapse'){
				oDragObj_childNodes[i].innerHTML='<img src="http://src.nseer.com/images/pdiva/two/collapse.gif">';
				eval('oDragObj_childNodes[i].onclick=function(){'+this.name+'.minDivIndexIM();}');
			}
		}
		this.changeSize();
	}
	
	this.minDiv=function (s){
		this.min_tag=1;
		var ss=s||40;
		if(this.max_tag==0){
			var t=this.getStyle(this.oDragObj,"top","top");
			var l=this.getStyle(this.oDragObj,"left","left");
			var w=this.getStyle(this.oDragObj,"width","width");
			var h=this.getStyle(this.oDragObj,"height","height");
			var string_data=t+'#'+l+'#'+w+'#'+h;
			this.def=this.v;
			this.data[this.v]=string_data;
			this.v++;
		}
		this.oDragObj.style.height=ss+'px';
		this.oDragObj.style.overflow='hidden';
		this.oDragObj.style.width=ss*10+'px';
		var oDragObj_childNodes=this.oDragObj.getElementsByTagName('div');
		for(var i=0;i<oDragObj_childNodes.length;i++){
			if(oDragObj_childNodes[i].id=='collapse'){
				oDragObj_childNodes[i].style.backgroundImage='url(http://src.nseer.com/images/pdiva/two/return.gif)';
				eval('oDragObj_childNodes[i].onclick=function(){'+this.name+'.returnDiv1();}');
			}
			if(oDragObj_childNodes[i].id=='expand'){
				oDragObj_childNodes[i].style.backgroundImage='url(http://src.nseer.com/images/pdiva/two/expand.gif)';
				eval('oDragObj_childNodes[i].onclick=function(){'+this.name+'.maxDiv();}');
			}
		}
		this.changeSize();
	}
	this.minDivIndex=function (s){
		this.min_tag=1;
		var ss=s||40;
		cur_max_id='';
		if(this.max_tag==0){
			var t=this.getStyle(this.oDragObj,"top","top");
			var l=this.getStyle(this.oDragObj,"left","left");
			var w=this.getStyle(this.oDragObj,"width","width");
			var h=this.getStyle(this.oDragObj,"height","height");
			var string_data=t+'#'+l+'#'+w+'#'+h;
			this.def=this.v;
			this.data[this.v]=string_data;
			this.v++;
		}else{
		this.max_tag=0;
		}
		document.getElementById('work_div_txt'+(this.oDragObj.id).substring(10)).className='work_div_txt_min';
		var len = (document.getElementById('work_div_in'+(this.oDragObj.id).substring(10)).value).length;
		if(len>6){
		 document.getElementById('work_div_txt'+(this.oDragObj.id).substring(10)).innerHTML=(document.getElementById('work_div_in'+(this.oDragObj.id).substring(10)).value).substring(0,6)+"...";
		}
		this.oDragObj.style.top=(Math.floor(Math.random()*(document.body.clientHeight-200))+100)+'px';
		this.oDragObj.style.left=(document.body.clientWidth-250)+'px';
		this.oDragObj.style.height='25px';
		this.oDragObj.style.overflow='hidden';
		this.oDragObj.style.width='180px';
		var oDragObj_childNodes=this.oDragObj.getElementsByTagName('div');
		for(var i=0;i<oDragObj_childNodes.length;i++){
			if(oDragObj_childNodes[i].id=='collapse'){
				oDragObj_childNodes[i].innerHTML='<img src="http://src.nseer.com/images/pdiva/two/return.gif">';
				eval('oDragObj_childNodes[i].onclick=function(){'+this.name+'.returnDivIndex1();}');
			}
			if(oDragObj_childNodes[i].id=='expand'){
				oDragObj_childNodes[i].innerHTML='<img src="http://src.nseer.com/images/pdiva/two/expand.gif">';
				eval('oDragObj_childNodes[i].onclick=function(){'+this.name+'.maxDivIndex();}');
			}
		}
		this.changeSize();
	}
	this.minDivIndexIM=function (s){
		this.min_tag=1;
		var ss=s||40;
		if(this.max_tag==0){
			var t=this.getStyle(this.oDragObj,"top","top");
			var l=this.getStyle(this.oDragObj,"left","left");
			var w=this.getStyle(this.oDragObj,"width","width");
			var h=this.getStyle(this.oDragObj,"height","height");
			var string_data=t+'#'+l+'#'+w+'#'+h;
			this.def=this.v;
			this.data[this.v]=string_data;
			this.v++;
		}
		this.oDragObj.style.height='25px';
		this.oDragObj.style.overflow='hidden';
		this.oDragObj.style.width='180px';
		var oDragObj_childNodes=this.oDragObj.getElementsByTagName('div');
		for(var i=0;i<oDragObj_childNodes.length;i++){
			if(oDragObj_childNodes[i].id=='collapse'){
				oDragObj_childNodes[i].innerHTML='<img src="http://src.nseer.com/images/pdiva/two/return.gif">';
				eval('oDragObj_childNodes[i].onclick=function(){'+this.name+'.returnDivIndexIM();}');
			}
		}
		this.changeSize();
	}
	
	this.closeDiv=function (closeType){
	    unloadCover(this.oDragObj.id);
	    this.nseerDef=0;
		if(closeType=='remove'){
			try{
			document.body.removeChild(document.getElementById(this.oDragObj.id));
			//if (window.ActiveXObject){document.body.removeChild(document.getElementById(this.oDragObj.id));}else{this.oDragObj.oparentNode.removeChild(document.getElementById(this.oDragObj.id));}
			}catch(e){}
		}
		else if(closeType=='hidden'){this.oDragObj.style.display='none';}
		else if(closeType=='reconfirm'){}
	}
	
 this.closeDivIM=function (closeType,msgWins){
	    unloadCover(this.oDragObj.id);
	    this.nseerDef=0;
		if(closeType=='remove'){
			try{		
			document.getElementById(this.oDragObj.id).parentNode.removeChild(document.getElementById(this.oDragObj.id));
			msgWins.removeItem(document.getElementById(this.oDragObj.id));
			}catch(e){}
		}
		else if(closeType=='hidden'){this.oDragObj.style.display='none';}
		else if(closeType=='reconfirm'){}
	}
	this.closeDivIndex=function (closeType,obj_id){
	    this.nseerDef=0;
		cur_max_id='';
		if(closeType=='remove'){
			try{
				document.getElementById('nseer_work'+obj_id.substring(9)).parentNode.removeChild(document.getElementById('nseer_work'+obj_id.substring(9)));
			}catch(e){}
		}
	}
	this.doubleClickDiv=function (e){
		/**e=e||window.event;
		var t=parseInt(this.getStyle(this.oDragObj,"top","top"));
		var l=parseInt(this.getStyle(this.oDragObj,"left","left"));
		var w=parseInt(this.getStyle(this.oDragObj,"width","width"));
		var h=parseInt(this.getStyle(this.oDragObj,"height","height"));
		var port_X1=e.clientX;
		var port_Y1=e.clientY;
		var x12=l+w;**/
		//if(port_Y1>(t+5)&&port_Y1<(t+25)&&port_X1>(l+5)&&port_X1<(x12-5)){
			if(this.db_max_return==0){
				this.maxDivIndex();
				this.db_max_return=1;
			}else if(this.db_max_return==1){
				this.returnDivIndex();
				this.db_max_return=0;
			}
		//}
		//this.changeSize();
	}
	
 }
 var n_D=new Nseer_DivViewChange('n_D');
 //var _d=_t.length-5;
 }catch(e){}
