
function GetAbsPosition(object) {
    var position = new Object;
    position.x = 0;
    position.y = 0;

    if( object ) {
        position.x = object.offsetLeft;
        position.y = object.offsetTop;

        if( object.offsetParent ) {
            var parentpos = GetAbsPosition(object.offsetParent);
            position.x += parentpos.x;
            position.y += parentpos.y;
        }
    }

    position.cx = object.offsetWidth;
    position.cy = object.offsetHeight;

    return position;
}
                          
					
									
function refresh(){
    window.location.reload(true);
}

function bootByReplyType(object){
		var targetTextbox =  new Object;
		targetTextbox = document.getElementById('reply');
		//alert(object.value);
		if(object.value == 'SMS'){
		document.getElementById('reply').cols = 40;
		document.getElementById('reply').rows = 4;
		document.getElementById('reply_label').innerHTML = "Sending Message via SMS. Text is Limited to 160 characters";
		
		//alert("fff");
		} else {
		targetTextbox.cols = 60;
		targetTextbox.rows = 6;
		document.getElementById('reply_label').innerHTML = "Sending Message via Email. Text is unlimited";
		
		
		}
		
	}
	function limitTextArea(object){
	var requiredStringLenght = 20;
	var replyMode  = document.getElementById('reply_mode').value;
	if(replyMode == "SMS"){
		var stringLenght = object.value.length;
		if(stringLenght >= requiredStringLenght ){
			if(stringLenght > requiredStringLenght ){
				alert("String lenght of 160 for sms is exceeded");			
			}
			var newVal = object.value.substring(0,requiredStringLenght);
//			alert(newVal);  //
			object.value = newVal;
			}
	} 
	}
