function getvideoid(url)
{
	var matches = 
	{
		0 : "http://www.youtube.com/watch?v=",
		1 : "http://youtube.com/watch?v=",
		2 : "www.youtube.com/watch?v=",
		3 : "youtube.com/watch?v="
	}			
	var found = false;
	var matchindex = null;
	
	for(index in matches)
	{
		if (url.indexOf(matches[index])==0)
		{
			found=true;
			matchindex=index;
			break;
		}
	}
	if (!found)
	{
		alert('This is not a valid link, it should similar to the format "http://www.youtube.com/watch?v=########"'); return false;
	}

	var video_id = url.substr(matches[matchindex].length);
	//alert(video_id);
	byname('participant[youtube_video_id]').value = video_id;
}
