var replaceText = "http://twitter.com/YourLink";

function inputBox() {
	var twitterID = document.getElementById('twitterID');
	if(twitterID.value=="Your ID"){ 
		twitterID.value = "";
	}
}

function updateTwitterCode(){
	var theForm = document.forms[0];
	var twitterID = "http://twitter.com/"+document.getElementById('twitterID').value;
	for(i=0; i<theForm.elements.length; i++){
		if(theForm.elements[i].type=="textarea"){
			theForm.elements[i].value = theForm.elements[i].value.replace(replaceText,twitterID);
		}
	}
	replaceText = twitterID;
}

function noenter() {
	if(window.event.keyCode==13){
		updateTwitterCode();
		window.event.keyCode =0;
	}
	return !(window.event && window.event.keyCode == 13); 
}

function copyText(theId) {
   var obj=document.getElementById(theId);
   obj.focus();
   obj.select();
   copyIntoClipboard(obj.value);
}

function copyIntoClipboard(text) {

        var flashId = 'flashId-HKxmj5';

        var clipboardSWF = 'clipboard.swf';

        if(!document.getElementById(flashId)) {
            var div = document.createElement('div');
            div.id = flashId;
            document.body.appendChild(div);
        }
        document.getElementById(flashId).innerHTML = '';
        var content = '<embed src="' + 
            clipboardSWF +
            '" FlashVars="clipboard=' + encodeURIComponent(text) +
            '" width="0" height="0" type="application/x-shockwave-flash"></embed>';
        document.getElementById(flashId).innerHTML = content;
    }

