function addPhone()
{
	$('#fTellYourFriends .add').click(function(event){
	    var parentRow = $(this).parent().parent();
	    var parentCell = $('td:last', parentRow );
		
	    var lastNum = parseInt( $('.num', parentRow).html() );
	    
	    parentCell.html( '<input class=\"text\" type=\"text\" value=\"\" name=\"phone_' + lastNum + '\" />' );
	});
}

$(document).ready( function() {
	$('#fTellYourFriends a.more').click( function(){
	    var lastRow = $('#fTellYourFriends tbody tr:last');
	    var lastNum = parseInt( $('.num', lastRow).html() );
	    
	    for( i = 0; i < 5; i++ ) {
		var row = '<tr><td class=\"num\">' +
			++lastNum +
			'.</td>' +
			'<td><input class=\"text\" type=\"text\" value=\"\" name=\"first_name_' + lastNum + '\" /></td>' +
                               '<td><input class=\"text\" type=\"text\" value=\"\" name=\"last_name_' + lastNum + '\" /></td>' +
                               '<td><input class=\"text\" type=\"text\" value=\"\" name=\"email_' + lastNum + '\" /></td>' +
                               '<td><button class=\"add button\" type=\"button\">Add</button></td></tr>';
			
		$('#fTellYourFriends tbody tr:last').after(row);
	    }
	    
	    addPhone();
	});
	
	addPhone();
});

function openWin(file,windowName,w,h,prop)
{
	// some values that can be passed
	// width=600,height=500,left=20,top=20,scrollbars=yes,resizable=yes
	var winl = (screen.width - w) / 2;
	var wint = ((screen.height - h) / 2) - 25;
	var ObjWin = new Object()
	ObjWin.win = window.open(file, windowName, prop+',top='+wint+',left='+winl+',width='+w+',height='+h)
	if (parseInt(navigator.appVersion) >= 4) { ObjWin.win.window.focus(); }
}