var GetElementByTabNameWithClassName = function( obj , TabName , ClassName ){
var tmpE;
var returnE = new Array();
tmpE = obj.getElementsByTagName(TabName);
for(var a=0 , b = tmpE.length ; a < b ; a++){
if( hasClass(tmpE[a] , ClassName) ){ returnE.push(tmpE[a]); }
}
return returnE;
}
var hasClass = function( aElement , aClassName ){
var oRegExp = new RegExp("(^|\\s)" + aClassName + "(\\s|$)");
return (oRegExp.test(aElement.className)?true:false);
}
var ColumnManagerWithClass = function(instanceName){
this.PageType = "os";
this.MaxLooping = 100;
this.CurrentLoopCounter = 0;
this.instanceName = instanceName;
this.ClassName = "ColumnManager"
this.Table = new Array();
this.TDColumns = new Array();
this.TDColumnsShowInPanel = new Array();
this.TDColumnsTitleShowInPanel = new Array();
this.TDColumnsLabel = new Array();
this.TR = new Array();
this.UserPreferenceSetting = new Array();
this.DefaultSetting = new Array();
this.PanelPosition = null;
this.PanelName = "Field Chooser";
this.ColumnManagerOptionPanelControl = null;
this.ColumnManagerOptionPanel = null;
this.LoopLimit = 100;
this.CurrentLoop = 0;
this.HideText = "Hidden";
this.PanelCheckBox = new Array();
this.isNeverShow = true;
this.initalTable = function(){
this.Table = GetElementByTabNameWithClassName( document , "table" , this.ClassName )
}
this.initalTD = function(){
if( this.Table.length == 0 ){ this.initalTable(); }
if( this.Table.length == 0 ){
return false
}else{
var tr = this.Get_FirstLevelTr( this.Table );
for( c=0 , d = tr.length; c < d ; c++ ){
rowCount = 0
for(e=0 , f=tr[c].childNodes.length ; e < f; e++){
//nodeName
if(tr[c].childNodes[e].nodeName.toLowerCase() == "td"){
if( tr[c].childNodes[e].style.display != "none" ){
if(!this.TDColumns[rowCount]){ this.TDColumns[rowCount] = new Array(); }
this.TDColumns[rowCount].push( tr[c].childNodes[e] );
rowCount ++ ;
}
}
}
}
return true
}
}
this.GetChildWithTagName = function( obj , tag ){
var tmp = obj.childNodes;
var result = new Array();
for( var a = 0 , b = tmp.length ; a < b ; a++ ){
if( tmp[a].nodeName.toLowerCase() == tag.toLowerCase() ){
result.push(tmp[a]);
}
}
return result;
}
this.Get_FirstLevelTr = function( objs ){
var CurrentChilds = new Array();
if( this.CurrentLoopCounter > this.MaxLooping && this.TR.length == 0 ){
return CurrentChilds;
}
this.CurrentLoopCounter ++;
var tr = new Array();
for( a = 0 ; a < objs.length ; a++){
for( b =0 ; b < objs[a].childNodes.length ; b++){
CurrentChilds.push( objs[a].childNodes[b] );
}
}
for( a=0 ; a < CurrentChilds.length ; a++){
if( CurrentChilds[a].nodeName.toLowerCase() == "tr" ) {
tr.push( CurrentChilds[a] );
}
}
if(tr.length > 0){
return tr;
}else if( CurrentChilds.length == 0 ){
return CurrentChilds
}else{
return this.Get_FirstLevelTr( CurrentChilds );
}
}
this.CreateOptionPanelItem = function( node , num , label ){
var nobr = document.createElement('nobr');
var checkbox = document.createElement('input');
checkbox.type = "checkbox";
checkbox.value = num;
checkbox.setAttribute("colmgn" , this.instanceName)
checkbox.onclick = function(){
var ColMgn = eval(this.getAttribute("colmgn"));
if(ColMgn){
ColMgn.triggerColumn( this.value);
}
}
var span = document.createElement('span');
span.innerHTML = label?label:("Column #" + num);
span.style.textDecoration = "none";
span.innerHTML = span.innerHTML + " "
nobr.appendChild(checkbox);
nobr.appendChild(span);
node.appendChild(nobr);
node.appendChild(document.createElement('wbr'));
if( this.UserPreferenceSetting[num] === true || this.UserPreferenceSetting[num] === false ){
checkbox.checked = this.UserPreferenceSetting[num];
}else{
this.UserPreferenceSetting[num] = true;
checkbox.checked = true;
}
this.PanelCheckBox.push(checkbox);
}
this.DisplayControlPanel = function(){
var ColSize = this.TDColumnsTitleShowInPanel? this.TDColumnsTitleShowInPanel.length : this.TDColumns.length;
for(var a = 0 ; a < ColSize ; a++){
this.CreatePanelItem( a )
}
}
this.CreateColumnManagerOptionPanel = function(){
if( this.PanelPosition && this.ColumnManagerOptionPanel === null ){
var div = document.createElement('div');
div.id = "ColumnManagerOptionPanel"
div.setAttribute("ColMgn" , this.instanceName)
div.style.width = "400px"
div.style.border = "1px solid #000000";
div.style.backgroundColor = "#FFFFFF";
div.style.wordwrap = "break-word";
div.style.display = "none";
div.style.textDecoration = "none";
div.className = "dragme"
div.style.position = 'absolute';
this.ColumnManagerOptionPanel = div;
if( this.PanelPosition ){
this.PanelPosition.appendChild(div);
}else{
var parent = this.Table[0].parentNode;
parent.insertBefore( div , this.Table[0] );
}
}
}
this.CreateColumnManagerOptionPanelControl = function(){
if( this.ColumnManagerOptionPanelControl === null ){
var img = document.createElement('img');
img.src = "/member/images/btn_go.gif"
img.width = 9;
img.height = 8;
img.border = 0;
var span = document.createElement('span');
span.innerHTML = "" + this.PanelName + "";
span.id = "ColumnManagerOptionPanelControl"
span.style.cursor = "pointer";
span.setAttribute("colmgn" , this.instanceName)
span.onclick = function(){
var ColMgn = eval(this.getAttribute("colmgn"));
if( ColMgn.ColumnManagerOptionPanel ){
if( ColMgn.ColumnManagerOptionPanel.style.display == "" ){
//this.innerHTML = ColMgn.PanelName;
ColMgn.ColumnManagerOptionPanel.style.display = "none";
}else{
//this.innerHTML = ColMgn.PanelName;
if ( ColMgn.isNeverShow == true ){
var Cox
var Coy
if (document.all) { // grab the x-y pos.s if browser is IE
Cox=event.clientX+document.body.scrollLeft;
Coy=event.clientY+document.body.scrollTop;
} else { // grab the x-y pos.s if browser is NS
Cox=e.pageX
Coy=e.pageY
}
ColMgn.ColumnManagerOptionPanel.style.top = Coy
ColMgn.ColumnManagerOptionPanel.style.left = Cox
ColMgn.isNeverShow = false
}
ColMgn.ColumnManagerOptionPanel.style.display = "";
}
}
}
this.ColumnManagerOptionPanelControl = span;
if( this.PanelPosition ){
this.PanelPosition.appendChild(img);
this.PanelPosition.appendChild(span);
this.PanelPosition.appendChild(document.createElement('br'));
/* this.PanelPosition.style.textDecoration = "none"; */
}else{
if(this.Table[0]){
var parent = this.Table[0].parentNode;
}else{
var parent = document.body
}
parent.insertBefore( img , this.Table[0] );
parent.insertBefore( span , this.Table[0] );
parent.insertBefore( document.createElement('br') , this.Table[0] );
}
}
}
this.DisplayColumnMgnPanel = function(){
if(!this.PanelPosition){ return ;}
removeChildrenFromNode( this.ColumnManagerOptionPanel );
this.PanelCheckBox = new Array();
var cLink = document.createElement('a');
cLink.onclick = function(){
var colmgn = eval(this.getAttribute("colmgn"));
colmgn.ColumnManagerOptionPanel.style.display = 'none';
}
cLink.href = "javascript: void(0);"
cLink.setAttribute("colmgn" , this.instanceName)
cLink.innerHTML = "
"
var TopTitleTable = document.createElement('table');
TopTitleTable.style.cursor = "move";
var TopTitleTBody = document.createElement('tbody');
var TopTitleTR = document.createElement('tr');
var TopTitleTD1 = document.createElement('td');
var TopTitleTD2 = document.createElement('td');
TopTitleTable.width = "100%"
TopTitleTable.style.backgroundColor = "#666666";
TopTitleTable.border = "0"
TopTitleTD1.width="99%"
TopTitleTD2.width="99%"
TopTitleTD1.innerHTML="Field Chooser"
TopTitleTD1.align="left"
TopTitleTD2.align="right"
TopTitleTD2.appendChild(cLink);
TopTitleTR.appendChild(TopTitleTD1);
TopTitleTR.appendChild(TopTitleTD2);
TopTitleTBody.appendChild(TopTitleTR);
TopTitleTable.appendChild(TopTitleTBody);
this.ColumnManagerOptionPanel.appendChild(TopTitleTable);
var HideCount = 0
for(var a=0 ; a < this.TDColumns.length ; a++){
if( this.TDColumnsShowInPanel[a] != false ){
this.CreateOptionPanelItem(this.ColumnManagerOptionPanel , a , this.TDColumnsTitleShowInPanel[a]);
}
if(this.UserPreferenceSetting[a] == false){
this.hideColumn(a);
HideCount ++
}
}
this.ShowPanelDisplayNameWithHiddenColumnNumber(HideCount);
var CloseLink = document.createElement('a');
CloseLink.setAttribute("colmgn" , this.instanceName)
CloseLink.innerHTML = "[Close]"
CloseLink.style.cursor = "pointer";
CloseLink.onclick = function(){
var colmgn = eval(this.getAttribute("colmgn"));
colmgn.ColumnManagerOptionPanel.style.display = 'none';
}
CloseLink.style.paddingRight = "10px";
var ResetLink = document.createElement('a');
ResetLink.setAttribute("colmgn" , this.instanceName);
ResetLink.style.cursor = "pointer";
ResetLink.onclick = function(){
var colmgn = eval(this.getAttribute("colmgn"));
colmgn.ResetToDefault();
}
ResetLink.innerHTML = "[Reset]"
ResetLink.style.paddingRight = "10px";
var ShowAllLink = document.createElement('a');
ShowAllLink.setAttribute("colmgn" , this.instanceName);
ShowAllLink.style.cursor = "pointer";
ShowAllLink.onclick = function(){
var colmgn = eval(this.getAttribute("colmgn"));
colmgn.ShowAllColumn();
}
ShowAllLink.innerHTML = "[Show All]"
ShowAllLink.style.paddingRight = "10px";
var BottomDIV = document.createElement('div');
BottomDIV.align = "right"
BottomDIV.appendChild(ShowAllLink);
BottomDIV.appendChild(ResetLink);
BottomDIV.appendChild(CloseLink);
this.ColumnManagerOptionPanel.appendChild(BottomDIV);
var LeftTop = findPos(this.ColumnManagerOptionPanelControl);
// Set the panel position
if( LeftTop[1] > 0 ){
this.ColumnManagerOptionPanel.style.left = LeftTop[0];
this.ColumnManagerOptionPanel.style.top = LeftTop[1];
}
// Set the panel position
}
this.setUserPreferenceSetting = function(value){
var tmp = value.split(";");
var tmp2;
for(var a = 0 ; a < tmp.length ; a++){
tmp2 = tmp[a].split(":");
for(var b = 0 ; b < this.TDColumnsLabel.length ; b++){
if(this.TDColumnsLabel[b].toLowerCase() == tmp2[0].toLowerCase() && tmp2[1] == "0"){
this.UserPreferenceSetting[b] = false;
}
}
}
if( value == "" ) {
this.ShowPanelDisplayNameWithHiddenColumnNumber(0)
}else{
this.ShowPanelDisplayNameWithHiddenColumnNumber(tmp.length)
}
}
this.ChangeUserPreferenceSetting = function(n , value){
this.UserPreferenceSetting[n] = value;
this.SaveUserPreferenceSetting();
}
this.SaveUserPreferenceSetting = function(){
var tmpStr = ""
for(var a = 0 ; a < this.UserPreferenceSetting.length ; a++){
if(this.UserPreferenceSetting[a] == false){
if(tmpStr == ""){
tmpStr = this.TDColumnsLabel[a] + ":0"
}else{
tmpStr = tmpStr + ";" + this.TDColumnsLabel[a] + ":0"
}
}
}
//var sValue = this.UserPreferenceSetting.join("|");
var tmpValue = tmpStr.split(";")
if( tmpStr == ""){
this.ShowPanelDisplayNameWithHiddenColumnNumber( 0 )
}else{
this.ShowPanelDisplayNameWithHiddenColumnNumber( (tmpValue.length) )
}
UpdateColumnSetting( this.PageType , tmpStr );
}
this.ShowColumn = function(n){
if(this.TDColumns[n]){
for(a = 0 , a_length = this.TDColumns[n].length; a < a_length ; a++){
if(this.TDColumns[n][a]) { this.TDColumns[n][a].style.display = ""; }
}
}
}
this.hideColumn = function(n){
if(this.TDColumns[n]){
for(a = 0 , a_length = this.TDColumns[n].length; a < a_length ; a++){
if(this.TDColumns[n][a]) { this.TDColumns[n][a].style.display = "none"; }
}
}
}
this.ShowPanelDisplayNameWithHiddenColumnNumber = function(n){
var a_NumHiddenField = document.createElement("a");
if( n == 0 ){
a_NumHiddenField.innerHTML = "" + this.PanelName + "";
}else{
a_NumHiddenField.innerHTML = "" + this.PanelName + " [" + this.HideText + ": " + n + "]";
}
this.ColumnManagerOptionPanelControl.innerHTML = "";
this.ColumnManagerOptionPanelControl.appendChild(a_NumHiddenField);
}
this.triggerColumn = function(n){
if(this.TDColumns[n]){
for(a = 0 , a_length = this.TDColumns[n].length; a < a_length ; a++){
if(this.TDColumns[n][a]) {
(this.TDColumns[n][a].style.display == "none")?(this.TDColumns[n][a].style.display = ""):(this.TDColumns[n][a].style.display = "none");
}
}
this.ChangeUserPreferenceSetting(n , ((this.UserPreferenceSetting[n])?false:true) );
}
}
this.ResetToDefault = function(){
var max = this.UserPreferenceSetting.length
var HideCount = 0;
for(var a = 0 ; a < max ; a++){
if( this.DefaultSetting[a] == true || this.DefaultSetting[a] == false ){
this.UserPreferenceSetting[a] = this.DefaultSetting[a] ;
}else{
this.UserPreferenceSetting[a] = true;
}
if(this.UserPreferenceSetting[a] == false){
this.hideColumn(a);
}else{
this.ShowColumn(a);
}
}
for( var b = 0 ; b < this.UserPreferenceSetting.length ; b++){
if(this.UserPreferenceSetting[a] == false){
HideCount ++
}
}
this.ShowPanelDisplayNameWithHiddenColumnNumber(HideCount);
this.DisplayColumnMgnPanel();
this.SaveUserPreferenceSetting();
}
this.ShowAllColumn = function(){
var max = this.UserPreferenceSetting.length
var HideCount = 0;
for(var a = 0 ; a < max ; a++){
this.UserPreferenceSetting[a] = true;
this.ShowColumn(a);
}
for(var b=0 ; b < this.PanelCheckBox.length ; b++){
this.PanelCheckBox[b].checked = true
}
this.ShowPanelDisplayNameWithHiddenColumnNumber(HideCount);
//this.DisplayColumnMgnPanel();
this.SaveUserPreferenceSetting();
}
}
removeChildrenFromNode = function(node){
if(!node){ return; }
var len = node.childNodes.length;
while (node.hasChildNodes()){
node.removeChild(node.firstChild);
}
}
if(!addListener){
var addListener = function (element, type, expression, bubbling){
if(window.addEventListener){ // Standard
element.addEventListener(type, expression, bubbling);
return true;
} else if(window.attachEvent) { // IE
element.attachEvent('on' + type, expression);
return true;
}
}
}
http_request = false;
function makePOSTRequest(url, parameters) {
http_request = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
// set type accordingly to anticipated content type
//http_request.overrideMimeType('text/xml');
http_request.overrideMimeType('text/html');
}
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!http_request) {
alert('Cannot create XMLHTTP instance');
return false;
}
http_request.onreadystatechange = alertContents;
http_request.open('POST', url, true);
http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http_request.setRequestHeader("Content-length", parameters.length);
http_request.setRequestHeader("Connection", "close");
http_request.send(parameters);
}
function alertContents() {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
result = http_request.responseText;
}
}
}
function UpdateColumnSetting(Type , Setting) {
var URL = "Ajax_ColumnSetting.asp"
var postStr = "type="+ encodeURI(Type) +"&v=" + encodeURI(Setting);
makePOSTRequest(URL, postStr);
}
/* Make object to draggable */
function findPosX(obj) {
var curleft = 0;
if(obj.offsetParent) {
while(1) {
curleft += obj.offsetLeft;
if(!obj.offsetParent)
break;
obj = obj.offsetParent;
}
} else if(obj.x) {
curleft += obj.x;
}
obj.style.position = "static";
return curleft;
}
function findPosY(obj) {
var curtop = 0;
if(obj.offsetParent) {
while(1) {
curtop += obj.offsetTop;
if(!obj.offsetParent)
break;
obj = obj.offsetParent;
}
} else if(obj.y) {
curtop += obj.y;
}
return curtop;
}
function findPos(obj) {
var left = findPosX(obj);
var top = findPosY(obj);
return [left , top];
}
var Drag = {
obj : null,
init : function(o, oRoot, minX, maxX, minY, maxY, bSwapHorzRef, bSwapVertRef, fXMapper, fYMapper)
{
o.onmousedown = Drag.start;
o.hmode = bSwapHorzRef ? false : true ;
o.vmode = bSwapVertRef ? false : true ;
o.root = oRoot && oRoot != null ? oRoot : o ;
if (o.hmode && isNaN(parseInt(o.root.style.left ))) o.root.style.left = "0px";
if (o.vmode && isNaN(parseInt(o.root.style.top ))) o.root.style.top = "0px";
if (!o.hmode && isNaN(parseInt(o.root.style.right ))) o.root.style.right = "0px";
if (!o.vmode && isNaN(parseInt(o.root.style.bottom))) o.root.style.bottom = "0px";
o.minX = typeof minX != 'undefined' ? minX : null;
o.minY = typeof minY != 'undefined' ? minY : null;
o.maxX = typeof maxX != 'undefined' ? maxX : null;
o.maxY = typeof maxY != 'undefined' ? maxY : null;
o.xMapper = fXMapper ? fXMapper : null;
o.yMapper = fYMapper ? fYMapper : null;
o.root.onDragStart = new Function();
o.root.onDragEnd = new Function();
o.root.onDrag = new Function();
},
start : function(e)
{
var o = Drag.obj = this;
e = Drag.fixE(e);
var y = parseInt(o.vmode ? o.root.style.top : o.root.style.bottom);
var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right );
o.root.onDragStart(x, y);
o.lastMouseX = e.clientX;
o.lastMouseY = e.clientY;
if (o.hmode) {
if (o.minX != null) o.minMouseX = e.clientX - x + o.minX;
if (o.maxX != null) o.maxMouseX = o.minMouseX + o.maxX - o.minX;
} else {
if (o.minX != null) o.maxMouseX = -o.minX + e.clientX + x;
if (o.maxX != null) o.minMouseX = -o.maxX + e.clientX + x;
}
if (o.vmode) {
if (o.minY != null) o.minMouseY = e.clientY - y + o.minY;
if (o.maxY != null) o.maxMouseY = o.minMouseY + o.maxY - o.minY;
} else {
if (o.minY != null) o.maxMouseY = -o.minY + e.clientY + y;
if (o.maxY != null) o.minMouseY = -o.maxY + e.clientY + y;
}
document.onmousemove = Drag.drag;
document.onmouseup = Drag.end;
return false;
},
drag : function(e)
{
e = Drag.fixE(e);
var o = Drag.obj;
var ey = e.clientY;
var ex = e.clientX;
var y = parseInt(o.vmode ? o.root.style.top : o.root.style.bottom);
var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right );
var nx, ny;
if (o.minX != null) ex = o.hmode ? Math.max(ex, o.minMouseX) : Math.min(ex, o.maxMouseX);
if (o.maxX != null) ex = o.hmode ? Math.min(ex, o.maxMouseX) : Math.max(ex, o.minMouseX);
if (o.minY != null) ey = o.vmode ? Math.max(ey, o.minMouseY) : Math.min(ey, o.maxMouseY);
if (o.maxY != null) ey = o.vmode ? Math.min(ey, o.maxMouseY) : Math.max(ey, o.minMouseY);
nx = x + ((ex - o.lastMouseX) * (o.hmode ? 1 : -1));
ny = y + ((ey - o.lastMouseY) * (o.vmode ? 1 : -1));
if (o.xMapper) nx = o.xMapper(y)
else if (o.yMapper) ny = o.yMapper(x)
Drag.obj.root.style[o.hmode ? "left" : "right"] = nx + "px";
Drag.obj.root.style[o.vmode ? "top" : "bottom"] = ny + "px";
Drag.obj.lastMouseX = ex;
Drag.obj.lastMouseY = ey;
Drag.obj.root.onDrag(nx, ny);
return false;
},
end : function()
{
document.onmousemove = null;
document.onmouseup = null;
Drag.obj.root.onDragEnd( parseInt(Drag.obj.root.style[Drag.obj.hmode ? "left" : "right"]),
parseInt(Drag.obj.root.style[Drag.obj.vmode ? "top" : "bottom"]));
Drag.obj = null;
},
fixE : function(e)
{
if (typeof e == 'undefined') e = window.event;
if (typeof e.layerX == 'undefined') e.layerX = e.offsetX;
if (typeof e.layerY == 'undefined') e.layerY = e.offsetY;
return e;
}
};
/*
var ie=document.all;
var nn6=document.getElementById&&!document.all;
var isdrag=false;
var x,y;
var dobj;
function movemouse(e)
{
if (isdrag)
{
dobj.style.left = nn6 ? tx + e.clientX - x : tx + event.clientX - x;
dobj.style.top = nn6 ? ty + e.clientY - y : ty + event.clientY - y;
return false;
}
}
function selectmouse(e)
{
var fobj = nn6 ? e.target : event.srcElement;
var topelement = nn6 ? "HTML" : "BODY";
while (fobj.tagName != topelement && fobj.className != "dragme")
{
fobj = nn6 ? fobj.parentNode : fobj.parentElement;
}
if (fobj.className=="dragme")
{
isdrag = true;
dobj = fobj;
tx = parseInt(dobj.style.left+0);
ty = parseInt(dobj.style.top+0);
x = nn6 ? e.clientX : event.clientX;
y = nn6 ? e.clientY : event.clientY;
document.onmousemove=movemouse;
return false;
}
}
document.onmousedown=selectmouse;
document.onmouseup=new Function("isdrag=false");
*/
/*
var tmpDraggableObj = null;
function MakeDraggable(obj){
addListener( obj , "mousedown" , DraggableObjectMouseDown)
addListener( window , "mousemove" , DraggableObjectMouseMove)
addListener( window , "mouseup" , DraggableObjectMouseUp)
}
var DraggableObjectMouseMove = function(e){
if(tmpDraggableObj){
mouseMove( tmpDraggableObj , e );
}
}
var DraggableObjectMouseDown = function(e){
this.Draggable = true;
tmpDraggableObj = this;
//mouseOffset = getMouseOffset(this, e);
mouseMove( this , e );
//mouseMove( this , mouseOffset.x , mouseOffset.y );
}
var DraggableObjectMouseUp = function(e){
if( tmpDraggableObj ){
alert(tmpDraggableObj);
tmpDraggableObj = null;
this.Draggable = false;
}
}
function mouseMove(dragObject , ev){
ev = ev || window.event;
var mouseOffset = getMouseOffset(dragObject, ev);
var mousePos = mouseCoords(ev);
if(dragObject && dragObject.Draggable == true){
dragObject.style.position = 'absolute';
dragObject.style.top = mousePos.y - mouseOffset.y;
dragObject.style.left = mousePos.x - mouseOffset.x;
//dragObject.moveBy((mousePos.x - mouseOffset.x),(mousePos.y - mouseOffset.y))
return false;
}
}
var mouseCoords = function(ev){
if(ev.pageX || ev.pageY){
return {x:ev.pageX, y:ev.pageY};
}
return {
x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,
y:ev.clientY + document.body.scrollTop - document.body.clientTop
};
}
var getMouseOffset = function(target, ev){
ev = ev || window.event;
var docPos = getPosition(target);
var mousePos = mouseCoords(ev);
return {x:mousePos.x - docPos.x, y:mousePos.y - docPos.y};
}
var getPosition = function(e){
var left = 0;
var top = 0;
while (e.offsetParent){
left += e.offsetLeft;
top += e.offsetTop;
e = e.offsetParent;
}
left += e.offsetLeft;
top += e.offsetTop;
return {x:left, y:top};
}
*/
/* End */
var ColumnManager_OfferInventResultSetting = function( obj ){
if(obj.initalTD()){
obj.PageType = "o";
obj.ClassName = "ColumnManager";
obj.PanelName = "Show/Hide Column(s)";
obj.PanelPosition = document.getElementById("FieldChooser");
obj.CreateColumnManagerOptionPanelControl();
obj.CreateColumnManagerOptionPanel();
obj.TDColumnsTitleShowInPanel = Array("" , "STRC" , "Part Number" , "Brand" , "D/C" , "Desc" , "Qty" , "Unit Price" , "Remarks" , "Post Date" , "Company" , "Country/Region" , "");
obj.TDColumnsLabel = Array("" , "S1" , "P1" , "B1" , "D1" , "D2" , "Q1" , "U1" , "R1" , "P2" , "C1" , "C2" , "")
//obj.UserPreferenceSetting = Array( true , true , true , true , false , false , false , true , true , true , true , true );
obj.TDColumnsShowInPanel = Array(false , true , false , true , true , true , true , true , true , true , true, true , false );
obj.setUserPreferenceSetting("");
obj.DisplayColumnMgnPanel();
Drag.init(obj.ColumnManagerOptionPanel);
addListener( window , "load" , InitialColManagerPanelPosition )
addListener( window , "unload" , clearColManager )
}
}
var ColumnManager_RequirementResultSetting = function( obj ){
if(obj.initalTD()){
obj.PageType = "r";
obj.ClassName = "ColumnManager";
obj.PanelName = "Show/Hide Column(s)";
obj.PanelPosition = document.getElementById("FieldChooser");
obj.CreateColumnManagerOptionPanelControl();
obj.CreateColumnManagerOptionPanel();
obj.TDColumnsTitleShowInPanel = Array("" , "STRC" , "Part Number" , "Brand" , "D/C" , "Desc" , "Qty" , "Target Price" , "Remarks" , "Post Date" , "Company" , "Country/Region" , "");
obj.TDColumnsLabel = Array("" , "S1" , "P1" , "B1" , "D1" , "D2" , "Q1" , "U1" , "R1" , "P2" , "C1" , "C2" , "")
//obj.UserPreferenceSetting = Array( true , true , true , true , false , false , false , true , true , true , true , true );
obj.TDColumnsShowInPanel = Array(false , true , false , true , true , true , true , true , true , true , true, true , false );
obj.setUserPreferenceSetting("");
obj.DisplayColumnMgnPanel();
Drag.init(obj.ColumnManagerOptionPanel);
addListener( window , "load" , InitialColManagerPanelPosition )
addListener( window , "unload" , clearColManager )
}
}
var ColumnManager_PublicOfferInventResultSetting = function( obj ){
if(obj.initalTD()){
obj.PageType = "p";
obj.ClassName = "ColumnManager";
obj.PanelName = "Show/Hide Column(s)";
obj.PanelPosition = document.getElementById("FieldChooser");
obj.CreateColumnManagerOptionPanelControl();
obj.CreateColumnManagerOptionPanel();
obj.TDColumnsTitleShowInPanel = Array( "STRC" , "Part Number" , "Brand" , "D/C" , "Desc" , "Qty" , "Post Date" , "Country/Region" ,"Company" );
obj.TDColumnsLabel = Array("S1" , "P1" , "B1" , "D1" , "Q1" , "P2" , "C1" , "C2" )
obj.UserPreferenceSetting = Array( true , true , true , true , false , true , true , true , true , true );
obj.DefaultSetting = Array( true , true , true , true , false , true , true , true , true , true );
obj.TDColumnsShowInPanel = Array(true , false , true , true , true , true , true , true , false , false );
obj.setUserPreferenceSetting("");
obj.DisplayColumnMgnPanel();
Drag.init(obj.ColumnManagerOptionPanel);
addListener( window , "load" , InitialColManagerPanelPosition )
addListener( window , "unload" , clearColManager )
}
}
var InitialColManagerPanelPosition = function(){
if( ColManager.isNeverShow == true ){
var LeftTop = findPos(ColManager.ColumnManagerOptionPanelControl);
ColManager.isNeverShow = false;
ColManager.ColumnManagerOptionPanel.style.left = LeftTop[0];
ColManager.ColumnManagerOptionPanel.style.top = LeftTop[1];
}
}
var clearColManager = function(){
ColManager = null;
}