function assignOne()
{
documents.forms[0].submit();
return 1
}


// amounts :
//  h for hundreds
//  k for thousands
//  m milliions  (lowercase m)
//  b B M (Capital M)

function get_amount(original_string)
{
var  billion="bBM"
var  hundreds="hH"
var  million="m"
var  thousand="Kk"
var multiplier=1
bad_characters="mM"
    // This string will hold all the "good" characters
    var cleaned_string = ""
    // Run through each character in the original string
	for (var counter = 0; counter < original_string.length; counter++)
	{
        // Get the current character
        current_char = original_string.charAt(counter)
       // Is it in the string of bad characters?
       if (billion.indexOf(current_char) >=0)
           multiplier=10000000000
       else if(million.indexOf(current_char) >=0)
           multiplier=1000000
       else if (thousand.indexOf(current_char) >=0)
           multiplier=1000
       else if (hundreds.indexOf(current_char) >=0)
           multiplier=100
	else
	cleaned_string += current_char
}
   return cleaned_string *multiplier
}

//
// amounts :
//  h for hundreds
//  k for thousands
//  m milliions  (lowercase m)
//  b B M (Capital M)
// 

//  percent sign %, p or P 
//  basis Points
//  h or H hundred  10
//

//  percent sign %, p or P 
//  basis Points
//  h or H hundred  10
//

function get_percent(original_string)
{
var  hundred="hH"
var  basispoints="bB"
var  percent="%pP"
var multiplier=1
bad_characters="mM"
    // This string will hold all the "good" characters
    var cleaned_string = ""
    // Run through each character in the original string
	for (var counter = 0; counter < original_string.length; counter++)
	{
        // Get the current character
        current_char = original_string.charAt(counter)
       // Is it in the string of bad characters?
       if (hundred.indexOf(current_char) >=0)
           multiplier=100
       else if(basispoints.indexOf(current_char) >=0)
           multiplier=0.0001;
       else if (percent.indexOf(current_char) >=0)
           multiplier=0.01
	else
	cleaned_string += current_char
}
   return cleaned_string *multiplier
}



function inc_bounded_up(original_string,increment,precision,maximum)
{
/*   alert("bounded up");*/
   var    answer=0.0;
    answer=original_string*1.0;
     answer= answer + increment*1.0;
   return answer <= maximum ? answer : maximum ;
}

function inc_bounded_down(original_string,increment,precision,minimum)
{
/*   alert("bounded down");*/
   var    answer=0.0;
    answer=original_string*1.0;
     answer=answer - increment*1.0;
   return answer >= minimum ? answer : minmum ;
}

/* toogle between one state and another */
function set_radio(current_form,radio_form,that_form)
{
 radio_form.checked='true';
 that_form.value=' ';
}

/* toogle between one state and another */
function  portfolioOfListItem(current_form)
{
 current_form.pname.value=current_form.portId.options[current_form.portId.selectedIndex].text;
 current_form.portbx.value=current_form.pname.value;
}
/* tag list box assign */
function  tagNameOfListItem(current_form)
{
current_form.tag.value=current_form.tagId.options[current_form.tagId.selectedIndex].text; 
current_form.tagbx.value=current_form.tag.value;
}
/* tag list box assign */
function  futureCodeListItem(current_form)
{
current_form.code.value=current_form.codeId.options[current_form.codeId.selectedIndex].text; 
current_form.futbx.value=current_form.code.value;
}

function display_data(current_form)
{
var confirm_message = "Here's the data you entered into the form:\n"
+ "______________________________\n\n"

// Loop through all the form elements
for (var counter = 0; counter < current_form.length; counter++) {

// Is this a visible text field?
  if ((current_form[counter].type == "text" ||
            current_form[counter].type == "textarea" ||
            current_form[counter].type == "password") &&
            current_form[counter].mandatory) {

                // If so, add the name and value to the message
                confirm_message += current_form[counter].name + " = " +
                                   current_form[counter].value + "\n"
        }
        // Is it a checkbox?
        else if ((current_form[counter].type == "checkbox")
        &&
            current_form[counter].mandatory) {

            // If so, add the name and checked value to the message
            confirm_message += current_form[counter].name + " = " +
                               current_form[counter].checked + "\n"
        }

        // Is it a radio button?
        else if (current_form[counter].type == "radio"
        &&    current_form[counter].mandatory) {

            // If so, is it activated?
            if (current_form[counter].checked) {

                // If so, add the name and checked value to the message
                confirm_message += current_form[counter].name + " = " +
                                   current_form[counter].value + "\n"
            }
        }

        // Is it a single-select list?
        else if (current_form[counter].type == "select-one"
        &&
            current_form[counter].mandatory) {

            // If so, add the name and selected option text to the message
            confirm_message += current_form[counter].name + " = " +
            current_form[counter].options[current_form[counter].selectedIndex].text + "\n"
        }

        // Is it a multiple-select list?
        else if (current_form[counter].type == "select-multiple"
        &&
            current_form[counter].mandatory) {

            // If so, get the selected options
            var chosen_ones = new Array()
            chosen_ones = get_selections(current_form[counter])

            // Add the name and the text of the selected options to the message
            if (chosen_ones.length > 0) {
                confirm_message += current_form[counter].name + " = "
                for (var counter2 = 0; counter2 < chosen_ones.length; counter2++) {
                    confirm_message += current_form[counter].options[chosen_ones[counter2]].text
                    if (counter2 < chosen_ones.length - 1) {
                        confirm_message += " + "
                    }
                }
            }
        }
    }

    confirm_message += "\n______________________________\n\n" +
                       "Do you want to submit this data?"

    // Ask the user to confirm the submit
    var submit_ok = confirm(confirm_message)
    if (submit_ok) {
        current_form.submit()
    }
}





function get_selections(current_list)
{
    var selected_array = new Array()
    var current_index = 0
    for (var counter = 0; counter < current_list.options.length; counter++)
    {
        if (current_list.options[counter].selected)
        {
            selected_array[current_index] = current_list.options[counter].index;
            current_index++;
        }
    }
    return selected_array;
}


function toggleFixedFloat(current_form)
{
//if (ns) this.obj.visibility = 'hide';
//	else this.obj.style.visibility = 'hidden';
//document.forms[0].commit.style.backgroundColor="red";
//document.forms[0].commit.style.Color="#0099FF";
//document.forms[0].cfr.btn.visibility=hidden;
//document.forms[0].mD.style.backgroundColor="red";
//document.forms[0].sprd.value="1234";
//document.forms[0].sprd.style.="hidden";
//document.forms[0].sprd.style.Color="red";

alert("zob");
current_form.ntl.visibility = "hidden";

}

function validate(current_form)
{
    var missing_fields = new Array()
    var total_missing = 0;
    // Loop through all the form elements
    for (var counter = 0; counter < current_form.length; counter++)
    {
        // Is this a visible text field that's mandatory?
        if ((current_form[counter].type == "text" ||
            current_form[counter].type == "textarea" ||
            current_form[counter].type == "password") &&
            current_form[counter].mandatory)
            {
            // Is it whitespace-only?
            if (its_whitespace(current_form[counter].value) ||
                its_empty(current_form[counter].value))
                {
                // If so, add the field to the array of missing fields
                missing_fields[total_missing] = current_form[counter];
                total_missing++;
            	}
        }




    }
  // Were there any fields missing?
  //
  //
  //
  //
  if (total_missing > 0)
  {
     // Start the message
     var missing_message = "Sorry, you must fill in the following "
     										 +
                         (total_missing == 1 ? " field:" : " fields:")
                         +
                         "\n______________________________\n\n";

        // Loop through the missing fields
        for (counter = 0; counter < missing_fields.length; counter++)
        {
            missing_message += missing_fields[counter].name + "\n";
        }

        // Finish up and display the message
        missing_message += "\n______________________________\n\n"
        +
        "Please fill in these fields and then resubmit the form.";
        alert(missing_message);

        // For emphasis, put the focus on the first missing field
        //missing_fields[0].focus();
    }
    else {
        // Otherwise, go ahead and submit
        current_form.submit()
    }
}

function its_empty(string_value) {

    // Check for the empty string and null
    if (string_value == "" || string_value == null) {

        // If either, it's empty so return true
        return true
    }

    // Otherwise, it's not empty so return false
    return false
}

function its_whitespace(string_value) {

    // These are the whitespace characters
    var whitespace = " \n\r\t"

    // Run through each character in the string
    for (var counter = 0; counter < string_value.length; counter++) {

        // Get the current character
        current_char = string_value.charAt(counter)

        // If it's not in the whitespace characters string,
        // return false because we found a non-whitespace character
        if (whitespace.indexOf(current_char) == -1) {
            return false
        }
    }

    // Otherwise, the string has nothing but
    // whitespace characters, so return true
    return true
}


function validate_ok(current_form)
{
    var missing_message = "Mandatory Fields Okay "
	alert(missing_message)

    var missing_fields = new Array()
    var total_missing = 0

    // Loop through all the form elements
    for (var counter = 0; counter < current_form.length; counter++) {

        // Is this a visible text field that's mandatory?
        if ((current_form[counter].type == "text" ||
            current_form[counter].type == "textarea" ||
            current_form[counter].type == "password") &&
            current_form[counter].mandatory){
            // Is it empty?
            if (its_empty(current_form[counter].value))
	    {
                // If so, add the field to the array of missing fields
                missing_fields[total_missing] = current_form[counter]
                total_missing++
            }
        }
    }
    // Were there any fields missing?
    if (total_missing > 0)
    {
        // Start the message
  var missing_message = "You Forgot to Complete the following	Mandatory fields"  + (total_missing == 1 ?" field:" : "fields:")
						+
	"\n______________________________\n\n"
 // Loop through the missing fields
 for (var counter = 0; counter < missing_fields.length; counter++)
	{
            missing_message += missing_fields[counter].name
	          missing_fields[counter].name + "\n"
  }
  // Finish up and display the message
  missing_message +="\n______________________________\n\n"
	+
  "Please fill in these fields and then resubmit the form."
	alert(missing_message)
  // For emphasis, put the focus on the first missing field
  missing_fields[0].focus()

return false
}
else
{ return true;}

}



function its_empty(string_value) {

    // Check for the empty string and null
    if (string_value == "" || string_value == null) {

        // If either, it's empty so return true
        return true
    }

    // Otherwise, it's not empty so return false
    return false
}

function its_whitespace(string_value)
{
    // These are the whitespace characters
    var whitespace = " \n\r\t"
    // Run through each character in the string
    for (var counter = 0; counter < string_value.length; counter++)
    {
        // Get the current character
        current_char = string_value.charAt(counter)
        // If it's not in the whitespace characters string,
        // return false because we found a non-whitespace character
        if (whitespace.indexOf(current_char) == -1)
        {
            return false
        }
    }
    // Otherwise, the string has nothing but
    // whitespace characters, so return true
    return true
}

function initialized()
{
//document.forms[0].ntl.mandatory = true;
//document.forms[0].cpn.mandatory = true;
//document.forms[0].isput.mandatory = true;

return true;
}



function toggle_custom_property(current_field)
{
if(document.forms[0].grp.value==9)
      document.forms[0].grp.value=10
else if(document.forms[0].grp.value==12)
	document.forms[0].grp.value=9
else if(document.forms[0].grp.value==10)
	document.forms[0].grp.value=12



document.forms[0].submit();
}

function get_cookie(name_to_get)
{
    var cookie_pair
    var cookie_name
    var cookie_value

    // Split all the cookies into an array
    var cookie_array = document.cookie.split("; ")

    // Run through the cookies
    for (counter = 0; counter < cookie_array.length; counter++) {

        // Split the cookie into a name/value pair
        cookie_pair = cookie_array[counter].split("=")
        cookie_name = cookie_pair[0]
        cookie_value = cookie_pair[1]
        // Compare the name with the name we want
        if (cookie_name == name_to_get)
	{
            // If this is the one, return the value
            return unescape(cookie_value)
        }
    }
    // If the cookie doesn't exist, return null
    return null
}

function  call_cookie(current_form)
{
alert(getCookie("uctpg"));
}


function callStrikes(current_form)
{
  current_form.cfc.value="ST";
  current_form.submit();
}


