on_Complite = function(data)
{
	$('#ibox_content').html(data);
}
Send_message = function()
{
	PopupShowProgress();
	var u=$('#u').attr('value');
	var a=$('#a').attr('value');
	var subject=$('#subject').attr('value');
	var text_body=$('#text_body').attr('value');
	$.post('/index.php?action=profile/action',
  		{
			u:u,
			a:a,
			subject:subject,
			text_body:text_body
  		},
  		on_Complite
	);
}

Send_opportunity = function()
{
	PopupShowProgress();
	var u=$('#u').attr('value');
	var a=$('#a').attr('value');
	var subject=$('#subject').attr('value');
	var message=$('#message').attr('value');
	var position=$('#position').attr('value');
	var include_profile=1;
	if($('#include_profile0').attr('checked'))
	{include_profile=0;}
	$.post('/index.php?action=profile/action',
  		{
			u:u,
			a:a,
			subject:subject,
			include_profile:include_profile,
			job_selected:position,
			message:message
  		},
  		on_Complite
	);
}

Recommend = function()
{
	PopupShowProgress();
	var r=$('#r').attr('value');
	var u=$('#u').attr('value');
	var a=$('#a').attr('value');
	var position=$('#position').attr('value');
	var text_body=$('#text_body').attr('value');
	$.post('/index.php?action=profile/action',
  		{
			u:u,
			a:a,
			r:r,
			position:position,
			text_body:text_body
  		},
  		on_Complite
	);
}

EditContact = function()
{
	PopupShowProgress();
	var r=$('#r').attr('value');
	var u=$('#u').attr('value');
	var a=$('#a').attr('value');
	var name=$('#name').attr('value');
	var email=$('#email').attr('value');
	var email2=$('#email2').attr('value');
	var job_title=$('#job_title').attr('value');
	var company=$('#company').attr('value');
	var phone_business=$('#phone_business').attr('value');
	var phone_home=$('#phone_home').attr('value');
	var phone_mobile=$('#phone_mobile').attr('value');
	$.post('/index.php?action=profile/action',
  		{
			u:u,
			a:a,
			r:r,
			name:name,
			email:email,
			email2:email2,
			job_title:job_title,
			company:company,
			phone_business:phone_business,
			phone_home:phone_home,
			phone_mobile:phone_mobile
			
  		},
  		on_Complite
	);
}

AskRecommend = function()
{
	PopupShowProgress();
	var u=$('#u').attr('value');
	var a=$('#a').attr('value');
	var position=$('#position').attr('value');
	var subject=$('#subject').attr('value');
	var text_body=$('#text_body').attr('value');
	var num_connections=document.getElementById("connections_selected").options.length;
	var connections_selected= new Array(0);
	for(var i=0;i<num_connections;i++)
	{
		if(document.getElementById("connections_selected").options[i].selected)
		{connections_selected.push(document.getElementById("connections_selected").options[i].value);}
	}
	$.post('/index.php?action=profile/action',
  		{
			u:u,
			a:a,
			'connections_selected[]':connections_selected,
			subject:subject,
			position:position,
			text_body:text_body
  		},
  		on_Complite
	);
}
/*
AskRecommend = function()
{
	alert('test');
}
*/
Invite = function()
{
	PopupShowProgress();
	var u=$('#u').attr('value');
	var a=$('#a').attr('value');
	var subject=$('#subject').attr('value');
	var text_body=$('#text_body').attr('value');
	$.post('/index.php?action=profile/action',
  		{
			u:u,
			a:a,
			subject:subject,
			text_body:text_body
  		},
  		on_Complite
	);
}
SetToIntroduse = function()
{
	PopupShowProgress();
	var through=$('#introdusers').attr('value');
	var u=$('#u').attr('value');
	var a=$('#a').attr('value');
	$.post('/index.php?action=profile/action',
		   {
				u:u,
				a:a,
				through:through
		   },
		   on_Complite
	);
}
SendIntroduction = function()
{
	PopupShowProgress();
	var through=$('#through').attr('value');
	var u=$('#u').attr('value');
	var a=$('#a').attr('value');
	var subject=$('#subject').attr('value');
	var intr_category=$('#intr_category').attr('value');
	intr_category
	var text_body=$('#text_body').attr('value');
	var text_brief=$('#text_brief').attr('value');
	$.post('/index.php?action=profile/action',
		   {
				u:u,
				a:a,
				through:through,
				subject:subject,
				text_body:text_body,
				text_brief:text_brief,
				intr_category:intr_category,
				do_intr:1
		   },
		   on_Complite
	);
}
