window.redefiningFC;
$(document).ready(function(){
	/* FC's function for filling in the menus doesn't work for us * we'll redefine it */ 		/*$("body").append("<br>attempting to redefine by interval");*/
	redefiningFC = setInterval( "redefineFC()", 100 );
	/*$("body").append("<br>interval started");*/
});
function redefineFC() {
	if ( typeof chooseColorShapeGraphic == "function" ) {
		/* it's been defined by their javascript, now we can redefine it */ 		/*$("body").append("<br>redefining function");*/
		window["chooseColorShapeGraphic"] = function( color, shape, graphic, colorID, shapeID, graphicID ) {
			colorID = "selectShapeColor";
			graphicID = "selectPersTags";
			/*$("body").append("<br>redefined function working");*/
			/* graphic */
			$("#" + graphicID + " option").each(function(i){
				/*$("body").append("<br>matching " + $(this).val() + " against " + graphic );*/
				if ( cleanText($(this).val()) == cleanText(graphic) ) {
					$("#greenCheckPersTags").show( "clip" );
					jQuery(this).parent().val( jQuery(this).val() );
				} else {
					if ( jQuery(this).parent().val() == jQuery(this).val() ) {
						jQuery(this).parent().val("");
					}
				}
			});
			/*$("body").append("<br>CHECKING COLOR");*/
			/* color */
			/* our shape and color are in one menu * search for <shape><color> */
			$("#" + colorID + " option").each(function(i){
				/*$("body").append("<br>matching " + $(this).val() + " against " + shape + color );*/
				if ( cleanText($(this).val()) == cleanText(shape) + cleanText(color) ) {
					$("#greenCheckShapeColor").show( "clip" );
					jQuery(this).parent().val( jQuery(this).val() );
				} else {
					if ( jQuery(this).parent().val() == jQuery(this).val() ) {
						jQuery(this).parent().val("");
					}
				}
			});
			$("#JQUIDialog").dialog( "close" );
		};
		/*$("body").append("<br>trying to clear interval...");*/
		redefiningFC = clearInterval(redefiningFC);
		/*$("body").append("<br>interval should be cleared...");*/
	} // if ( typeof chooseColorShapeGraphic == "function" ) {
} // function redefineFC() {
