function viewprofile()
{
	var status = "";
	if (window.XMLHttpRequest)
  	{// code for IE7+, Firefox, Chrome, Opera, Safari
  	xmlhttp=new XMLHttpRequest();
  	}
	else
  	{// code for IE6, IE5
  	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  	}
	xmlhttp.onreadystatechange=function()
  	{
  	if (xmlhttp.readyState==4 && xmlhttp.status==200)
    	{
    	
	var responseText = xmlhttp.responseText;
	if (responseText != "")
	  { 
		var Status = responseText;
		var currurl = window.location.href;
		var currdir = currurl.substring(0,currurl.lastIndexOf("/"));
		var ViewProfileurl = currdir + "/playerprofile/profileindex.php";
		var sampleProfileurl = currdir + "/samplebaseball/index.html";

		if (Status == "None")
		{
			alert("To view a Sample Profile, please Register and Login.");
		}else
		if (Status == "Registered")
		{
			window.location.replace(sampleProfileurl);
		}else
		if (Status == "Active")
		{
			window.location.replace(ViewProfileurl);
		}
		
	  }

    	}
  	}
	xmlhttp.open("GET", "php/RegStatus.php"); //make connection
	xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=iso-8859-1"); // set Header
	xmlhttp.send(null); //send value


}
function editprofile()
{
	var status = "";
	if (window.XMLHttpRequest)
  	{// code for IE7+, Firefox, Chrome, Opera, Safari
  	xmlhttp=new XMLHttpRequest();
  	}
	else
  	{// code for IE6, IE5
  	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  	}
	xmlhttp.onreadystatechange=function()
  	{
  	if (xmlhttp.readyState==4 && xmlhttp.status==200)
    	{
    	
	var responseText = xmlhttp.responseText;
	if (responseText != "")
	  { 
		var Status = responseText;
		var currurl = window.location.href;
		var currdir = currurl.substring(0,currurl.lastIndexOf("/"));
		var editProfileurl = currdir + "/userprofile1.php";

		if (Status == "None")
		{
			alert("To edit your FREE Profile, please Register or Sign In.");
		}else
		if (Status == "Registered")
		{
			window.location.replace(editProfileurl);
		}else
		if (Status == "Active")
		{
			window.location.replace(editProfileurl);
		}
		
	  }


    	}
  	}
	xmlhttp.open("GET", "php/RegStatus.php"); //make connection
	xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=iso-8859-1"); // set Header
	xmlhttp.send(null); //send value


}
function uploadprofile()
{
	var status = "";
	if (window.XMLHttpRequest)
  	{// code for IE7+, Firefox, Chrome, Opera, Safari
  	xmlhttp=new XMLHttpRequest();
  	}
	else
  	{// code for IE6, IE5
  	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  	}
	xmlhttp.onreadystatechange=function()
  	{
  	if (xmlhttp.readyState==4 && xmlhttp.status==200)
    	{
    	
	var responseText = xmlhttp.responseText;
	if (responseText != "")
	  { 
		var Status = responseText;
		var currurl = window.location.href;
		var currdir = currurl.substring(0,currurl.lastIndexOf("/"));
		var editProfileurl = currdir + "/userprofile1.php";

		if (Status == "None")
		{
			alert("To upload your FREE profile, please Register or Sign In .");
		}else
		if (Status == "Registered")
		{
			window.location.replace(editProfileurl);
		}else
		if (Status == "Active")
		{
			window.location.replace(editProfileurl);
		}
		
	  }


    	}
  	}
	xmlhttp.open("GET", "php/RegStatus.php"); //make connection
	xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=iso-8859-1"); // set Header
	xmlhttp.send(null); //send value


}
function gobackpack()
{
	if (window.XMLHttpRequest)
  	{// code for IE7+, Firefox, Chrome, Opera, Safari
  	xmlhttp=new XMLHttpRequest();
  	}
	else
  	{// code for IE6, IE5
  	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  	}
	xmlhttp.onreadystatechange=function()
  	{
  	if (xmlhttp.readyState==4 && xmlhttp.status==200)
    	{
    	
	var responseText = xmlhttp.responseText;
	if (responseText != "")
	  { 
		var Status = responseText;
		var currurl = window.location.href;
		var currdir = currurl.substring(0,currurl.lastIndexOf("/"));
		var backpackurl = currdir + "/MyBackpack.html";

		if (Status == "None")
		{
			alert("To view your Backpack contents, please Register or Sign In.");
		}else
		if (Status == "Registered")
		{
			window.location.replace(backpackurl);
		}else
		if (Status == "Active")
		{
			window.location.replace(backpackurl);
		}
		
	  }


    	}
  	}
	xmlhttp.open("GET", "php/RegStatus.php"); //make connection
	xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=iso-8859-1"); // set Header
	xmlhttp.send(null); //send value


}
document.write("<div class=\"subnav\">");
document.write("<h2 style=\"color:red;\">Get Started Today</h2>");
document.write("<ul>");
document.write("<li><a href=\"index.html\">Home</a></li>");
document.write("<li><a href=\"resource.html\">Resource Library</a></li>");

document.write("<li><a href=\"search.php\">College Search</a></li>");

document.write("<li><a href=\"javascript:gobackpack();\">Backpack</a></li>");
document.write("<li><a href=\"javascript:uploadprofile();\">Upload Profile</a>");
document.write("<li><a href=\"javascript:editprofile();\">Edit Profile</a></li>");
document.write("<li><a href=\"javascript:viewprofile();\">View Profile</a></li>");
document.write("</ul>");
document.write("</div>");


