<!--









document.write('<style TYPE="text/css">')

document.write('<!--')

document.write('A:link, A:visited { text-decoration: none }')

document.write('A:hover { text-decoration: underline; color:red }')

document.write('-->')

document.write('</style>')







function randomsongs() {

var upper_limit = 730

var songs=""

for (i=1; i<=50; i=i+1)

   {      

var ran = Math.round(upper_limit * Math.random()); 

songs= songs + "," + ran



	}



liststr1="/page/player.cgi?"+songs;

 window.open(liststr1,'Jukebox','width=470,height=320,resizeable=yes,scrollbars=no,status=no');



}









 function SelectAll2(frml) { 

thisFrml = eval("document."+frml)

  for (var i=0;i<thisFrml.elements.length;i++) 



    { 



    var flds = thisFrml.elements[i]; 



    if (flds.name != 'checkAll') 



      flds.checked = thisFrml.checkAll.checked; 



    } 



  } 













function SelectAll(frm) {

thisFrm = eval("document."+frm)

  for (var i=0;i<thisFrm.elements.length;i++) 

    { 

    var flds = thisFrm.elements[i]; 

    if ((flds.name != 'loop') || (flds.name !='random')) 

      flds.checked = 1;//document.forms[0].checkAll.checked; 

    } 

  } 



function InvertSelect(frm) { 

thisFrm = eval("document."+frm)

  for (var i=0;i<thisFrm.elements.length;i++) 

    { 

    var flds = thisFrm.elements[i]; 

    if ((flds.name != 'loop') || (flds.name !='random')) {

	

      if (flds.checked == 1){

      flds.checked = 0

      } else {

      flds.checked = 1

      }

    }





    } 

  } 



c = 0;

songlist = new Array;

function getList(frm) {



	theForm = eval("this.document."+frm)

        for (var i=0;i<theForm.elements.length;i++) {

                if (theForm.elements[i].name == 'pick') {

                        if (theForm.elements[i].checked) {

                         songlist[c] = theForm.elements[i].value;

                         c++;

                        }

                }

        }

	if (c <1){

	checkList(frm);

	}

	else{

	setList(frm);

	}

}



function checkList(frm){



	//document.forms[0].checkAll.checked = 1;

	SelectAll(frm);

	getList(frm);

}





function setList(frm){

	

         sel = songlist[0];

         for (var j=1;j<c;j++) {

		sel += ","+songlist[j];

         }

         liststr = "/page/player.cgi?"+sel;



sel="";

c=0;



        window.open (liststr,'Jukebox','width=470,height=320,resizeable=yes,scrollbars=no,status=no');



        //return false;

}



function setList1(x,frm){

	





	liststr1="/page/player.cgi?"+x;



        window.open (liststr1,'Jukebox','width=470,height=320,resizeable=yes,scrollbars=no,status=no');

        //return false;



}











function getList2(frm) {



	theForm = eval("this.document."+frm)

        for (var i=0;i<theForm.elements.length;i++) {

                if (theForm.elements[i].name == 'pick') {

                        if (theForm.elements[i].checked) {

                         songlist[c] = theForm.elements[i].value;

                         c++;

                        }

                }

        }

	if (c <1){



	alert("You haven't select song to add ");



	}

	else{

	setList2(frm);

	}

}







function setList2(frm){


         sel = songlist[0];

         for (var j=1;j<c;j++) {

		sel += ","+songlist[j];

         }

         liststr = "/mysongs/favorites.cgi?"+sel;



sel="";

c=0;



        window.open (liststr,'fav','width=400,height=320,resizeable=yes,scrollbars=no,status=no');



        //return false;

}





function checkList2(frm){



	//document.forms[0].checkAll.checked = 1;

	SelectAll(frm);

	getList2(frm);

}







function mailasong2(frm){

	

         sel = songlist[0];

         for (var j=1;j<c;j++) {

		sel += ","+songlist[j];

         }

         

liststr = "/page/mailasong.cgi?action=add&new="+sel;





sel="";

c=0;



        window.open (liststr,'mail','width=300,height=450,resizeable=yes,scrollbars=yes,status=no');



        //return false;

}







function vote(id){

liststr = "/page/tspvote.cgi?"+id;
window.open (liststr,'mail','width=300,height=300,resizeable=yes,scrollbars=yes,status=no');

//return false;

}








function mailasong(frm) {



	theForm = eval("this.document."+frm)

        for (var i=0;i<theForm.elements.length;i++) {

                if (theForm.elements[i].name == 'pick') {

                        if (theForm.elements[i].checked) {

                         songlist[c] = theForm.elements[i].value;

                         c++;

                        }

                }

        }

	if (c <1){



	alert("You haven't select song to Mail ");



	}

	else{

	mailasong2(frm);

	}

}




function templist(frm) {



	theForm = eval("this.document."+frm)

        for (var i=0;i<theForm.elements.length;i++) {

                if (theForm.elements[i].name == 'pick') {

                        if (theForm.elements[i].checked) {

                         songlist[c] = theForm.elements[i].value;

                         c++;

                        }

                }

        }

	if (c <1){



	alert("You haven't select song to Mail ");



	}

	else{

	templist2(frm);

	}

}

function templist2(frm){

	

         sel = songlist[0];

         for (var j=1;j<c;j++) {

		sel += ","+songlist[j];

         }

         

liststr = "/page/myselections.cgi?action=add&new="+sel;





sel="";

c=0;



        window.open (liststr,'mail','width=300,height=450,resizeable=yes,scrollbars=yes,status=no');



        //return false;

}



function SetCookie(name, value) {
var never = new Date()
never.setTime(never.getTime() + 60*60*1000);

 var expString = "; expires=" + never.toGMTString();
  document.cookie = name + "=" + escape(value) + expString;
  }




function getCookie(Name) {
   var search = Name + "="
   if (document.cookie.length > 0) { // if there are any cookies
      offset = document.cookie.indexOf(search) 
      if (offset != -1) { // if cookie exists 
         offset += search.length 
         // set index of beginning of value
         end = document.cookie.indexOf(";", offset) 
         // set index of end of cookie value
         if (end == -1) 
            end = document.cookie.length
         return unescape(document.cookie.substring(offset, end))
      } 
   }
}





//-->





















