function nonsignsearch()
{
	document.formmain.action="lcjsadvancesearch.php";
	document.formmain.submit();
}
function nonsignarchivesearch()
{
	document.formmain.action="lclawcrossarchive.php";
	document.formmain.submit();
}
function showjobdetail(jobid,temp,jobtype)
{
	for (var i=0;i<document.formmain.elements.length;i++)
		if (document.formmain.elements[i].name=="clsapply_jobid[]")
			document.formmain.elements[i].value=jobid;
	document.formmain.clsjobalert_recordno.value=temp;
	
	// Changes made on 05-05-05 by Sachin. Due to show some banner to only Attorney Job.
	document.formmain.clsjobalert_firmdtljobtype.value=jobtype;
	document.formmain.action="lcjsjobdetail.php";
	document.formmain.submit();
}
//Added By VM 5/5/05
function clearall()
{	
	for(i = 0; i < document.formmain2.elements.length; i++)
	{
		if(document.formmain2.elements[i].name=="clsapply_jobid[]" && document.formmain2.elements[i].type== "checkbox")
			document.formmain2.elements[i].checked=false;
	}
}
function addhotlist()
{
	var chkdelstatus = chkboxvalidation();
	if(chkdelstatus)
	{			
		window.open('','AddToHostList','height=1,width=1,left=75,top=75,scrollbars=yes,resizable=no,menubar=no');
		document.formmain2.action = "lcaddtohotlist.php";
		document.formmain2.target = "AddToHostList";
		document.formmain2.clsapply_hdnaction.value = "S";
		document.formmain2.submit();		
	}else{
		alert("Please select atleast one Job");
	}
}
//End Vinesh
function showarchivejobdetail(jobid, temp)
{
	for (var i=0;i<document.formmain.elements.length;i++)
		if (document.formmain.elements[i].name=="clsapply_jobid[]")
			document.formmain.elements[i].value=jobid;
	document.formmain.clsjobalert_recordno.value=temp;
	document.formmain.action="lcjsarchivejobdetail.php";
	document.formmain.submit();
}

function sortby(title,oldtitle)
{
	if(document.formmain.clsjobalert_sortby.value == title)
	{
		if(document.formmain.clsjobalert_sortasc.value == 'A')
			document.formmain.clsjobalert_sortasc.value = 'D';
		else
			document.formmain.clsjobalert_sortasc.value = 'A';
	}
	if(oldtitle!=title)
	document.formmain.clsjobalert_sortasc.value = 'A';
	document.formmain.clsjobalert_sortby.value=title;
	document.formmain.clsjobalert_currentpage.value=1;
	document.formmain.submit();
}

function searchjobs()
{	
	document.formmain.clsjobalert_refinesearch.value = 1;	
	document.formmain.submit();
}

function savesearchjobs()
{
	document.getElementById("clsjobalert_hdnaction").value='SaveJobAlert';
	document.formmain.submit();
	
}

function saveexcludefirm(firmid)
{
	document.getElementById("clsexcludefirm_firmid").value= firmid;
	document.getElementById("clsjobalert_hdnaction").value='AddExcludeFirm';
	document.formmain.submit();
}

function gotopageno()
{	
	document.formmain.clsjobalert_currentpage.value=document.formmain.clsjobalert_searchpageno.value;
	return true;
//	document.formmain.submit();
}

function gotopageno_bottom()
{	
	navigatepage(document.formmain.clsjobalert_searchpageno1.value);
	return true;
}


function viewjobdetail()
{	
	var chkdelstatus = chkboxvalidation();
	if(chkdelstatus)
	{			
		document.formmain2.action = "lcjsjobdetail.php";
		document.formmain2.submit();
	}
	else
	{
		alert("Please select atleast one Job.");
	}
}
function navigatepage(pageno)
{
	document.formmain.clsjobalert_currentpage.value=pageno;
	document.formmain.submit();
	return;
}
function displayrecordsperpage()
{
	document.formmain.submit();
	return;
}

function chkboxvalidation()
{
	for(i=0; i<document.formmain2.elements.length; i++)
	{
		if(document.formmain2.elements[i].name=="clsapply_jobid[]")
		{
			if(document.formmain2.elements[i].checked==true)
			{
				var confdel=true;
				break;
			}
		}
	}
	return confdel;
}
function loststring()
{
	document.formmain.clsjobalert_keywords.value="";
}

function speedapply()
{
	var applycheck=false;
	for(i=0; i<document.formmain.elements.length; i++)
	{
		if(document.formmain.elements[i].name=="clsspeedapply_applyid[]")
		{
			if(document.formmain.elements[i].checked==true)
			{
				applycheck=true;
				break;
			}
		}
	}
	if(applycheck==false)
	{
		alert("Please select atleast one job for speed apply");
	}
	else
	{
		document.formmain.action = "lcjsspeedapply.php";
		document.formmain.submit();
	}
}

function speedapplypopup()
{
	window.open('<? echo constant("HTTP"); ?>lcspeedapplypopup.php','speedapply_whatsthis','resizable=no,toolbar=no,menubar=no,width=616,height=500');
}



// Job Detail Page

function previouspage(jobid,recordno,jobtype)
{
	document.formmain.action = "";
	document.formmain.target = "";

	for (var i=0;i<document.formmain.elements.length;i++)
		if (document.formmain.elements[i].name=="clsapply_jobid[]")
			document.formmain.elements[i].value=jobid;			
	document.formmain.clsjobalert_recordno.value=recordno;
	// Changes made on 05-05-05 by Sachin. Due to show some banner to only Attorney Job.
	document.formmain.clsjobalert_firmdtljobtype.value=jobtype;
	document.formmain.action="lcjsjobdetail.php";
	document.formmain.submit();
}
function nextpage(jobid,recordno,jobtype)
{
	document.formmain.action = "";
	document.formmain.target = "";

	for (var i=0;i<document.formmain.elements.length;i++)
		if (document.formmain.elements[i].name=="clsapply_jobid[]")
			document.formmain.elements[i].value=jobid;
	document.formmain.clsjobalert_recordno.value=recordno;
	// Changes made on 05-05-05 by Sachin. Due to show some banner to only Attorney Job.
	document.formmain.clsjobalert_firmdtljobtype.value=jobtype;
	document.formmain.action="lcjsjobdetail.php";
	document.formmain.submit();
}
function emailtocollegue(recordno, jobid)
{
	document.formmain.action = "";
	document.formmain.target = "";

	window.open('','EmailtoCollegue','height=500,width=616,left=75,top=75,scrollbars=yes,resizable=no,menubar=no');

	for (var i=0;i<document.formmain.elements.length;i++)
		if (document.formmain.elements[i].name=="clsapply_jobid[]")
			document.formmain.elements[i].value=jobid;
	document.formmain.clsjobalert_recordno.value=recordno;
	document.formmain.clspostjob_hdnjobid.value=jobid;
	document.formmain.action = "lcjobemailtocollegue.php";
	document.formmain.target = "EmailtoCollegue";
	document.formmain.submit();
}
function contactaboutinfo()
{
	window.open('lccontactaboutinfo.php','ContactInfo','height=500,width=616,scrollbars=yes,toolbar=no,menubar=no');
}
function openfirmdetail(firmid)
{
	window.open('lcfirmdetail.php?firmid='+firmid,'ContactInfo','height=500,width=616,scrollbars=yes,toolbar=no,menubar=no');
}
function reportjoberror(jobid)
{
	document.formmain.action = "";
	document.formmain.target = "";
	
	window.open('','ReportError','height=500,width=616,left=75,top=75,scrollbars=yes,resizable=no,menubar=no');	
	document.formmain.clsjoberrorreport_jobid.value=jobid;
	document.formmain.action = "lcjoberrorreport.php";
	document.formmain.target = "ReportError";
	document.formmain.submit();
}
function printdetail()
{
	window.print();
}
function printerversion(jobid)
{
window.open('lcjsjobdetail.php?jobid='+jobid+'&printerflag=P','printerversion','height=500,width=616,scrollbars=yes,toolbar=no,menubar=yes');
}
function applyjob(jobid,temp)
{
	document.formmain.action = "";
	document.formmain.target = "";
	
	for(var i=0;i<document.formmain.elements.length;i++)
		if(document.formmain.elements[i].name=="clsapply_jobid[]")
			document.formmain.elements[i].value=jobid;

	window.open('', 'applyjob','height=500,width=616,scrollbars=yes,toolbar=no,top=75,left=75');
	document.formmain.clsjobalert_recordno.value=temp;
	document.formmain.action = "lcjsapplyjob.php";
	document.formmain.target = "applyjob";
	document.formmain.submit();
}
function addhotlist_jobdetail(jobid,temp)
{
	document.formmain.action = "";
	document.formmain.target = "";

	for (var i=0;i<document.formmain.elements.length;i++)
		if (document.formmain.elements[i].name=="clsapply_jobid[]")
			document.formmain.elements[i].value=jobid;

	document.formmain.clsapply_hdnsubmited.value="1";
	document.formmain.clsapply_hdnaction.value="S";
	document.formmain.clsjobalert_recordno.value=temp;
	document.formmain.submit();
}
function addmailmerge(jobid,temp)
{
	document.formmain.action = "";
	document.formmain.target = "";

	for (var i=0;i<document.formmain.elements.length;i++)
		if (document.formmain.elements[i].name=="clsapply_jobid[]")
			document.formmain.elements[i].value=jobid;
	document.formmain.clsjobalert_recordno.value=temp;
	document.formmain.clsapply_hdnsubmited.value="1";
	document.formmain.clsapply_hdnaction.value="MMS";
	document.formmain.submit();
}
function viewfirmjobs(firmid,source)
{
	document.formmain.action = "";
	document.formmain.target = "";
	
	document.formmain.clsjobalert_firmid.value=firmid;
	document.formmain.clsjobalert_source.value=source;	
	document.formmain.action = "lcjssearchresults.php";
	document.formmain.submit();
}

function jobchatwindow(HTTP_PATH)
{
	window.open(HTTP_PATH+'chat/start_client_process.pl?function=start','client_chat_window','resizable=1,toolbar=0,menubar=0,width=325,height=400');
}

function addNotes(jobid, temp)
{
	document.formmain.action = "";
	document.formmain.target = "";
	document.formmain.clsjobnotes_jobid.value=jobid;
	
	window.open('', 'addMannualJobNote','height=500,width=616,scrollbars=yes,toolbar=no,top=75,left=75');
	document.formmain.clsjobalert_recordno.value=temp;
	document.formmain.action = "lcviewnote_popup.php";
	document.formmain.target = "addMannualJobNote";
	document.formmain.submit();
}

function shareresultspopup(HTTP_PATH)
{
	window.open(HTTP_PATH+'lcmailafriend.php','shareresultspopup','resizable=no,toolbar=no,menubar=no,width=616,height=500,top=75,left=75');
}
// Added by Arpit
function searchKeywordJobs(searchKeyword)
{
	document.formmainsearch.clsjobalert_keywords.value=searchKeyword;
	document.formmainsearch.submit();
}