
var reqPageUrl = new Array();			
reqPageUrl[1] = "welcome.htm";
reqPageUrl[2] = "welcome.htm";
reqPageUrl[3] = "experience.htm";
reqPageUrl[4] = "skills.htm";
reqPageUrl[5] = "cv.htm";	

var reqPageUrl2 = new Array();
reqPageUrl2[6] = "websites.htm";
reqPageUrl2[7] = "newsletters.htm";
reqPageUrl2[8] = "3d.htm";
reqPageUrl2[9] = "other.htm";


function loadTab(id)
{
	if (reqPageUrl[id].length > 0)
	{
		$("#preloader").show();
		$.ajax(
		{
			url: reqPageUrl[id], 
			cache: false,
			error: function(XMLHttpRequest, textStatus, errorThrown)
			{
				$('#tabmenu a').removeClass('active'); //remove all class='active' for all anchors
				$("#content_tab"+id).toggleClass('active'); //add class to the current one
				$("#content").empty().append('<img src=\"images/error_caution.gif\" /> Error in Loading page, please do check with the path');//if there is any error in the request
				$("#preloader").hide();//hide the preloader
			},
			success: function(message) 
			{
				$('#tabmenu a').removeClass('active'); //remove all class='active' for all anchors
				$("#content_tab"+id).toggleClass('active'); //add class to the current one
				$("#content").empty().append(message);//first empty the content, then append content
				$("#preloader").hide();//hide the preloader
			}
			
		});			        
	}
}




function loadTabMob(id)
{
	if (reqPageUrl2[id].length > 0)
	{
		$("#preloader02").show();
		$.ajax(
		{
			url: reqPageUrl2[id], 
			cache: false,
			error: function(XMLHttpRequest, textStatus, errorThrown)
			{
				$('#tabmenu02 a').removeClass('active'); //remove all class='active' for all anchors
				$("#content_tab"+id).toggleClass('active'); //add class to the current one
				$("#contentTwo").empty().append('<img src=\"images/error_caution.gif\" /> Error in Loading page, please do check with the path');//if there is any error in the request
				$("#preloader02").hide();//hide the preloader
			},
			success: function(message) 
			{
				$('#tabmenu02 a').removeClass('active'); //remove all class='active' for all anchors
				$("#content_tab"+id).toggleClass('active'); //add class to the current one
				$("#contentTwo").empty().append(message);//first empty the content, then append content
				$("#preloader02").hide();//hide the preloader
		
			}
			
		});			        
	}
}


$(document).ready(function()
{
	loadTab(1); //After page loading, active tab 1

	$("#preloader").hide();
	$("#content_tab1").click(function(e){e.preventDefault(); loadTab(1);}); //Here e.preventDefault(); is to prevent the respective href from going the user off the link, that is the href url '#' which is appending to the URL will going off 
	$("#content_tab2").click(function(e){e.preventDefault(); loadTab(2);});
	$("#content_tab3").click(function(e){e.preventDefault(); loadTab(3);});
	$("#content_tab4").click(function(e){e.preventDefault(); loadTab(4);});
	$("#content_tab5").click(function(e){e.preventDefault(); loadTab(5);});

});

$(document).ready(function()
{
	loadTabMob(6); //After page loading, active tab 1

	$("#preloader02").hide();
	$("#content_tab6").click(function(e){e.preventDefault(); loadTabMob(6);});
	$("#content_tab7").click(function(e){e.preventDefault(); loadTabMob(7);});
	$("#content_tab8").click(function(e){e.preventDefault(); loadTabMob(8);});
	$("#content_tab9").click(function(e){e.preventDefault(); loadTabMob(9);});

});

