function morecaseinfo(caseid)
{
//alert(caseid);
window.location="detailed_case_info.php?caseid="+caseid;
}

function ListSubcategory()
{
var catid = document.getElementById("CaseCategoryID").value;
window.location="vote.php?catid="+catid;
}
function ListCategoryCases()
{
var categoryid = document.getElementById("CaseCategoryID").value;
var subcategoryid = document.getElementById("SubCaseCategoryID").value;
window.location="vote.php?catid="+categoryid+"&SubCaseCategoryID="+subcategoryid;
}

function pickdefendant(val)
{
	var addr = val.split("**");
	
	var MemberID = addr[0];
	var DefendantName = addr[1];
	var DefendantCompany = addr[2];
	var EmailID = addr[3];
	var Address = addr[4];
	var Country = addr[5];
	var State = addr[6];
	var City = addr[7];
	var Zip = addr[8];
	var Phone = addr[9];
	var Fax = addr[10];
	
	window.opener.document.getElementById("DefendantMemberID").value = MemberID;
	window.opener.document.getElementById("DefendantName").value = DefendantName;
	window.opener.document.getElementById("DefendantCompany").value = DefendantCompany;
	window.opener.document.getElementById("DefendantEmailId").value = EmailID;
	window.opener.document.getElementById("DefendantAddress").value = Address;
	window.opener.document.getElementById("Country").value = Country;
	window.opener.document.getElementById("State").value = State;
	window.opener.document.getElementById("DefendantCity").value = City;
	window.opener.document.getElementById("DefendantZip").value = Zip;
	
	window.opener.document.getElementById("DefendantPhone").value = Phone;
	window.opener.document.getElementById("DefendantFax").value = Fax;
	
	window.opener.document.getElementById("DefendantName").readOnly =true;
	window.opener.document.getElementById("DefendantCompany").readOnly  = true;
	window.opener.document.getElementById("DefendantEmailId").readOnly  = true;
	window.opener.document.getElementById("DefendantAddress").readOnly  = true;
	window.opener.document.getElementById("Country").readOnly  = true;
	window.opener.document.getElementById("State").readOnly  = true;
	window.opener.document.getElementById("DefendantCity").readOnly  = true;
	window.opener.document.getElementById("DefendantZip").readOnly  = true;
	window.opener.document.getElementById("DefendantPhone").readOnly  = true;
	window.opener.document.getElementById("DefendantFax").readOnly  = true;
	window.opener.document.getElementById("unspec_defendant").checked  = false;
	
	self.close()
}

function listcase(catname,catid)
{
if (catname=="")
{
window.location="all_cases.php?cat_id="+catid;
}
}
function subcat()
{
window.location="create_case.php";
}

function dispCases()
{
var val = document.getElementById("mycases").value;
window.location = 'my_cases.php?dispstat='+val;
}
 function EditCase(caseid)
{
	var usr_stat = document.getElementById("usr_stat").value;
	if(usr_stat=='p')
	{
	window.location="edit_my_case_plaintiff.php?caseid="+caseid;
	}
	if(usr_stat=='d')
	{
	window.location="edit_my_case.php?caseid="+caseid;
	}
	if(usr_stat=='w')
	{
	var dispstat = document.getElementById("mycases").value;
	window.location="view_my_case.php?caseid="+caseid+"&dispstat="+dispstat;
	}
	if(usr_stat=='jcv')
	{
	var dispstat = document.getElementById("mycases").value;
	window.location="edit_my_case_juror.php?caseid="+caseid+"&dispstat="+dispstat;
	}
}
function popup(caseid)
{
	window.location="detailed_case_info.php?caseid="+caseid;
}

function casefunc(caseid)
{
document.getElementById("caseid").value = caseid;
}
function validate_remove_case()
{
	if(document.getElementById("mycases").value == "")
	{
		alert("Please select a case title");
		return false;
	}
	if(document.getElementById("removal_reason").value == "")
	{
		alert("Please give the reason for removal");
		return false;
	}
	//return true;
}

function pickimg(val)
{
	//alert(val); return false;
	window.opener.document.getElementById("img_path").value = val;
	self.close()
}

