// JavaScript Document

// AJAX Counter
function ResumeCount(id, user_id) {
	j.Post("../_ContentManager.php?content=ResumeCount&id=" + id + "&user_id=" + user_id, null, function(data) {
		//alert(data);
	});
}

// AJAX Counter
function CoverLetterCount(id, user_id) {
	j.Post("../_ContentManager.php?content=CoverLetterCount&id=" + id + "&user_id=" + user_id, null, function(date) {
		//alert(data);
	});
}

// AJAX Viewed
function ResumeViewed(int_id, user_id) {
	j.Post("../_ContentManager.php?content=ResumeViewed&int_id=" + int_id + "&user_id=" + user_id, null, function(data) {
		//alert(data);
	});
	
	setTimeout("window.history.go(0);", "1000");
}

// AJAX Delete
function DeleteResume(id) {
	if (confirm("Are you sure you want to PERMANENTLY DELETE this resume?")) {
		j.Post("../_ContentManager.php?content=DeleteResume&id=" + id, null, function(data) {
			window.history.go(0);//alert(data);
		});
	}
}

function DeleteCoverLetter(id, user_id) {
	if (confirm("Are you sure you want to PERMANENTLY DELETE this cover letter?")) {
		j.Post("../_ContentManager.php?content=DeleteCoverLetter&id=" + id + "&user_id=" + user_id, null, function(data) {
			window.history.go(0);//alert(data);
		});
	}
}

function CheckRows(TextArea) {
	if (navigator.appName.indexOf("Microsoft Internet Explorer") == 0) {
		TextArea.style.overflow = 'visible';
	}
	
	while (TextArea.rows > 1 && TextArea.scrollHeight < TextArea.offsetHeight) {
		TextArea.rows--; 
	}
	
	while (TextArea.scrollHeight > TextArea.offsetHeight) {
		TextArea.rows++;
	}
}