/* ***** BEGIN LICENSE BLOCK *****
 * Licensed under Version: MPL 1.1/GPL 2.0/LGPL 2.1
 * Full Terms at http://mozile.mozdev.org/0.8/LICENSE
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is James A. Overton's code (james@overton.ca).
 *
 * The Initial Developer of the Original Code is James A. Overton.
 * Portions created by the Initial Developer are Copyright (C) 2005-2006
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *	James A. Overton <james@overton.ca>
 *
 * ***** END LICENSE BLOCK ***** */

/** 
 * @fileoverview Some JavaScript code to run the main testing page.
 * <p>Project Homepage: http://mozile.mozdev.org
 * @author James A. Overton <james@overton.ca>
 * @version 0.8
 * $Id: index.js,v 1.2 2006/08/23 16:55:26 jameso Exp $
 */

function openJsUnitTestPage(page) {
	//alert(page);
	var jsunit = "../jsunit/testRunner.html";
	var options = "autoRun=true";
	var root = location.toString();
	if(root.indexOf('file:') != -1) {
		root = root.slice(root.indexOf('file:')+5, root.length);
	}
	var path = root.slice(0, root.lastIndexOf('index.'));
	var url = jsunit +"?"+ options +"&testpage="+ path + page;
	//alert(url);
	window.open(url, "MozileTests");
}
