Adding youtube videos with javascript
Video Gallery


<script type="text/javascript">


var vidtit = new Array();
vidtit[1] = ["2SS-TIA_epM","Rammstein Engel"];
vidtit[2] = ["ywJqdtmhhv0","Hot Abs Workout"];
vidtit[3] = ["hLLFsgq_3DM","Murder on The Dance Floor"];
vidtit[4] = ["h3nROFIF5ek","Gina G- OOh Ah"];
vidtit[5] = ["C5KFQB2Jv2c","Loona Vamos A la Playa"];
vidtit[6] = ["eiuHdUkuRi0","Sabrina"];
vidtit[7] = ["php2a-1o3ts","Shaggy"];
vidtit[8] = ["FAtW0hua9rE","Rudenko - Everybody"];
vidtit[9] = ["wmIFRVL2qHs","Pump Up The Jam"];
vidtit[10] = ["RWtwOH95dKM","Ice T's Puppy Dog Loophole "];
vidtit[11] = ["end"];

function goadd(z)
{


document.getElementById("vid").innerHTML='<object  width="640" height="388"> <param name="movie" 
value="http://www.youtube.com/v/'+vidtit[z][0]+'&autoplay=1"></param><param name="wmode" 
value="transparent"></param><embed src="http://www.youtube.com/v/'+vidtit[z][0]+'&autoplay=1" 
type="application/x-shockwave-flash" allowNetworking="internal" width="640" height="388"></embed></object>';

document.getElementById("vidtit").innerHTML= vidtit[z][1];
document.title = vidtit[z][1];
}





</script>









<div id="vid">

<object  width="640" height="388">
                <param name="movie" value="http://www.youtube.com/v/2SS-TIA_epM&autoplay=1"></param> 
                <param name="wmode" value="transparent"></param>
                <embed src="http://www.youtube.com/v/2SS-TIA_epM&autoplay=1" 
type="application/x-shockwave-flash" allowNetworking="internal" width="640" height="388"></embed></object>




</div>



<div id="morevid">

Video Gallery
</div>


<div id="vidlist">
<div id="vidlist1">


<script type="text/javascript">


var i=1;
for(i=1;vidtit[i][0]!="end";i++)
{




document.write('<div id="brvid"><div id="brvidimg"><a href="#'+vidtit[i][0]+'"  onClick =" 
goadd(\''+i+'\');"><img src="http://i.ytimg.com/vi/'+vidtit[i][0]+'/default.jpg"></a></div><div 
id="brvidtit"><a a href="#'+vidtit[i][0]+'"  onClick =" goadd(\''+i+'\');">'+vidtit[i][1]+'</a></div></div>');


}





</script>



</div>
</div>




=========================
If you want to play multiple videos on your page with javascript you can use this code.Just select and copy the code and you can change the title and code in the array and you can add n umber of videos vidtit[1],vidtit[2], like that.This code is only for youtube.com.copy the whole code in notepad and save as htm or html and open in IE, firefox or google chrome and it works all you need to do is set CSS and changet he videos.