function post_on_fb(_title, _link, _description, _target_frame, _close_button){
	_target_frame.style.border = "1px dashed #EEEEEE";
	show_target_frame(_target_frame, 650, 500);	
	position_close_button(_close_button, _target_frame);
	_target_frame.src = "http://wscomments.worldsview.com/fbconnect/fbconnect_post_comment.php?rt=false&link=" + escape(_link) +  "&title=" + escape(_title) + "&desc=" + escape(_description);	
}

function post_on_twitter(_title, _link, _description, _tags,  _target_frame, _close_button){
	_target_frame.style.border = 'none';
	show_target_frame(_target_frame, 650, 600);
	position_close_button(_close_button, _target_frame);
	_target_frame.src = "http://wscomments.worldsview.com/twitter/twitter.php?op=login_frm&title=" + escape(_title) + "&desc=" + escape(_description) + "&tags=" + escape(_tags) + "&link=" + escape(_link);
}

function post_on_avoo_net(_title, _link, _description, _tags, _target_frame, _close_button){
	_target_frame.style.border = 'none';
	show_target_frame(_target_frame, 650, 600);
	position_close_button(_close_button, _target_frame);
	_target_frame.src = "http://wscomments.worldsview.com/avoonet/index.php?op=login_frm&title=" + escape(_title) + "&desc=" + escape(_description) + "&tags=" + escape(_tags) + "&link=" + escape(_link);
}

function show_target_frame(_target_frame, _width, _height){
	_target_frame.style.display = "";	
	// Get current scroll
	try{		
		scroll_top = document.documentElement.scrollTop;
		_target_frame.style.width = _width + "px";
		_target_frame.style.height = _height + "px";
		_target_frame.style.top = (100 + scroll_top) + "px";
		_target_frame.style.left = "50px";
	}catch(e){
	}
}

function position_close_button(_close_btn_obj, _working_frame){
	_close_btn_obj.style.display = "";
	_close_btn_obj.style.top = (parseInt(_working_frame.style.top, 10) - 20) + "px";
	_close_btn_obj.style.left = (parseInt(_working_frame.style.left, 10) - 20) + "px";
}

function create_transparent_bg(_transparent_bg){
	_transparent_bg.style.top = 0;
	_transparent_bg.style.left = 0;

	var root_element = (document.compatMode == 'CSS1Compat')?document.documentElement:document.body;
	_transparent_bg.style.width  = root_element.scrollWidth + "px";
	_transparent_bg.style.height = root_element.scrollHeight + "px"; //'100%';
/*
	if (document.getSelection) {
		_transparent_bg.style.width = document.body.clientWidth + "px"; // '100%';
		_transparent_bg.style.height = document.body.clientHeight + "px"; //'100%';
	}else{	
		_transparent_bg.style.width = document.body.scrollWidth + "px"; // '100%';
		_transparent_bg.style.height = document.body.scrollHeight + "px"; //'100%';
	}
*/
	
}

function distroy_transparent_bg(_transparent_bg){
	_transparent_bg.style.top = 0;
	_transparent_bg.style.left = 0;
	_transparent_bg.style.width = "0px";
	_transparent_bg.style.height = "0px";
}

function close_working_window(_working_frame, _close_btn_obj){
	_close_btn_obj.style.display = 'none';
	_working_frame.src = 'about:blank';
	_working_frame.style.display = "none";	
}

function trim(content){
	content = content.replace(/^\s+/, '');
	content = content.replace(/\s+$/, '');
	return content;
}
/////////////////////////////////////////////////////////////////////////////////