var contact_team_box = null;
var path="http://shared.findproperty.co.za/images/contact_agent/loader.gif";

function loadFormTeam (propid,webref,userid, url)
{
	contact_team_box = new MaJiG_BOX("<center><img src='"+path+"'></center>");
	//displayContact();
	//var arrayPageSize = getPageSize();
//	alert('loading.... '+url);

	new Ajax.Request("/",
    	{
		onSuccess : function(response, json)
		{
//			alert('success');
		    contact_team_box._set_Content(response.responseText);
		    $('title').style.display = 'block';
			//$('contactForm').innerHTML  = response.responseText;
		},
		onFailure : function(response)
		{
		    alert('Error loading contact page');
		},
		parameters : "teamID="+userid+"&webref="+webref+"&propid="+propid+"&loadForm=yes&content=main&page=contact_team"
	}
    );
}

function _removeNotification()
{
	$('notificationDiv').style.display = 'none';
}

function  submitFormTeam(propid,webref,userid,url,sendSMS)
{
	var params = Form.serialize($('contact_agent_form'));
	new Ajax.Request('/',
	{
		onSuccess:function(response, json)
		{
	//		$('contactForm').innerHTML = response.responseText;
			
			contact_team_box._set_Content( response.responseText);
			Effect.Pulsate('notificationDiv');
		    setTimeout("_removeNotification()",5000);
			$('title').style.display = 'block';
		},
		onFailure : function(response)
		{
			alert('failed. URL = '+url);
		},
		method: 'post',
		parameters : "page=contact_team&teamID="+userid+"&webref="+webref+"&propid="+propid+"&loadForm=yes&content=main&send_msg=yes&"+params
	}
	);
}
