/// Section Begin  - CCSSP DHTM (JavaScript 1.2)
// eHelp® Corporation Dynamic HTML JavaScript 
// Copyright© 1998-2003 eHelp® Corporation.All rights reserved.
// Version=4.82

// Warning:Do not modify this file.It is generated by RoboHELP® and changes will be overwritten.



//Begin JavaScript libary for cross-platform positioning object.
function CCSSP(){} // constructor of CCSSP class

CCSSP.GetObject = function( obj )
{//convert object name string or reference into a valid object reference
	if( typeof(obj) == "object" )
		return obj;
	else if( typeof(obj) == "string" && obj != "")
	{
		if( gbBsNS4 )
			return eval("document." + obj);
		else
			return eval("document.all(\"" + obj + "\")");
	}
	else
		return null;
}

CCSSP.MoveObjectTo = function(obj, x, y)
{//positioning an object at a specific pixel coordinate
	if( gbBsNS4 )
		obj.moveTo(x,y);
	else
	{
		obj.style.pixelLeft = x;
		obj.style.pixelTop = y;
	}
}

CCSSP.MoveObjectBy = function(obj, dx, dy)
{//moveing a object by x and/or y pixel
	if( gbBsNS4 )
		obj.moveBy(dx,dy);
	else
	{
		obj.style.pixelLeft += dx;
		obj.style.pixelTop += dy;
	}
}

CCSSP.SetObjectBGColor = function(obj, color)
{//set the background color of an object
	if( gbBsNS4 )
		obj.bgColor = color;
	else
		obj.style.backgroundColor = color;
}

CCSSP.ShowObject = function(obj, bShow)
{// set the object to be visible or invisible
	if( gbBsNS4 )
		obj.visibility = (bShow == true) ? 'show' : 'hide';
	else
		obj.style.visibility = (bShow == true) ? 'visible' : 'hidden';// when hidden, it still occupy some space.
}

CCSSP.GetObjectLeft = function(obj)
{// retrieve the x coordinate of a posionable object
	if( gbBsNS4 )
		return obj.left;
	else
		return obj.style.pixelLeft;
}

CCSSP.GetObjectTop = function(obj)
{// retrieve the y coordinate of a posionable object
	if( gbBsNS4 )
		return obj.top;
	else
		return obj.style.pixelTop;
}

CCSSP.GetObjectContainLeft = function(obj)
{// retrieve the x coordinate of a posionable object relative to it's parent element
	if( gbBsNS4 )
		return obj.pageX;
	else
	{
		if( obj == document.body )
			return obj.clientLeft;
		else
			return obj.offsetLeft;
	}
}

CCSSP.GetObjectWindowLeft = function(obj)
{// retrieve the x coordinate of a posionable object relative to browser window
	if( gbBsNS4 )
		return obj.pageX;
	else
	{
		var nOffsetWindowLeft = 0;
		for(var element = obj; element; element = element.offsetParent)
			nOffsetWindowLeft += CCSSP.GetObjectContainLeft(element);
		return nOffsetWindowLeft;
	}
}

CCSSP.GetObjectContainTop = function(obj)
{// retrieve the y coordinate of a posionable object relative to it's parent element
	if( gbBsNS4 )
		return obj.pageY;
	else
	{
		if( obj == document.body )
			return obj.clientTop;
		else
			return obj.offsetTop;
	}
}

CCSSP.GetObjectWindowTop = function(obj)
{// retrieve the y coordinate of a posionable object relative to browser window
	if( gbBsNS4 )
		return obj.pageY;
	else
	{
		var nOffsetWindowTop = 0;
		for(var element = obj; element; element = element.offsetParent)
			nOffsetWindowTop += CCSSP.GetObjectContainTop(element);
		return nOffsetWindowTop;
	}
}

CCSSP.GetObjectHeight = function(obj)
{// retrieve the height of a posionable object
	if( gbBsNS4 )
		return obj.clip.height;
	else
		return obj.offsetHeight;
}

CCSSP.GetObjectWidth = function(obj)
{// retrieve the width of a posionable object
	if( gbBsNS4 )
		return obj.clip.width;
	else
		return obj.offsetWidth;
}

CCSSP.RegisterEventHandler = function( srcObj, rawEventName, funcHandler )
{ // to add the "funcHandler" as the "rawEventName" 's handler to the "srcObj" object,the original event handler will be combined
	if (gbBsNS4 && !gbBsNS6)
		return ;
		
	var oldHandler = "";

	if (gbBsMac &&gbBsIE4&&!gbBsIE5)
	{
		if (typeof(srcObj[rawEventName.toLowerCase()])=="unknown")
		{ //search for <SCRIPT> tag which define the event handler
			for( var i = 0; i < document.scripts.length; i++ ) 
			{
				var script = document.scripts[i];
				if( (script.htmlFor == srcObj.id || script.htmlFor == srcObj ) && script.event == rawEventName )
				{
					oldHandler = script.innerHTML;
					break;
				}
			}
		}
	}
	else
	{
		var oldInlineHandler = srcObj[rawEventName.toLowerCase()];
		if( oldInlineHandler != null && typeof(oldInlineHandler) != "undefined")
		{
			var functionDefinition = oldInlineHandler.toString();
			var bodyStart = functionDefinition.indexOf( "{" );
			var bodyEnd = functionDefinition.lastIndexOf( "}" );
			if( bodyStart > 0 || bodyEnd > bodyStart )
				oldHandler = functionDefinition.substr( bodyStart + 1, bodyEnd - bodyStart - 2 );
		}
		else if( gbBsIE4 )
		{ //search for <SCRIPT> tag which define the event handler
			for( var i = 0; i < document.scripts.length; i++ ) 
			{
				var script = document.scripts[i];
				if( (script.htmlFor == srcObj.id || script.htmlFor == srcObj ) && script.event == rawEventName )
				{
					oldHandler = script.innerHTML;
					break;
				}
			}
		}
	}
	if( oldHandler.indexOf(funcHandler) >= 0 )
		return;// to prevent register the funtion twice.

	if( gbBsNS4 ) // only "onload, onresize, onfocus" apply to window
	{// other raw events will apply to layer
		var noOn = rawEventName.substring(2, rawEventName.length);
		if( typeof(noOn) == "string" && noOn.length > 3 ) {
			if (srcObj.captureEvents)
				srcObj.captureEvents( Event[noOn.toUpperCase()] );
		}
	}
	
	var newHandler = oldHandler;
	if( newHandler.length == 0 )
		newHandler = funcHandler;
	else
		newHandler += "; " + funcHandler;
	
	srcObj[rawEventName.toLowerCase()] = new Function( newHandler );
}

CCSSP.GetWindowHeight = function()
{// retrieve the height of available content in browser window
	if( gbBsNS4 )
		return window.innerHeight;
	else
		return document.body.clientHeight;
}

CCSSP.GetWindowBottom = function()
{// retrieve the bottom postion of browser window
	if( gbBsNS4 )
		return window.outerHeight + window.pageYOffset;
	else
		return document.body.clientHeight + document.body.scrollTop;
}

CCSSP.GetWindowWidth = function()
{// retrieve the width of available content in browser window
	if( gbBsNS4 )
		return window.innerWidth;
	else
		return document.body.clientWidth;
}

CCSSP.GetWindowRight = function()
{// retrieve the right postion of browser window
	if( gbBsNS4 )
		return window.outerWidth + window.pageXOffset;
	else
		return document.body.clientWidth + document.body.scrollLeft;
}

CCSSP.TrimString = function( objString, subtrim )
{// to trim the "subtrim" in the beginning and ending of a string object
	if( typeof(subtrim) != "string" || subtrim == null )
		return objString;
	var strHead = objString.substring(0, 1);
	var strRear = objString.substring(objString.length-1, objString.length);
	if( strHead != subtrim && strRear != subtrim )
		return objString;
	
	var spacePos = objString.indexOf(subtrim);
	if( spacePos < 0 )
		return objString;
	else if( spacePos == objString.length - 1 )
		return objString.substring(0, spacePos);
	else
	{
		var newString = objString.substring( spacePos + 1, objString.length);
		return CCSSP.TrimString( newString, subtrim );
	}
}

CCSSP.TrimSpace = function( objString )
{
	var Trim1 = CCSSP.TrimString( objString, " ");
	return CCSSP.TrimString( Trim1, "\'");
}

CCSSP.GetEventElement = function( navEventObject )
{// to get the element who fired the current event
	if(gbBsNS4) 
		if (gbBsNS6)
			return null;
		else
			 navEventObject.target;
	else
		return event.srcElement;
}

CCSSP.PrepareFilter = function( Obj )
{//to prepare for making the filter work
	Obj.style.filter = "";
	if( Obj.style.width != "" || Obj.style.height != "" || Obj.style.position == "absolute" )
		return;
	Obj.style.height = CCSSP.GetObjectHeight(Obj);
}

CCSSP.IsDescendant = function( progenitor, progeny )
{
	if( typeof(progeny) == "undefined" || progeny == null )
		return false;
	else if( progeny == progenitor )
		return true; 
	else if( progeny.id == progenitor.id ) 
		return true; 
	else if( getParentNode(progeny) == getParentNode(progenitor))
		return false;
	else
		return CCSSP.IsDescendant( progenitor, getParentNode(progeny));
}

CCSSP.IsTextTag = function( Obj )
{
	if( typeof( Obj.tagName ) == "undefined" )
		return false;
	return( Obj.tagName.indexOf("H") == 0 || Obj.tagName == "P" || 
			Obj.tagName == "FONT" || Obj.tagName == "SPAN" );
}

//End JavaScript libary for cross-platform positioning object.

/// Section End  - CCSSP DHTM (JavaScript 1.2)


