function showResponse(originalRequest)
{
eval(originalRequest.responseText);
}

function AddComment()
{
	
if (!IsEmpty(document.getElementById("AddViralComment").Comment.value))
{
var myAjax = new Ajax.Updater("ViralCommentHolder","/ajax/AddComment.php",{method: "post", asynchronous:true,parameters:Form.serialize(document.getElementById("AddViralComment")), onComplete: showResponse});
document.getElementById("AddViralComment").Comment.value = "";
}

}

function SendShareViral()
{
var alertsay	= "";

if ((document.getElementById("ShareForm").YourName) && (((IsEmpty(document.getElementById("ShareForm").YourName.value)) || (document.getElementById("ShareForm").YourName.value == "Your Name"))))
{
alertsay		+= "- Please enter your name\n";
}

if ((document.getElementById("ShareForm").YourEmail) && (((IsEmpty(document.getElementById("ShareForm").YourEmail.value)) || (document.getElementById("ShareForm").YourEmail.value == "Your Email"))))
{
alertsay		+= "- Please your email address\n";
}

else if ((document.getElementById("ShareForm").YourEmail) && (((!IsEmpty(document.getElementById("ShareForm").YourEmail.value)) || (document.getElementById("ShareForm").YourEmail.value != "Your Email"))))
{
alertsay		+= CheckEmail(document.getElementById("ShareForm").YourEmail.value);
}

if ((document.getElementById("ShareForm").FriendEmail) && (((IsEmpty(document.getElementById("ShareForm").FriendEmail.value)) || (document.getElementById("ShareForm").FriendEmail.value == "Friend Email"))))
{
alertsay		+= "- Please your email address\n";
}

else if ((document.getElementById("ShareForm").FriendEmail) && (((!IsEmpty(document.getElementById("ShareForm").FriendEmail.value)) || (document.getElementById("ShareForm").FriendEmail.value != "Friend Email"))))
{
alertsay		+= CheckEmail(document.getElementById("ShareForm").FriendEmail.value);
}

if (!alertsay)
{
var myAjax = new Ajax.Updater("ViralAction","/ajax/ShareProcess.php",{method: "post", asynchronous:true,parameters:Form.serialize(document.getElementById("ShareForm")), onComplete: showResponse});
document.getElementById("ShareForm").YourName.value = "Your Name";
document.getElementById("ShareForm").YourEmail.value = "Your Email";
document.getElementById("ShareForm").FriendEmail.value = "Friends Email";
document.getElementById("ShareForm").Message.value = "Message";
}

else
{
ShowError(alertsay);
}

return false;
}

function FilterSwitch(Position)
{
new Ajax.Request("/ajax/FilterSwitch.php?Filter=" + Position, { onSuccess: showResponse, method: "GET"});
}

function ShareViral(ViralID)
{
var myAjax 				= new Ajax.Updater("ViralAction","/ajax/ShareViral.php?ViralID=" + ViralID,{method: "GET"});


}

function AddFavourite(ViralID)
{
var myAjax = new Ajax.Updater("ViralAction","/ajax/AddFavourite.php?ViralID=" + ViralID,{method: "GET", onComplete: showResponse});
}