function embedMediaPrompt(media_id, media_type)
{
new Ajax.Request('/ajax/gadgets.php?action=get_media_info&media_id='+media_id+'&media_type='+media_type, {
asynchronous: true,
onSuccess: function(transport)
{
if(transport.responseText.isJSON())
{
var data = transport.responseText.evalJSON();
if(data['status']==1)
{
var media_id = data['media_id'];
var media_type = data['media_type'];
var media_title = data['media_title'];
var artist_id = data['artist_id'];
var artist_name = data['artist_name'];
var object_tag = '';
var remote_url_encoded = URLEncode("http://www.famecast.com/backstage/artist_id="+artist_id+"&"+(media_type==1?"audio_id":"video_id")+"="+media_id);
var remote_title_encoded = URLEncode("FameCast.com - Artist: "+artist_name+" - "+(media_type==1?'Audio':'Video')+": "+media_title);
var window_title = "Embed this "+(media_type==2 ? 'Video' : 'Audio')+"";
var contents = "
\
You have chosen to Embed this "+(media_type==1?'Audio track':'Video')+" on an external site: \
Artist: "+artist_name+" \
"+(media_type==2 ? 'Video' : 'Audio')+": "+media_title+"
\
\
\
Embed:
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
";
var window_id = 'gadget_window';
var win = Windows.getWindow(window_id);
if(win && win.close)
{
win.close();
}
win = new Window({id: window_id, className: "famecast", width:302, height:150, zIndex: 1001, resizable: false, title: window_title, showEffect: Element.show, hideEffect: Element.hide, draggable:true, wiredDrag: false, minimizable: false, maximizable: false, destroyOnClose: true, recenterAuto: false, onClose: function(){ } }) ;
win.getContent().innerHTML = contents;
win.showCenter(true);
}
}
}
});
}
function shareMediaPrompt(media_id, media_type)
{
new Ajax.Request('/ajax/gadgets.php?action=get_media_info&media_id='+media_id+'&media_type='+media_type, {
asynchronous: true,
onSuccess: function(transport)
{
if(transport.responseText.isJSON())
{
var data = transport.responseText.evalJSON();
if(data['status']==1)
{
var media_id = data['media_id'];
var media_type = data['media_type'];
var media_title = data['media_title'];
var artist_id = data['artist_id'];
var artist_name = data['artist_name'];
var window_title = "Share this "+(media_type==2 ? 'Video' : 'Audio')+"";
var contents = "
You have chosen to Share this "+(media_type==1?'Audio track':'Video')+" by E-mail: Artist: "+artist_name+" "+(media_type==2 ? 'Video' : 'Audio')+": "+media_title+"
";
contents += '
';
var window_id = 'gadget_window';
var win = Windows.getWindow(window_id);
if(win && win.close)
{
win.close();
//if(win.destroy) win.destroy();
}
win = new Window({id: window_id, className: "famecast", width:332, height:282, zIndex: 1001, resizable: false, title: window_title, showEffect: Element.show, hideEffect: Element.hide, draggable:true, wiredDrag: false, minimizable: false, maximizable: false, destroyOnClose: true, recenterAuto: false, onClose: function(){ } }) ;
win.getContent().innerHTML = contents;
win.showCenter(true);
}
}
}
});
}
function ValidateEmail()
{
var to_emails = document.getElementById('to_emails').value;
if(to_emails=="" || to_emails.length < 6 || to_emails.indexOf('@')==-1) {
alert('You must supply at least one valid To E-mail address.');
}
else
{
var from_email = document.getElementById('from_email').value;
if(from_email=="" || from_email.length < 6 || from_email.indexOf('@')==-1 || from_email.indexOf('@')!=from_email.lastIndexOf('@')) {
alert('You must supply a valid From E-mail address.');
}
else
{
if(document.getElementById('subject').value=="") {
alert('You must supply a valid E-mail Subject.');
}
else
{
if(document.getElementById('body').value=="") {
alert('You must supply a valid E-mail Body.');
}
else
{
return true;
}
}
}
}
return false;
}
function flagMediaPrompt(media_id, media_type, show_wrong_stage)
{
new Ajax.Request('/ajax/gadgets.php?action=get_media_info&media_id='+media_id+'&media_type='+media_type+'&flag=1', {
asynchronous: true,
onSuccess: function(transport)
{
if(transport.responseText.isJSON())
{
var data = transport.responseText.evalJSON();
if(data['status']==1 || data['status']==2 || data['status']==-1)
{
var media_id = data['media_id'];
var media_type = data['media_type'];
var media_title = data['media_title'];
var artist_id = data['artist_id'];
var artist_name = data['artist_name'];
var fk = data['fk'];
var window_title = "Flag this "+(media_type==2 ? 'Video' : 'Audio')+"";
var contents = "