

/*
cleartext();
Clears the text from a form field.
*/
function cleartext(box,clear_string) 
{
	if(box.value==clear_string || box.value==clear_string) 
	{
		box.value = "";
	}
}

/*
pop_window();
Opens a new HTML window.  Appears to be popup blocker safe.
*/
function pop_window( newurl, newname, neww, newh )
{
	var cw = 0, ch = 0;
    var winname = (newname == null) ? "NewWindow" : newname;
    var w = ( neww == null || neww == 0 ) ? 400 : neww;
    var h = ( newh == null || neww == 0 ) ? 250 : newh;
	
	var sheight = ( screen.availHeight > screen.height )?screen.availHeight:screen.height;
	var swidth = ( screen.availWidth > screen.width )?screen.availWidth:screen.width;
	
	var top = Math.floor( (sheight - h) / 2 );
	var left = Math.floor( (swidth - w) / 2 );

	window.open( newurl, winname,'width='+w+',height='+h+',top='+top+',left='+left+'status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes');
}
//function pop_window( newurl, newname, neww, newh )
//{
//	var w = 400, h = 250, cw = 0, ch = 0;

//	if (neww > 0) {
//		w = neww;
//	}

//	if (newh > 0) {
//		h = newh;
//	}

/*	if (window.screen) {
	    w = Math.floor(screen.availWidth-200);
	    h = Math.floor(screen.availHeight);
	}
*/

//	window.open( newurl, newname,'width='+w+',height='+h+',top='+ch+',left='+cw+'status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes');
//}


/*
toggle();
Toggles an element visible or invisable
*/
function toggle(order_num) 
{
	if( document.getElementById(order_num).style.display=='none' )
	{
		document.getElementById(order_num).style.display = '';
	}
	else
	{
		document.getElementById(order_num).style.display = 'none';
	}
}
