function deadLink(url)
{
	window.open(url, '', 'width=310,height=125,left=100,top=100,status=0,scrollbars=0,resizable=0,menubar=0,location=0,toolbar=0')
}

function redirect(form)
{
	location = form.select.options[form.select.selectedIndex].value;
}
function bookmarksite(title, url)
{
	if (document.all) {
		window.external.AddFavorite(url, title);
	}
	else if (window.sidebar) {
		window.sidebar.addPanel(title, url, '');
	}
}

/*function post_comment() {
	var comment = $('#comment-comment').val();
	var video_id = $('#comment-video-id').val();
	
	// Clear comment
	$('#comment-comment').val('');
	
	// Note: No '?' at the beginning
	return 'comment=' + escape(comment) + '&video_id=' + escape(video_id);
}*/

function update_page(data) {
	$('#comment-post-result').html(data);
}
function add_favorite(movie_id) {
     $.post("/includes/js_calls.php", {'call[]' : ["add_favorite", movie_id]}, function(data){
     if(data == "1") {alert("You have already added this movie to your favorites!");}
	 else if(data == "2") {alert("You need to be logged in to perform this action!"); }
	 else if(data == "3") { alert("Added to your favorites, please view your profile to see it."); }
    });
}

function remove_favorite(movie_id) {
     $.post("/includes/js_calls.php", {'call[]' : ["remove_favorite", movie_id]}, function(data){
     if(data == "1") {alert("You don\'t have this movie in your favorites!");}
	 else if(data == "2") {alert("You need to be logged in to perform this action!"); }
	 else if(data == "3") { alert("Movie removed from your favorites."); }
	 location.reload();
    });
}
function slidead() {
$('#slidead').show("slide", { direction: "left" }, 1000);
}
function unslidead() {
$('#slidead').hide("slide", { direction: "left" }, 2000);
}

function begin_ad() {
var code ="<div id=\"sidead-box\">";
    code += "<iframe src=\"http://www.wtso.net/siframead.html\" scrolling=\"no\" frameborder=\"0\" width=\"300\" height=\"250\"></iframe>";
    code += "</div>";
	code += "<div id=\"slidead-close\">";
	code += "<a href=\"#\" onclick=\"javascript:unslidead();\"><img src=\"http://www.wtso.net/templates/v4/x.png\" alt=\"Close\" title=\"Close\" /></a>";
	code += "</div>";
    document.getElementById("slidead").innerHTML = code;
 slidead();
}
