function report(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=yes,location=0,statusbar=0,menubar=0,resizable=yes,width=450,height=300,left = 100,top = 50');");
}

function reportPopup(ID, vid)
{
this.id=ID
this.vid=vid
window.open(''+MELODYURL+'/report.php?vid='+this.vid+'&do='+this.id, 'report','toolbar=0,scrollbars=yes,location=0,statusbar=0,menubar=0,resizable=yes,width=450,height=300,left=100,top=50');
}
function sharePopup(vid)
{
this.vid=vid
window.open(''+MELODYURL+'/share.php?vid='+this.vid, 'share','toolbar=0,scrollbars=no,location=0,statusbar=0,menubar=0,resizable=no,width=450,height=300,left=100,top=50');
}
function makeFavorite(vid)
{
this.vid=vid
window.open(''+MELODYURL+'/favorites.php?a=add&vid='+this.vid, 'share','toolbar=0,scrollbars=no,location=0,statusbar=0,menubar=0,resizable=no,width=450,height=150,left=100,top=50');
}

function addmyspacePopup(vid)
{
this.vid=vid
window.open(''+MELODYURL+'/share_code.php?vid='+this.vid+'&social=myspace', 'share','toolbar=0,scrollbars=no,location=0,statusbar=0,menubar=0,resizable=no,width=450,height=300,left=100,top=50');
}

function textLimit(field, maxlen) {
if (field.value.length > maxlen + 1)
alert('Your comment is too long!');
if (field.value.length > maxlen)
field.value = field.value.substring(0, maxlen);
} 
function SelectAll(id)
{
    document.getElementById(id).focus();
    document.getElementById(id).select();
}
