// JavaScript Document
function open_tech_details(tech_id)
{
	//document.tech_ticket.tech_id.value = "<? echo $tech_id; ?>";
	//alert(document.tech_ticket.tech_id.value);
	document.forms[0].action = "tech_registration.php";
	document.forms[0].submit();	
}
function open_ticket_details(ticket_id)
{
	//if(approved != 'Approved')
	//{
		document.forms[0].ticket_id.value = ticket_id;
		document.forms[0].action = "tech_ticket.php";
		document.forms[0].submit();		
	/*}
	else
	{
		alert("Your requested service has been approved. You cant Edit");
		return false;
	}*/
}
function edit_profile()
{
		document.forms[0].action = "tech_registration.php";
		document.forms[0].submit();			
}
function open_tech_service_history()
{
		document.forms[0].action = "tech_service_history.php";
		document.forms[0].submit();			
}
function refer_tech()
{
		document.forms[0].action = "tech_refer.php";
		document.forms[0].submit();			
}
function search_tech_ticket()
{
	var tech_id = document.forms[0].tech_id.value;
	var search_ticket = document.forms[0].search.value;
	if(search_ticket == '' || search_ticket == 'Search')
	{
		alert("Kindly Enter a Ticket Number !");	
		document.forms[0].search.focus();
		return false;
	}else{
		var response = $.ajax({
							type	:	"POST",
							url		:	"process_ajax.php",
							data	:	{type:"search_tech_ticket",ticket_id:search_ticket,tech_id:tech_id},
							async	:	false
						}).responseText;
		alert(response);
	}
	
}
function tech_faqs()
{
		document.forms[0].action = "tech_faq.php";
		document.forms[0].submit();		
}
function tech_refers()
{
		document.forms[0].action = "tech_refer.php";
		document.forms[0].submit();		
}
function remove_file(field,ticket_id,tech_id,document_name)
{
	//alert(field+'--'+ticket_id+'--'+tech_id+'--'+document_name);
	//return false;
	var response = $.ajax({
						  type	:	"POST",
						  url	:	"process_ajax.php",
						  data	:	{type:"remove_tech_document",document_field:field,ticket_id:ticket_id,tech_id:tech_id,document_name:document_name},
						  async	:	false
						  }).responseText;
	if(response == 'sucess')
	{
		window.location.reload(true);
		/*var divId = "doc_1";
		$("#"+divId).fadeTo("slow",0.33);
		$("#"+divId).hide("slow");
		showUpload(divId);
		$("#"+divId).show("slow");*/
		
	}
	else
	{
		alert(response);	
	}
}
function email_notify()
{
		document.forms[0].action = "tech_email_inbox.php";
		document.forms[0].submit();
}
function search_tech_technician()
{
	document.forms[0].action = "search_technician.php";
	document.forms[0].submit();	
}
function tech_email_notifi()
{
	//alert('g');
	document.forms[0].action = "tech_email_notify.php";
	document.forms[0].submit();	
}
