//--Notice of Copyright --//
/*
Copyright (C) 2003, Juxta Media LLC
All rights reserved.
Reproduction or use of code contained herein is strictly prohibited without
the expressed permission of Juxta Media LLC.

Under no circumstances shall this copyright notice be removed from this file.
*/
//--End Notice --//



function isValidEmail(str) {

    var at="@"
    var dot="."
    var lat=str.indexOf(at)
    var lstr=str.length
    var ldot=str.indexOf(dot)
    if (str.indexOf(at)==-1){
       alert("Invalid E-mail address")
       return false
    }
    
    if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
       alert("Invalid E-mail address")
       return false
    }
    
    if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
        alert("Invalid E-mail address")
        return false
    }
    
     if (str.indexOf(at,(lat+1))!=-1){
        alert("Invalid E-mail address")
        return false
     }
    
     if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
        alert("Invalid E-mail address")
        return false
     }
    
     if (str.indexOf(dot,(lat+2))==-1){
        alert("Invalid E-mail address")
        return false
     }
    
     if (str.indexOf(" ")!=-1){
        alert("Invalid E-mail address")
        return false
     }
    
return true					
}

function openDimWindow(file, width, height, winname, nodim) {
	if (!winname) winname = 'win1';
	if (!nodim) nodim = false;
	if (nodim)
		dimension="toolbar=no,status=no,location=no,scrollbars=no,resizable=no,width="+width+",height="+height; 
	else 
		dimension="toolbar=yes,status=no,location=no,scrollbars=yes,resizable=yes,width="+width+",height="+height; 
	window.open(file, winname, dimension);
}

function openWindow(file,winname) {
	var width = 600;
	var height = 500;
	openDimWindow(file, width, height, winname, false);
}

function openFullWindow(file,winname) {
	if (!winname) winname = 'fullwin';
	var width = 800;
	var height = 600;
	openDimWindow(file, width, height, winname, false);
}

function deleteConfirm( theURL) {
	if (confirm('Are you absolutely sure you wish to delete this record?  This is not recoverable.')) 
		top.location.href = theURL;
}

function clearConfirm( theURL) {
	if (confirm('Are you absolutely sure you wish to clear the sent records?  This is not recoverable.')) 
		top.location.href = theURL;
}

function bookmarkThis(url, desc) {
	if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4) && (navigator.platform != "MacPPC")) {
		window.external.addFavorite(url, desc);
	}
	else {
		var msg = "Please hit";
		if (navigator.appName == "Netscape") 
			msg += " (CTRL-D) to add to your bookmark.";
		else if (navigator.platform == "MacPPC")
			msg += " (Apple-D) to add to your favorites.";
		else 
			msg += " the \"Favorites\" item in the menu bar to add to your favorites.";
		alert(msg);
	}
}

function ImageLoad( theImageName, theOnSrc, theOffSrc ) {
	if (document.images) {
	  eval(theImageName + "on = new Image()");
	  eval(theImageName + "off = new Image()");
	  eval(theImageName + "on.src = '" + theOnSrc + "'");
	  eval(theImageName + "off.src = '" + theOffSrc + "'");
	}
}
function ImageOn( theImageName ) {
  if (document.images) {
    document.images[theImageName].src = eval(theImageName + "on.src");
  }
}
function ImageOff( theImageName ) {
  if (document.images) {
    document.images[theImageName].src = eval(theImageName + "off.src");
  }
}

var marked_row = new Array;

function setColor (theRow, theRowNum, theColor, theState) {
	rowCellsCnt = theRow.cells.length;
	for (c = 1; c < rowCellsCnt-1; c++) {
		if (theState == 'down') {
			marked_row[theRowNum] = true;
		}
		/*else {
			if (downColor == '')
				theRow.cells[c].setAttribute('bgcolor', theColor, 0);
		}*/
		theRow.cells[c].setAttribute('bgcolor', theColor, 0);
	} 
}
