var intLimit = 5;

function doCoolThings( ta ) {
    ta.value = convertSpaces( ta.value );
    var aryItems = ta.value.split( "','" );
    aryItems = aryItems.slice( 0, intLimit );
    ta.value = aryItems.join( "','" );
    countWords(ta.value);
}

function passText(str) {
    document.yourform.select.value = "Where WORKORDER.WONUM in ('" + str + "')";
}

function passText2(str) {
    document.yourform.select.value = "Where WORKORDER.LEADCRAFT in ('" + str + "')";
}

function passText3(str) {
    document.yourform.select.value = "Where WORKORDER.STATUS in ('" + str + "')";
}

function passText4(str) {
    document.yourform.select.value = "Where PLEASE PURCHASE A MEMBERSHIP! in ('" + str + "')";
}

function passText5(str) {
    document.yourform.select.value = "Where PLEASE PURCHASE A MEMBERSHIP! in ('" + str + "')";
}

function passText6(str) {
    document.yourform.select.value = "Where PLEASE PURCHASE A MEMBERSHIP! in ('" + str + "')";
}

function passText7(str) {
    document.yourform.select.value = "Where PLEASE PURCHASE A MEMBERSHIP! in ('" + str + "')";
}

function passText8(str) {
    document.yourform.select.value = "Where PLEASE PURCHASE A MEMBERSHIP! in ('" + str + "')";
}

function countWords(strVal){
    var strArray = strVal.split ("','");
    document.getElementById('cnt').innerHTML = strArray.length;
}

function copyit(theField) {
    var tempval=eval("document."+theField)
    tempval.focus()
    tempval.select()
    therange=tempval.createTextRange()
    therange.execCommand("Copy")
}