/*****************************************************************************
*
*  ikn_apps.js
*  Author:  Peter Adams (pta@interkan.net)
*  http://www.interkan.net/
*  Date Created: 21 March 2002
*  Last Modified: 12 August 2004
*
*  Description:
*    This file contains JavaScript code for use with IKN Universal Apps.
*
* Copyright (c) 2002-2003 InterKan.Net, Inc.  All rights reserved.
*
*****************************************************************************/

function openWin(url, w, h) {
/*****************************************************************************
openWin opens a new window pointing to the supplied URL.  The window will
have no borders, no menus, and vertical scroll bar only.
*****************************************************************************/
    if (w == null) w = 500;
	if (h == null) h = 400;
	var tmp = new Date();
	var success = window.open(url,tmp.getTime(),'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=' + w + ',height=' + h);
}

function add_emoticon(icon) {
/*****************************************************************************
Adds the specified emoticon to the end of the message body element of the
post form.
*****************************************************************************/
    self.document.forumMessagePost.body.value += icon + " ";
	self.document.forumMessagePost.body.focus();
}

function checkAll(f) {
/*****************************************************************************
Marks all checkboxes in the specified form.
*****************************************************************************/
	for (i=0; i<f.elements.length; i++) {
	    f.elements[i].checked = f.check_all_listed.checked;
	}
}

function useProduct(textbox, value) {
/*****************************************************************************
Populates the specified textbox with the specified value.
*****************************************************************************/
    textbox.value = value;
}

/*
Submit Once form validation- 
© Dynamic Drive (www.dynamicdrive.com)
For full source code, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

function submitonce(theform){
/*****************************************************************************
Double-click syndrome sufferers beware!
*****************************************************************************/
	//if IE 4+ or NS 6+
	if (document.all||document.getElementById){
		//screen thru every element in the form, and hunt down "submit" and "reset"
		for (i=0;i<theform.length;i++) {
			var tempobj=theform.elements[i]
			if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="image")
				//disable em
				tempobj.disabled=true
		}
	}
}
