var friend_count = 4;

function mailsSent() {
	if( !confirm( "Your emailshave been sent.\n\nWould you like to send more?" ) ) {
		window.location = "url de redirection";
	}
}

function updateSender( text ) {
	$( 'sender' ).innerHTML = text;
}

function slideDown() {
	$('count').value = friend_count;
	$('friends'+friend_count+'_row').style.display = 'block';
	$('more_friend_btn').style.display = 'none';
	if( friend_count < 10) {
		friend_count++;
		setTimeout("slideDown()", 20);
	}
}

function openWindow( page, width, height, params ) {
	page += '.php';
	if( params ) {
		page += params;
	}
	var top = (screen.height-height)/2;
	var left = (screen.width-width)/2;
	window.open( page, '', 'width = ' + width + ', height = ' + height + ', top = ' + top + ', left = ' + left + ', resizable = no, scrollbars = yes' );
}

function controlCharLength( field, length ) {
	if( $F( field.getAttribute( 'id' ) ).length > length ) {
		$( field.getAttribute( 'id' ) ).style.background = '#ff7777';
		alert( "Sorry, but the name entered must be less than " + length + " characters" );
		$( field.getAttribute( 'id' ) ).value = $F( field.getAttribute( 'id' ) ).substr( 0, length );
	} else {
		$( field.getAttribute( 'id' ) ).style.background = '#ffffff';
	}
}

function removeSWFobject() {
	var newdiv = document.createElement("div");
	newdiv.innerHTML = " ";
	var flashdiv = $("video_player");
	document.body.replaceChild(newdiv, flashdiv);
}