/********************************************************************************
	This script is copyrighted by Orange Street Softare
		www.orangestreetsoftware.com
	
	It requires: 
		
********************************************************************************/

// --------------------------------------------------------------------------------------------------------
// escape a string for use in eval or setTimeout
function escape_string ( s_string )
{
	var s_escaped_string;
	s_escaped_string = s_string.replace ( /\\/g, '\\\\' );
	s_escaped_string = s_escaped_string.replace ( /'/g, '\\\'' );
	return s_escaped_string;
}

// --------------------------------------------------------------------------------------------------------
// apply a property to a div or layer
function set_div_property ( s_div_tag, s_property, s_setting )
{
	if ( document.getElementById && ( document.getElementById ( s_div_tag ) != null ) )
		eval ( "document.getElementById ( '" + s_div_tag + "' ).style." + s_property + "='" + s_setting + "'" );
	else if ( document.all )
		eval ( s_div_tag + ".style." + s_property + "='" + s_setting + "'" );
	else
		eval ( "document." + s_div_tag + "." + s_property + "='" + s_setting + "'" );
}

// --------------------------------------------------------------------------------------------------------
// single point of call for all document writes (usefull for debuging etc.)
function doc_write ( s_text )
{
	document.writeln ( s_text );
}

// --------------------------------------------------------------------------------------------------------
// write some text in the status bar
function status_change ( s_text )
{
	window.status = s_text;
}

// --------------------------------------------------------------------------------------------------------
//*************************
// layer utility routines *
//*************************

function changeObjectVisibilityObj(TargetObject, newVisibility) {

      if (typeof(TargetObject) == "undefined")
        return false;      
        
      if (typeof(TargetObject) != "object")
        return false;    
        
      if(document.getElementById || document.all){
        TargetObject.style.visibility = newVisibility;        
      }else if (document.layers){
        TargetObject.layers.visibility = newVisibility;        
      }else{
        return false;
      }
      return true;
    
}

// --------------------------------------------------------------------------------------------------------

function moveObject(TargetObject, newXCoordinate, newYCoordinate) {
    // get a reference to the cross-browser style object and make sure the object exists
    
    
    
    var styleObject
    //window.alert("1");
    if(document.getElementById || document.all){
       styleObject = TargetObject.style;
    }else if (document.layers){
      styleObject = TargetObject.layers;
    }else{
      return false;
    }
    
    if(styleObject) {
	styleObject.left = newXCoordinate;
	styleObject.top = newYCoordinate;
	return true;
    } else {
	// we couldn't find the object, so we can't very well move it
	return false;
    }
    
}