// are we in the right place? if ( location.href.indexOf( 'etsy.com/create_listing2.php' ) > -1 ) { d = document; // get the current tags and make them nice to read v = d.forms[ 2 ].tagInput.value.replace( /\./g, ', ' ); v = v.replace( /_/g, ' ' ); // prompt for new tags with the existing ones as the default if ( s = prompt( 'Tags', v ) ) { // we have tags, turn them into an array t = s.split( /,\s*/ ); // set up some short references f = d.forms[ 1 ]; a = allTagPointers; // remove existing tags while( a.length > 1 ) { removeTag( a[ 1 ] ); } // find the first tag in the drop-down and select it y = t[ 0 ].replace( / /g, '_' ); s = f.getElementsByTagName( 'select' )[ 0 ]; u = s.options; for ( o = 0; o < u.length; o++ ) { if( u[ o ].value == y ) { s.selectedIndex = o; mainCategorySelector( y ) } } // add the remaining tags for ( a = 1; a < t.length; a++ ) addTag( t[ a ] ) } }