<!--

  /*
    ********************************************
    *          File: inc_jscript.js            *
    *       Version: 1.1.1                     *
    *     Copywrite: Rowley Designers (2003)   *
    * Contracted By: America in Design         *
    *  Date Created: 8/1/03                    *
    *  Date Updated: 8/21/03                   *
    *                                          *
    *    Created by: Joel Rowley               *
    *         Phone: (860) 282-0804            *
    *         Email: hjoelr@yahoo.com          *
    *                                          *
    ********************************************
   */
	 
/*
 *  Beginning of the original 'inc_soundplay.js' file.
 */
 
/*
 * This file is made specificially for playing a sound file when the
 * end user clicks the submit buttion on their form.
 *
 * The following Code must be put on the page:
 *  <script language="JavaScript" type="text/JavaScript">
 *    playsound()
 *    document.write("<EMBED NAME='CS1054174157686' SRC='changessaved.wav' LOOP=false AUTOSTART=" + cv)
 *    document.write(" MASTERSOUND HIDDEN=true WIDTH=0 HEIGHT=0></EMBED>")
 *  </script>
 *
 * The 'onSubmit' part of the form should have this in it: storeCookie('true');
 *
 * The sound file can only be one of the following file formats: .wav, .au, .mov, .midi, .mid
 */

/*
 * Cookies in this page act only as session variables since they
 * are deleted as soon as the end user closes their browser.
 */

// Global variables
var cv;                               // Value of my cookie
var allCookies;                       // Gets all cookies
// Name of my cookie is 'playsound'

// Extracts 1st substring in 'myString' bounded by 'delim1' and 'delim2'
// It is OK if the 'delim2' is missing
function extractSubstring( myString, delim1, delim2 ) {
    var substr1 = myString.split( delim1 );
        if ( substr1 == myString ) return -1;     // delim1 not found
    var substr2 = substr1[1].split( delim2 );
    var len1 = substr1[0].length + delim1.length;
    var len2 = substr2[0].length;
    return myString.substring( len1, len1+len2 );
}

// Stores the value of the 'playsound' cookie.
function storeCookie( t ) {
   var cookie = 'playsound=' + t; // + '; expires=' + expireDate(t);
   document.cookie = cookie;
}

// This function ties all the other functions together
function playsound(action, embedname, soundpath) {
	allCookies = document.cookie;
	cv = extractSubstring(allCookies, 'playsound=', ';')
	if (cv == '-1') {
	  cv = 'false'
	}
	storeCookie('false');
}
//-->


/*
 *  End of original 'inc_soundplay.js' file
 */

/*
 *  Beginning of original 'inc_openWin.js' file...
 */
 
 function openWin(winName, urlLoc, w, h, showStatus, isViewer) {
	l = (screen.availWidth - w)/2;
	t = (screen.availHeight - h)/2;
	features  = "toolbar=no";      // yes|no 
	features += ",location=no";    // yes|no 
	features += ",directories=no"; // yes|no 
	features += ",status=" + (showStatus?"yes":"no");  // yes|no 
	features += ",menubar=no";     // yes|no 
	features += ",scrollbars=" + (isViewer?"yes":"no");   // auto|yes|no 
	features += ",resizable=" + (isViewer?"yes":"no");   // yes|no 
	features += ",dependent";      // close the parent, close the popup, omit if you want otherwise 
	features += ",height=" + h;
	features += ",width=" + w;
	features += ",left=" + l;
	features += ",top=" + t;
	winName = winName.replace(/[^a-z]/gi,"_");
	window.open(urlLoc,winName,features);
} 

/*
 *  End of the original 'inc_openWin.js' file.
 */

// This function is used to edit categories
function changeCategory(table, column, pagetitle) {
	var clocation
	clocation = 'edit.category.asp?table=' + table + '&column=' + column + '&pagetitle=' + pagetitle
	openWin('Edit', clocation, 450, 300, true, false)
}

// This function is used for going to certain pages in catalogs
//var object
function goToURL(url) {
	if (txtCatalog.value != null) {
		document.location = url + txtCatalog.value;
	}
}



// The following code is used for the WYSIWYG editors.
_editor_url = "../../config/include/wysiwyg/";                     // URL to htmlarea files
	var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
	if (navigator.userAgent.indexOf('Mac')        >= 0) { win_ie_ver = 0; }
	if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
	if (navigator.userAgent.indexOf('Opera')      >= 0) { win_ie_ver = 0; }
	if (win_ie_ver >= 5.5) {
		document.write('<scr' + 'ipt src="' +_editor_url+ 'inc_editor.js"');
		document.write(' language="Javascript1.2"></scr' + 'ipt>');  
	} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }

/*  
 *  This function is used primarily for the login.asp page to set the
 *  focus to the right text box.  The object is the index number of the
 *  object that is to be specified.
 */
 
function setFocus(object) {
	document.forms[object].elements[object].focus();
	document.forms[object].elements[object].select();
}