function addFriend(targetUserID)
{

	// Create XMLhttp Object on ClientSide

	var getTransferObject = function(){    return null;    };
	if(window.ActiveXObject){
	    // Check if the browser has support for ActiveXObject (IE Usually) 
	    try{ 
	        // Check for the new version of XMLHttp compoment 
	        var x= new ActiveXObject("MSXML2.XMLHTTP"); 
	        getTransferObject = function(){ return new ActiveXObject("MSXML2.XMLHTTP"); }
	        delete x;
	       }catch(_ex){ 
		        try{ // Check for late version of XMLHTTP compoment 
		            var x = new ActiveXObject("Microsoft.XMLHTTP"); 
		            getTransferObject = function(){ return new ActiveXObject("Microsoft.XMLHTTP"); }
		            delete x;
		        }catch(ex){
		            // Otherwise the version of IE is too old 
		        } 
		    } 
		}else if(window.XMLHttpRequest){
		    // XMLHttpRequest object supported by Opera, Firefox and Safari - may too in IE 7. 
		    getTransferObject = function(){ return new XMLHttpRequest(); }
		}


	
	// Create http request

	var xmlhttp = getTransferObject();
	if(!xmlhttp)
	{
		throw "Download the newer Firefox/IE or upgrade your browser please.";
		return false;
	}
		
	else
	{
		strSoap = "" +
	 "<?xml version='1.0' encoding='utf-8' standalone='no'?>" +
	    "<SOAP-ENV:Envelope xmlns:SOAPSDK1='http://www.w3.org/2001/XMLSchema' xmlns:SOAPSDK2='http://www.w3.org/2001/XMLSchema-instance' xmlns:SOAPSDK3='http://schemas.xmlsoap.org/soap/encoding/' xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'>"+
	        "<SOAP-ENV:Body>" +
	            "<addFriend xmlns='http://www.tapuz.co.il/olamot/webservices/addFriendService'>" +
			        "<friendId xmlns:SOAPSDK4='http://www.tapuz.co.il/olamot/webservices/addFriendService'>"+targetUserID+"</friendId>" +
	            "</addFriend>" +
	        "</SOAP-ENV:Body>" +
	    "</SOAP-ENV:Envelope>";

		TheUrl = "http://www.tapuz.co.il/olamot/WebServices/addFriendService.asmx";
		xmlhttp.open("POST",TheUrl ,true);

		xmlhttp.setRequestHeader ('Content-Type','text/xml; charset=utf-8');
		xmlhttp.setRequestHeader ('SOAPAction','http://www.tapuz.co.il/olamot/webservices/addFriendService/addFriend');
		xmlhttp.setRequestHeader ('Content-Length',strSoap.length);
		xmlhttp.setRequestHeader ('Connection','Keep-Alive');
		xmlhttp.setRequestHeader ('Cache-Control','no-cache');
		xmlhttp.setRequestHeader ('Pragma','no-cache');
		
		xmlhttp.send(strSoap);

		xmlhttp.onreadystatechange = function ()
		{
			
			if (xmlhttp.readyState == 4)
			{
				HttpStatus = xmlhttp.status;

				if (HttpStatus==200)
				{
					
				}
				else
				{

					alert ('התרחשה שגיאה. אנא נסה שנית מאוחר יותר');
				}

			}
		}
		delete (xmlhttp);

	}

}



function removeFriend(targetUserID)
{

	// Create XMLhttp Object on ClientSide

	var getTransferObject = function(){    return null;    };
	if(window.ActiveXObject){
	    // Check if the browser has support for ActiveXObject (IE Usually) 
	    try{ 
	        // Check for the new version of XMLHttp compoment 
	        var x= new ActiveXObject("MSXML2.XMLHTTP"); 
	        getTransferObject = function(){ return new ActiveXObject("MSXML2.XMLHTTP"); }
	        delete x;
	       }catch(_ex){ 
		        try{ // Check for late version of XMLHTTP compoment 
		            var x = new ActiveXObject("Microsoft.XMLHTTP"); 
		            getTransferObject = function(){ return new ActiveXObject("Microsoft.XMLHTTP"); }
		            delete x;
		        }catch(ex){
		            // Otherwise the version of IE is too old 
		        } 
		    } 
		}else if(window.XMLHttpRequest){
		    // XMLHttpRequest object supported by Opera, Firefox and Safari - may too in IE 7. 
		    getTransferObject = function(){ return new XMLHttpRequest(); }
		}


	
	// Create http request

	var xmlhttp = getTransferObject();
	if(!xmlhttp)
	{
		throw "Download the newer Firefox/IE or upgrade your browser please.";
		return false;
	}
		
	else
	{
		strSoap = "" +
		"<?xml version='1.0' encoding='utf-8' standalone='no'?>" +
	    "<SOAP-ENV:Envelope xmlns:SOAPSDK1='http://www.w3.org/2001/XMLSchema' xmlns:SOAPSDK2='http://www.w3.org/2001/XMLSchema-instance' xmlns:SOAPSDK3='http://schemas.xmlsoap.org/soap/encoding/' xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'>"+
	        "<SOAP-ENV:Body>" +
	            "<deleteFriend xmlns='http://www.tapuz.co.il/olamot/webservices/addFriendService'>" +
			        "<friendId xmlns:SOAPSDK4='http://www.tapuz.co.il/olamot/webservices/addFriendService'>"+targetUserID+"</friendId>" +
	            "</deleteFriend>" +
	        "</SOAP-ENV:Body>" +
	    "</SOAP-ENV:Envelope>";


		TheUrl = "http://www.tapuz.co.il/olamot/WebServices/addFriendService.asmx";
		xmlhttp.open("POST",TheUrl ,true);
		
		xmlhttp.setRequestHeader ('Content-Type','text/xml; charset=utf-8');
		xmlhttp.setRequestHeader ('SOAPAction','http://www.tapuz.co.il/olamot/webservices/addFriendService/deleteFriend');
		xmlhttp.setRequestHeader ('Content-Length',strSoap.length);
		xmlhttp.setRequestHeader ('Connection','Keep-Alive');
		xmlhttp.setRequestHeader ('Cache-Control','no-cache');
		xmlhttp.setRequestHeader ('Pragma','no-cache');

		xmlhttp.send(strSoap);

		xmlhttp.onreadystatechange = function ()
		{
			
			if (xmlhttp.readyState == 4)
			{
				HttpStatus = xmlhttp.status;

				if (HttpStatus==200)
				{

				}
				else
				{
					alert ('התרחשה שגיאה. אנא נסה שנית מאוחר יותר');
					alert (HttpStatus);
				}

			}
		}
		delete (xmlhttp);

	}

}
