$(document).ready(function()
{
	$('#randomjob').children().css("backgroundColor", "black");
});

function _jobs(id, folder, prefix)
{
	var job = 'jobs/' + folder + "/" + prefix + 'job_' + id + '.html';
	$("#popup").jqm({ajax:job, overlay:0}).jqmShow();
}

function changepage(page, folder, container, prefix)
{		
	var job = "jobs" + folder + prefix + "jobs_" + page + ".html";
	$.ajax({
		url: job,
		cache: false,
		success: function(html) 
		{	
			$(container).html(html);
		}		
	});
}

function loadTempJobs()
{
	
	$.ajax({url: "jobs/temp/jobs_1.html", cache: false, success: function(html){$("#tempjobs").html(html);}});	
	$.ajax({url: "jobs/temp/pages.html", cache: false, success: function(html){$("#temppages").html(html);}});	
}

function loadTempLegalJobs()
{
	$.ajax({url: "jobs/temp/legal_jobs_1.html", cache: false, success: function(html){$("#templegal").html(html);}});	
	$.ajax({url: "jobs/temp/legal_pages.html", cache: false, success: function(html){$("#templegalpages").html(html);}});	
}

function loadPermJobs()
{
	$.ajax({url: "jobs/perm/jobs_1.html", cache: false, success: function(html){$("#permjobs").html(html);}});	
	$.ajax({url: "jobs/perm/pages.html", cache: false, success: function(html){$("#permpages").html(html);}});	
}

function loadPermLegalJobs()
{
	$.ajax({url: "jobs/perm/legal_jobs_1.html", cache: false, success: function(html){$("#permlegal").html(html);}});	
	$.ajax({url: "jobs/perm/legal_pages.html", cache: false, success: function(html){$("#permlegalpages").html(html);}});	
}

function hideme()
{
	$('#popup').jqmHide();
}

function randomjob()
{
		document.getElementById("randomjob").innerHTML = "";

		  try{
				xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }

		  catch(e){

				xmlhttp=new XMLHttpRequest();

		  }		  
		  
		xmlhttp.onreadystatechange=function()
		  {
		  if (xmlhttp.readyState==4 && xmlhttp.status==200)
			{
			document.getElementById("randomjob").innerHTML=xmlhttp.responseText;
			}
		  }
		xmlhttp.open("GET","jobs/random_job.html",true);
		xmlhttp.send();
}

function loadrandomjob()
{
	//$("#popup").jqm({ajax:"jobs/random_job_details.html", overlay:0}).jqmShow();
	  try{
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }

	  catch(e){

			xmlhttp=new XMLHttpRequest();

	  }		  
	  
	xmlhttp.onreadystatechange=function()
	  {
	  if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
			$("#popup").html(xmlhttp.responseText);
			$("#popup").jqm().jqmShow();
		}
	  }
	xmlhttp.open("GET","jobs/random_job_details.html",true);
	xmlhttp.send();
	
	
}

function randomlegaljob()
{
		document.getElementById("randomjob").innerHTML = "";

		  try{
				xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }

		  catch(e){

				xmlhttp=new XMLHttpRequest();

		  }		  
		  
		xmlhttp.onreadystatechange=function()
		  {
		  if (xmlhttp.readyState==4 && xmlhttp.status==200)
			{
			document.getElementById("randomjob").innerHTML=xmlhttp.responseText;
			}
		  }
		xmlhttp.open("GET","jobs/random_legal_job.html",true);
		xmlhttp.send();
}

function loadrandomlegaljob()
{
	//$("#popup").jqm({ajax:"jobs/random_job_details.html", overlay:0}).jqmShow();
	  try{
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }

	  catch(e){

			xmlhttp=new XMLHttpRequest();

	  }		  
	  
	xmlhttp.onreadystatechange=function()
	  {
	  if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
			$("#popup").html(xmlhttp.responseText);
			$("#popup").jqm().jqmShow();
		}
	  }
	xmlhttp.open("GET","jobs/random_legal_job_details.html",true);
	xmlhttp.send();
	
	
}
