//--- ****************************************************************************************************************** --->
//--- ****************************************************************************************************************** --->
//--- ****************************************************************************************************************** --->
/*
common.js
	- Contains frequently used functions for HTML forms
*/

//--- ****************************************************************************************************************** --->
//--- ****************************************************************************************************************** --->
//--- ****************************************************************************************************************** --->

/* Use for changing the messages in the header frame
	- Tagnames can be 1. mainTitle 2. navPath 3. subTitle
	- Donny: Need more work on making it compatible with Netscape and Mac
 */
function ChangeHeaderMsg(message,tagName)
{
	ns4=(document.layers)?true:false;
	ns6=(navigator.userAgent.indexOf("Gecko")!=-1)?true:false;
	// Browser Detection
/*	mac=(navigator.appVersion.indexOf("Mac")!=-1)?true:false
	if(ns6||ns4)mac=false
	ns61=(parseInt(navigator.productSub)>=20010726)?true:false
	ie4=(!document.getElementById&&document.all)?true:false;
*/
	if (top.headerFrame){
	//	if(ns4 || ns6)
	//	{
	//		top.headerFrame.document.layers.mainTitle.innerText="hello";
	//	} else {
			top.headerFrame.document.all[tagName].innerText=message;
	//	}
		return true;
	} else
		return false;
}

//--- ****************************************************************************************************************** --->
//--- ****************************************************************************************************************** --->


	// FRAME THIS! (Annotated Version 1.7)
	// script home location http://www.gmdstudios.com/ideas/frames/
	// Authors: GMD Studios (Andrew Cowan & Brian Clark)
	// Contact: inquiries@gmdstudios.com
	//
	// This script is copyright 1997-8 by GMD Studios. Permission to
	// use, modify, and distribute this is granted as long as authors'
	// copyright statements are left intact. All other use prohibited.
	//
	// note: use <body  onLoad="framethis()"> to detect if this is the top frame or not
	// VARIABLE ASSIGNMENT
	// Set real_location to the URL of your website.
	var real_location = "http://www.highfive.org/static/";
	function framethis () {
		// FIRST LOOP - Browsers that support top.location
		if (top.location) {
			if (self != top)
				top.location = self.location;
		} else {
		// SECOND LOOP - Browsers that don't support top.location
			if (parent.location) {
				if (parent.location != real_location)
					parent.location = real_location;
			}
		}
	}
	//-->

function submitReport(){
	printWindow = window.open('','printWindow', 'directories=no, location=no, menubar=no, status=no, titlebar=no, toolbar=no , scrollbars = yes, resizable=yes, height = 850, width = 750, left = 10, top = 10');
	document.getElementById('frmMain').target='printWindow';
	if (document.getElementById('frmMain').outputFormat != null){
		document.getElementById('frmMain').outputFormat.value='html';
	}
}

function submitExcel(){
	document.getElementById('frmMain').outputFormat.value='excel';
	document.getElementById('frmMain').target='_blank';
}
//--- ****************************************************************************************************************** --->

