function SelectAll()
{
var my = (this.document.form1.length) - 4;
document.form1.text1.value = "";
for(i=0;i<my;i++)
{
var boxname=this.document.form1.elements[i].name;
this.document.form1.elements[i].checked="true";
if(this.document.form1.text1.value == "")
{
this.document.form1.text1.value = boxname;
}
else
{
this.document.form1.text1.value = this.document.form1.text1.value + "," + boxname;
}
}
}


function addTitle(f)
{
if(f.checked)
{
if(this.document.form1.text1.value == "")
{
this.document.form1.text1.value = f.name;
}
else
{
this.document.form1.text1.value = this.document.form1.text1.value + "," + f.name;
}
}
else
{		
var mysongs=this.document.form1.text1.value;
var mysong=mysongs.split(",");
var mysonglen=mysong.length;
this.document.form1.text1.value="";
var repname=f.name;
for(i=0;i<mysonglen;i++)
{
if(repname == mysong[i])
continue;
if(this.document.form1.text1.value == "")
{
this.document.form1.text1.value = mysong[i];
}
else
{
this.document.form1.text1.value = this.document.form1.text1.value + "," + mysong[i];
}
}
}
}


function Go4Song()  
{
popUpCenteredWindow("music/samargeete.php?text1="+document.form1.text1.value);  
}


function popUpCenteredWindow(redirection_url)  
{

	var iMyWidth; 
	var iMyHeight; 
	//gets top and left positions based on user's resolution so hint window is centered.

	iMyWidth = (window.screen.width/2) - (122 + 10); 
	//half the screen width minus half the new window width (plus 5 pixel borders).

	iMyHeight = (window.screen.height/2) - (27 + 50); 
	//half the screen height minus half the new window height (plus title and status bars).

	var win2 = window.open(redirection_url,"WindowNor","status,height=400,width=800,resizable=yes,left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",scrollbars=yes");
	win2.focus(); 

} 

