function getTwitterComment(Prequel, Comment, Link, ShortURL, UseShortURL) {
	var pre='';
	var post='';
	if ((Prequel!='')&&(Prequel!=null)) pre = pre+Prequel+' ';
	if ((Link!='')&&(Link!=null)) post = post+' '+Link;
	if ((ShortURL!='')&&(ShortURL!=null)&&(UseShortURL)) post = post+' via '+ShortURL;
	var remaining = 140 - pre.length - post.length;
	if ((Comment != '')&&(Comment != null)) {
		if (Comment.length <= remaining) {
			return pre+Comment+post;
		} else {
			var Commentsub = Comment.substr(0,remaining);
			return pre+Commentsub+post;
		}
	}
	return pre+post.substr(1); //.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
}

function checkTwitterBoxes(accountTag, id) {
	var Account = document.getElementsByName(accountTag);
	var TwitterChecked = false;
	if (Account!=null) {
		/*var Account = Form.Account;*/
		var value, type;
		for(var i=0; i<Account.length; i++) {
			value = Account[i].value;
			type = value.split('::')[0];
			if ((Account[i].checked)&&(type=='Twitter')) {
				TwitterChecked = true;	
			}
		}
	} 
	var display=(TwitterChecked?'block':'none');
	document.getElementById('twitter_'+id).style.display = display;
}

var newwindow;
function getPopupWindow(url, height, width)
{
	newwindow=window.open(url,'name','height='+height+',width='+width);
	if (window.focus) {newwindow.focus()}
}
