carbidecpp22devenv/configuration/org.eclipse.osgi/bundles/225/1/.cp/javascript/common.js
author cawthron
Fri, 04 Dec 2009 10:01:33 -0600
changeset 5 684bf18fdedf
permissions -rw-r--r--
add files for RCL_2_2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     1
/*******************************************************************************
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     2
 * Copyright (c) 2006 IBM Corporation and others.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     3
 * All rights reserved. This program and the accompanying materials 
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     4
 * are made available under the terms of the Eclipse Public License v1.0
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     5
 * which accompanies this distribution, and is available at
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     6
 * http://www.eclipse.org/legal/epl-v10.html
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     7
 * 
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     8
 * Contributors:
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     9
 *     IBM Corporation - initial API and implementation
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    10
 *******************************************************************************/
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    11
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    12
/*
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    13
 * The following function toggles between block and none display
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    14
 * for the element with a given id. It also toggles between
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    15
 * open and closed images for the folding section.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    16
 * Returns false to stop the browser from following the link.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    17
 */
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    18
function toggleSection(id, closedId, openId) {
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    19
	if (document.getElementById) {
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    20
   		var element = document.getElementById(id);
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    21
   		var openImage = document.getElementById(openId);
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    22
   		var closedImage = document.getElementById(closedId);
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    23
   		if (element.style.display=="block") {
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    24
   			// hide the client block
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    25
	   		element.style.display="none";
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    26
	   		// switch toggle images
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    27
   			if (openImage)
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    28
   				openImage.style.display="none";
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    29
			if (closedImage)
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    30
				closedImage.style.display="inline";
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    31
	   	}
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    32
	   	else {
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    33
	   		// turn it on and show
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    34
	   		element.style.display="block";
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    35
	   		// switch toggle images
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    36
   			if (openImage)
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    37
   				openImage.style.display="inline";
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    38
   			if (closedImage)
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    39
   				closedImage.style.display="none";
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    40
	   	}
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    41
   	}
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    42
   	return false;
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    43
}