function regIsDigit(str) {
   return /^[-+]?[0-9]+$/.test(str);
}

function NavigateSoftware()
{
	$.ajax({
			type: "POST",
			url: "getsoftwarepage.php",
			success: function(data){
			var array = data.split("~");
			$("#colOne").html(array[0]).show();
			$("#colTwo").html(array[1]).show();
			$("#menuitems").html(array[2]);
			document.title = "GINtech Systems - Apps/Software";
			window.location.hash = "appsoftware";
}
});	
}

function NavigateNews()
{
	$.ajax({
			type: "POST",
			url: "getnewspage.php",
			success: function(data){
			var array = data.split("~");
			$("#colTwo").html(array[0]).show();
			$("#menuitems").html(array[1]);
			document.title = "GINtech Systems - News";
			window.location.hash = "news";
}
});	
}

function NavigateContact()
{
	$.ajax({
			type: "POST",
			url: "getcontactpage.php",
			success: function(data){
			var array = data.split("~");
			$("#colTwo").html(array[0]).show();
			$("#menuitems").html(array[1]);
			document.title = "GINtech Systems - Contact";
			window.location.hash = "contacts";
}
});	
}

function NavigateStore()
{
	$.ajax({
			type: "POST",
			url: "getstorepage.php",
			success: function(data){
			var array = data.split("~");
			$("#colTwo").html(array[0]).show();
			$("#menuitems").html(array[1]);
			document.title = "GINtech Systems - Store";
			window.location.hash = "store";
}
});	
}

function NavigateForums()
{
	$.ajax({
			type: "POST",
			url: "getforumspage.php",
			success: function(data){
			var array = data.split("~");
			$("#colTwo").html(array[0]).show();
			$("#menuitems").html(array[1]);
			document.title = "GINtech Systems - Forums";
			window.location.hash = "forums";
}
});	
}

function NavigateWindowsSoftware()
{
	$.ajax({
			type: "POST",
			url: "getwindowsoftware.php",
			success: function(data){
			var array = data.split("~");
			$("#colOne").html(array[0]).show();
			$("#colTwo").html(array[1]).show();
			$("#menuitems").html(array[2]);
			document.title = "GINtech Systems - Windows Software";
			window.location.hash = "windowsoftware";
}
});	
}

function NavigateWP7Software()
{
	$.ajax({
			type: "POST",
			url: "getwp7.php",
			success: function(data){
			var array = data.split("~");
			$("#colOne").html(array[0]).show();
			$("#colTwo").html(array[1]).show();
			$("#menuitems").html(array[2]);
			document.title = "GINtech Systems - Windows Phone Software";
			window.location.hash = "wp7software";
}
});	
}

function NavigateGNETWP7()
{
	$.ajax({
			type: "POST",
			url: "gnetwp7.php",
			success: function(data){
			var array = data.split("~");
			$("#colOne").html(array[0]).show();
			$("#colTwo").html(array[1]).show();
			$("#menuitems").html(array[2]);
			document.title = "GINtech Systems - GINternet Mobile";
			window.location.hash = "gnetwp7";
}
});	
}

function NavigateMTWP7()
{
	$.ajax({
			type: "POST",
			url: "mtwp7.php",
			success: function(data){
			var array = data.split("~");
			$("#colOne").html(array[0]).show();
			$("#colTwo").html(array[1]).show();
			$("#menuitems").html(array[2]);
			document.title = "GINtech Systems - MusicTuner Mobile";
			window.location.hash = "mtp7";
}
});	
}

var hashLocation = window.location.hash;
hashLocation = hashLocation.replace("#", "");
$(document).ready(function() {
var currenturl = document.URL;
if (currenturl.indexOf("#appsoftware") != -1)
{
	NavigateSoftware();
}
else if (currenturl.indexOf("#news") != -1)
{
	NavigateNews();
}
else if (currenturl.indexOf("#contact") != -1)
{
	NavigateContact();
}
else if (currenturl.indexOf("#store") != -1)
{
	NavigateStore();
}
else if (currenturl.indexOf("#forums") != -1)
{
	NavigateForums();
}
else if (currenturl.indexOf("#regform") != -1)
{
	toggleRegisterForm('loadingimgid7');
}
else if (currenturl.indexOf("#forgotpass") != -1)
{
	toggleLostPass('loadingimgid8');
}
else if (currenturl.indexOf("#ginternet") != -1)
{
	toggleGINternetNoLoad();
}
else if (currenturl.indexOf("#musictuner") != -1)
{
	toggleMusicTunerNoLoad();
}
else if (currenturl.indexOf("#comprepair") != -1)
{
	toggleCompRepairNoLoad();
}
else if (currenturl.indexOf("#gnetwp7") != -1)
{
	NavigateGNETWP7();
}
else if (currenturl.indexOf("#mtwp7") != -1)
{
	NavigateMTWP7();
}
else if (regIsDigit(hashLocation))
{
    $.ajax({
			type: "POST",
			url: "getshowprofile.php?id="+hashLocation,
			data: "request=GetUserProf",
			success: function(data){
			$("#colTwo").html(data).show();
			document.title = "GINtech Systems - User Profile";
}
});	
}
});
