// JavaScript Document

function addEmoticon(elementID, insertText) {

	var element = document.getElementById(elementID);
	
	element.focus();
	
	if(typeof document.selection != 'undefined') {

		var selectionRange = document.selection.createRange();

		selectionRange.text = insertText;
	
	}else if(typeof elementID.selectionStart == 'undefined'){

		var cursorPositionStart = element.selectionStart;
		var cursorPositionEnd = element.selectionEnd;
		
		element.value = element.value.substr(0, cursorPositionStart) + insertText + element.value.substr(cursorPositionEnd);

	}
	
}


function doPopUp(url,width,height) {
			
	popUpWindow = window.open(url, '', 'width=' + width + ',height=' +  height +',scrollbars=no');
  	popUpWindow.focus();

}


function redirect(url){
	
	window.location.href=url;
	
}