/////////////////////////////////////////////////////////////////////////////////////
////// To expand and collapse the web part //////////////////////////////////////////
function fnShowHideContent(oEl,bCollapsed)
{
var oPart = fnGetPart( oEl );
var oTopBar = oPart.rows[0];
var oContent = oPart.rows[1];
var idName = oEl.parentElement.parentElement.parentElement.tagName;
var oTab1 = oPart.cells[0];
var oTab2 = oPart.cells[1];
var oTab3 = oPart.cells[2];
var oSwapImg = oTab1.children[0];
if ( bCollapsed )
{
// -- if the table row is already collapsed, expand it & swap the images --
oContent.style.display = "inline";
//oEl.src = "images/chevronUp.gif";
oTab1.style.backgroundColor="#6699cc";
oTab1.style.borderBottom='1px solid #6699cc';
oTab2.style.backgroundColor="#6699cc";
oTab2.style.borderTop='1px solid #6699cc';
oTab2.style.borderBottom='1px solid #6699cc';
oTab2.parentElement.cells[1].children[0].style.backgroundColor= "#6699cc";
oTab2.parentElement.cells[1].children[0].style.color = "#ffffff"
oTab3.style.backgroundColor="#6699cc";
oTab3.style.borderBottom='1px solid #6699cc';
oTab3.className = "clsPartRight";
oSwapImg.src = "images/gripBlue.gif";
//----- writing back the state info to the array -------
var id = oEl.parentElement.parentElement.parentElement.parentElement.id;
oPart.state = "open";
}
else
{
// expand the table row & swapping the images
oContent.style.display = "none";
//oEl.src = "images/chevronDown.gif";
///////////////////////////////////////////////////////////////////////////////////
//////// function to cancel the dragstart event ///////////////////////////////////
function fnCancel()
{
if( event.srcElement.className == "clsPartHead" )
{
window.event.returnValue = false;
}
}
//////////////////////////////////////////////////////////////////////////////////////
//////// To save the order and state of web parts ////////////////////////////////////
function fnSaveState()
{
var oUserData = window.document.all["oLayout"];
var sUserData = "";
var sState = "";
////////////////////////////////////////////////////////////////////////////////////////
///////// function to check the state and release the element ////////////////
///////// if a mouse button is not depressed ////////////////
function fnCheckState()
{
if( event.button != 1 ) fnRelease();
}
///////////////////////////////////////////////////////////////////////////////
///////// function to return false ////////////////////////////////////////////
function fnSelect()
{
return false;
}
//////////////////////////////////////////////////////////////////////////////////////
////// on mouse up, detach the events and reposition the webparts ////////////////////
////////////////////////////////////////////////////////////////////////////////////////
/////// function to reorder the webparts after dragging ////////////////////////////////
function fnSetPosition( oEl )
{
var oPrevEl = fnGetPrevEl( oEl );
if( null != oPrevEl )
{
oPrevEl.insertAdjacentElement( "afterEnd" , element.current );
}
else
{
element.rows(0).cells(0).insertAdjacentElement( "afterBegin" , element.current );
}
element.parts = fnGetPartArray();
fnSaveState();
}
function fnGetPrevEl( oEl )
{
var oReturn = null;
for( var i = 0; i < element.parts.length; i++ )
{
if( element.parts[i].offsetTop < oEl.offsetTop ) oReturn = element.parts[i];
}
return oReturn;
}
//////////////////////////////////////////////////////////////////////////////
//////// function to strip out non-alpha numeric chars from input string /////
//////////////////////////////////////////////////////////////////////////////
//////// This is a innerloop for function fnCheckWebPartIDs //////////////////
//////////////////////////////////////////////////////////////////////////////
////// function to get user data content /////////////////////////////////////
function fnGetUserDataList()
{
var oUserData = window.document.all("oLayout");
var oReturn = null;
try
{
oUserData.load(sContentID);
}
catch(e)
{
oUserData = null;
}
//////////////////////////////////////////////////////////////////////////////
////// Initializing the top and height values for the parts //////////////////
function fnInit()
{
var oStateArray = fnGetUserDataList();
element.parts = fnGetPartArray();
var oDragWindow = window.document.createElement( "SPAN" );
oDragWindow.className = "clsDragWindow";
element.dragwindow = oDragWindow;
element.rows(0).cells(0).insertAdjacentElement( "beforeEnd" , oDragWindow );
fnReOrder( oStateArray );
function fnGetPartById( sId )
{
return element.all( sId );
}
function fnGetPartArray()
{
var oParts = element.all.tags( "TABLE" );
var oReturn = new Array();
for( var i = 0; i < oParts.length; i++ )
{
if( oParts[i].className == "clsPart" )
{
oReturn[oReturn.length] = oParts[i];
}
}
return oReturn;
}
function fnGetMinMaxImg( oPart )
{
var oImgs = oPart.all.tags( "img" );
for( var i = 0; i < oImgs.length; i++ )
{
if( oImgs[i].className == "clsMinimize" ) return oImgs[i];
}
}
/////////////////////////////////////////////////////////////////////////////////////
/////// On mouse down grab the element and capture its ondrag event /////////////////
function fnGrab()
{
var oEl = event.srcElement;
var bCollapsed
////////////////////////////////////////////////////////////////////////////////
///////// function to set the top style for the object /////////////////////////
function fnMove()
{
if (event.button != 1)
{
fnRelease();
return;
}