
function ContactMeSend(Contributor)
{
if(Contributor && $('ContactText').value && $('ContactName').value && $('ContactEMail').value)
{
new Ajax.Request('/blog/contributor/comment',
{
method:'post',
parameters : {
'Contributor': Contributor,
'Comment': $('ContactText').value,
'Name': $('ContactName').value,
'EMail': $('ContactEMail').value,
},
onComplete:function(request){
$('cc_sent').innerHTML = 'Your message was sent. Thank you for your comments!';
$('cc_sent').appear();
['ContactText','ContactName','ContactEMail'].each(function(o){$(o).value = '';});
Effect.Shrink('contributor_contact',{'direction' : 'bottom-right', 'duration' : '0.8'});
new Effect.Highlight('cc_sent', { startcolor: '#ffff99',endcolor: '#ffffff' });
setTimeout("$('cc_sent').fade()",5000);
}
});
}
else
{
alert('Please complete all required fields: Your Name, Your E-Mail, and Your Comment');
}
}function ShareSend(Contributor)
{
if(Contributor && $('ShareName').value && $('ShareWith').value)
{
new Ajax.Request('/blog/contributor/share',
{
method:'post',
parameters : {
'Contributor': Contributor,
'ShareWith': $('ShareWith').value,
'ShareName': $('ShareName').value
},
onComplete:function(request){
$('cc_sent').innerHTML = 'Your message was sent. Thank you for sharing this blog!';
$('cc_sent').appear();
['ShareWith','ShareName'].each(function(o){$(o).value = '';});
Effect.Shrink('contributor_share',{'direction' : 'bottom-right', 'duration' : '0.8'});
new Effect.Highlight('cc_sent', { startcolor: '#ffff99',endcolor: '#ffffff' });
setTimeout("$('cc_sent').fade()",5000);
}
});
}
else
{
alert('You must enter your name and an e-mail address to share this blogger. Please try again.');
}
}function ContactShareOptions(obj)
{
if($(obj).style.display == 'none')
{
ContactShareCloseAll();
var LinkPos = $('contactoptions').positionedOffset();
var TargetPos = (LinkPos[1] - $(obj).getHeight());
$(obj).setStyle({'top' : TargetPos+'px'});
Effect.Grow(obj,{'direction' : 'bottom-left', 'duration' : '0.5'});
setTimeout("ContactShareOptionsCheckPos("+TargetPos+",'"+obj+"')",800);
}
else
{
ContactShareOptionsCancel(obj);
}
}function ContactShareOptionsCancel(obj)
{
Effect.Shrink(obj,{'direction' : 'bottom-left', 'duration' : '0.3'});
}function ContactShareOptionsCheckPos(TargetPos,obj)
{
var CurrentPos = $(obj).cumulativeOffset();
if(CurrentPos[1] < 0)
{
new Effect.Move(obj, { x: 0, y: (Math.abs(CurrentPos[1]) + 10), mode: 'relative' });
}
}function ContactShareCloseAll()
{
$$('div[rel^=contactoptions]').each(
function(obj)
{
if(obj.style.display != 'none')
{
ContactShareOptionsCancel(obj.id);
}
}
);
}