<!--POP UP WINDOWS
function PopIt_cme()
{
	newwindow=window.open('http://www.cme.com/cgi-bin/prices.cgi?prices/r_lb.html','PopUp','width=700,height=400,scrollbars=yes,toolbar=no');
	return;
	newwindow.creator=self
}
function PopIt_cmeosb()
{
	newwindow=window.open('http://www.cme.com/cgi-bin/prices.cgi?prices/r_bd.html','PopUp','width=700,height=400,scrollbars=yes,toolbar=no');
	return;
	newwindow.creator=self
}

function generic_submit (form) {        
	form.submit ();
}


function checkLimit() {

	numforms = window.document.forms.length;

	checked = 0;
	for( n=0; n<numforms; n++ ) {
		numels = window.document.forms[n].elements.length;

		for( m=0; m<numels; m++ ) {
			var name = window.document.forms[n].elements[m].name;
			if( name == "ind[]" && window.document.forms[n].elements[m].checked ) {
				checked++;
			}
		}
	}

	if( checked > 3 ) {
		alert("You can only select three market inidicators!\nOnly the first three selections will actually be\nstored in your profile.");
	}
}

var checkflag = "false";
function check(field) {
	if (checkflag == "false") {
		for (var i = 0; i < field.length; i++) {
			field[i].checked = true;}
		checkflag = "true";
		return "Uncheck All"; }
	else {
		for (var i = 0; i < field.length; i++) {
			field[i].checked = false; }
		checkflag = "false";
		return "Check All"; }
}

function openAWindow( pageToLoad, winName, width, height, center) { 

	xposition=0; 
	yposition=0;
	
	if ((parseInt(navigator.appVersion) >= 4 ) && (center) ) {
		xposition = (screen.width - width) / 0;
		yposition = (screen.height - height) / 0; 
	} 

	args = "width=" + width + "," 
	+ "height=" + height + "," 
	+ "location=0," 
	+ "menubar=0,"
	+ "resizable=1,"
	+ "scrollbars=1,"
	+ "status=0," 
	+ "titlebar=0,"
	+ "toolbar=0,"
	+ "hotkeys=0,"
	+ "screenx=" + xposition + "100," //NN Only
	+ "screeny=" + yposition + "100," //NN Only
	+ "left=" + xposition + "100," //IE Only
	+ "top=" + yposition + "100,"//IE Only 

	var win_stat = window.open( pageToLoad,winName,args ); 

	if( win_stat == null ) {
		alert("The TraderDirect message system failed to start!\n\nYou may have a pop-up window blocker installed on your computer which will\nprevent TraderDirect messages from being sent.  Please disable the program\nor contact your IT department for assistance.\n\nTraderDirect Support\n--------------------------------------------\nPhone: (503) 233-2504\nE-mail: support@trader-direct.com\n\n(NOTE: After you click 'OK', a message may appear at the top of your account\nlist saying that the messages were sent successfully.  Please disregard as it\nis incorrect.  If you are creating product offers, those will get created but your\naccounts will not be notified until the pop-up window blocker is disabled.)");
	}

} 

function textAreaCounter(field){
   		
	var MAXCHAR=255;

	var totalLength=0;
	totalLength = field.value.length;

	if (totalLength>MAXCHAR){
		alert("The maximum number of characters\nthat can be entered is " + MAXCHAR + ".\n\n You have entered " + totalLength + " characters.");
	}

	field.blur();
	field.focus();

}

	function process_keystroke(e) {
		
		//alert(event.keyCode);
		
		if( event.keyCode == 17 ) {
			var lastname = "";
			numels = window.document.forms[0].elements.length;
			for( el=0;el<numels;el++ ) {
				if( window.document.forms[0].elements[el].name == e.name ) {
					if( lastname != "" ) {
						e.value = window.document.forms[0].elements[lastname].value;
					}
				}
				
				if( window.document.forms[0].elements[el].value != "" && window.document.forms[0].elements[el].name.substr(0,13) == "tally_prices[") {
					lastname = window.document.forms[0].elements[el].name;
				}
				
			}
		}
		
	}

function reloadTable(dest){ 
	location.href = dest.options[dest.selectedIndex].value
}

//--->