function writeToViewMenu(frm)
{ 
    window.top.frames[0].SetMenuFrame(frm)
}

function CreateAdminMenu()
{
	document.write("<DIV class='menuItem' id='Company'>Companies</DIV>");
	document.write("<DIV class='menuItem' id='Application'>Applications</DIV>");
	document.write("<DIV class='menuItem' id='Users'>Users</DIV>");
	document.write("<DIV class='menuItem' id='SecRes'>Role</DIV>");
	document.write("<DIV class='menuItem' id='TsConfig'>TS Configuration</DIV>");
	document.write("<DIV class='menuItem' id='AtConfig'>Attachment Configuration</DIV>");
}

function clickIssueMenu(frm)
{
	obj=frm//window.parent.frames[1];
	obj.DefectsMenu.releaseCapture();
	obj.DefectsMenu.style.display="none";
	el=event.srcElement;
	
	if (el.id=="Post_Issue") 
	{
      	window.top.frames[1].location.href = "PostIssueNew.aspx"
	}
	else if(el.id=="Close")
	{
      	window.top.frames[1].location.href = "Welcomepage.aspx"
	}	
	else if(el.id=="New_Post_Issue")
	{
	  	window.top.frames[1].location.href = "PostIssueNew.aspx"
	}
	else if(el.id=="Multi_Post_Issue")
	{
	  	window.top.frames[1].location.href = "PostIssueMlti.aspx"
	}
	else if (el.id=="View_Def") 
	{
      	window.top.frames[1].location.href = "ReviewIssueResult.aspx?ReqFrmMenu=1"
	}
	else if (el.id=="AssignIssue") 
	{
		window.top.frames[1].location.href = "AssignIssueGrid.aspx"
	}
	
 	else if (el.id=="Report") 
	{
      window.top.frames[1].location.href = "ReportsFrm.aspx";
   	}
	else if(el.id == "IssRem")
	{
      	window.top.frames[1].location.href = "IssueRemark.aspx";
	}
	else if(el.id=="M_Status_Update")
	{
      	window.top.frames[1].location.href = "MassStatusUpdate.aspx";
	}
	else if(el.id=="Issue_Knowledge_Bank")
	{
      	window.top.frames(1).location.href = "IssueKnowledgeBank.aspx";
	}
}

function DisplayDefectStatus1(text,datetime) 
{	
	//Function used to display the messages in the status window
	//parent.window.frames(2).document.all.statusBox.value = datetime + ":" + " " + text + "\n" + parent.window.frames(2).document.all.statusBox.value;
	window.top.frames(2).document.all.statusBox.value = datetime + ":" + " " + text + "\n" + parent.window.frames(2).document.all.statusBox.value;
}

function clickGeneralMenu(frm) 
{
	obj=frm;//window.parent.frames[1];

	obj.GeneralMenu.style.display="none";
	el=event.srcElement;

	if (el.id=="User_Config") 
	{
      	window.top.frames(1).location.href = "UserConfigurations.aspx";
    }
	else if (el.id=="Change_Pass") 
	{
   		//var vStatMsg = window.showModalDialog("ModalChangePasswordUser.aspx",window.top.vUserID,"dialogheight:275px;dialogwidth:375px;help:No;status:no;toolbar:no;menubar:no;location=no");   		
   		var vStatMsg = window.showModalDialog("ShowPwdChange.aspx",window.top.vUserID,"dialogheight:275px;dialogwidth:375px;help:No;status:no;toolbar:no;menubar:no;location=no");   		
	 	window.top.frames[2].writeToStatus(vStatMsg);	
	}
	else if (el.id=="support") 
	{
      	window.top.frames(1).location.href = "Support Process.htm";
	}   		
	else if (el.id=="dev_hrs") 
	{
      	window.top.frames(1).location.href = "DevHrs.aspx";
	} 
	else if(el.id == "dev_hrs_upd")
	{
      	window.top.frames(1).location.href = "DevHrsUpdate.aspx";
	}
	else if(el.id=="Alerts")
	{
		if(window.top.frames[0].vISSpecUser == 'T')
      		window.top.frames[1].location.href = "Alert.aspx";
      	else
      		window.top.frames[1].location.href = "AlertClient.aspx";
	}	
}
/*
function clickAdminMenu(frm) 
{
	obj=frm;//window.parent.frames[1];

	obj.AdminMenu.releaseCapture();
	obj.AdminMenu.style.display="none";
	el=event.srcElement;
	var Assignment;
	var projects;
	var users;

	if (el.id=="Company") 
	{
      	window.top.frames[1].location.href = "AdmMain.aspx?ReqFor=8"
	}
	else if (el.id=="Application") 
	{
      	window.top.frames[1].location.href = "AdmMain.aspx?ReqFor=9"
	}
	else if (el.id=="Users") 
	{
      	window.top.frames[1].location.href = "AdmMain.aspx?ReqFor=10"
	}
	else if(el.id == "SecRes")
	{
      	window.top.frames[1].location.href = "AdmMain.aspx?ReqFor=12"
	}
	else if (el.id=="ChangePass") 
	{
      	//window.top.frames[1].location.href = "AdmMain.aspx?ReqFor=4"
      	winpasswd = window.showModalDialog("Change_Password.aspx?UsrId=Admin",null,"dialogheight:250px;dialogwidth:350px;help:No;status:no;toolbar:no;menubar:no;location=no");   		
	}
}
*/
function clickAdminMenu(frm) 
{
	obj=frm;//window.parent.frames[1];

	obj.AdminMenu.releaseCapture();
	obj.AdminMenu.style.display="none";
	el=event.srcElement;
	var Assignment;
	var projects;
	var users;

	if (el.id=="Company") 
	{
      	window.top.frames[1].vMainIsRefresh=0;
      	window.parent.frames[0].location.href = "AdmTree.aspx?ReqFor=8"
	}
	else if (el.id=="Application") 
	{
      	window.top.frames[1].vMainIsRefresh=0;
      	window.parent.frames[0].location.href = "AdmTree.aspx?ReqFor=9"
	}
	else if (el.id=="Users") 
	{
      	window.top.frames[1].vMainIsRefresh=0;
      	window.parent.frames[0].location.href = "AdmTree.aspx?ReqFor=10"
	}
	else if(el.id == "SecRes")
	{
      	window.top.frames[1].vMainIsRefresh=0;
      	window.parent.frames[0].location.href = "AdmTree.aspx?ReqFor=12"
	}
	else if(el.id == "TsConfig")
	{
	   	window.top.frames[1].vMainIsRefresh=0;
      	//window.parent.frames[0].location.href = "AdmTree.aspx?ReqFor=12"
      	window.showModalDialog("ShowTsConfig.aspx",null,"dialogheight:375px;dialogwidth:505px;help:No;status:no;toolbar:no;menubar:no;location=no");   		
	}

	else if (el.id=="SubType") 
	{
		winpasswd = window.showModalDialog("SubTypeContainer.aspx?UsrId=Admin",null,"dialogheight:450px;dialogwidth:650px;help:No;status:no;toolbar:no;menubar:no;location=no");   		
		//winpasswd = window.open("SubTypeFrm.aspx?UsrId=Admin",null,"dialogheight:450px;dialogwidth:850px;help:No;status:no;toolbar:no;menubar:no;location=no");   		
		
	}
	else if(el.id == "AtConfig")
	{
	   	window.top.frames[1].vMainIsRefresh=0;
      	window.showModalDialog("ShowArchiveAttachment.aspx",null,"dialogheight:235px;dialogwidth:505px;help:No;status:no;toolbar:no;menubar:no;location=no");   		
	}
	else if (el.id=="set") 
	{
      	window.top.frames[1].location.href = "PostIssue.aspx"
	}
}

function adminOver(frm)
{
	switchMenu();
	//window.parent.frames[1].AdminMenu.style.display="";
	frm.AdminMenu.style.display="";
	window.top.frames[0].AdmFrmView.a3.src = "images/btn_bullet.jpg";
}

function adminOut(frm)
{
	switchMenu();
	//window.parent.frames[1].AdminMenu.style.display="none";
	frm.AdminMenu.style.display="none";
	window.top.frames[0].AdmFrmView.a3.src = "images/btn_bullet.jpg";
}

function defectOver(frm)
{
	switchMenu();
//	window.parent.frames[1].DefectsMenu.style.display="";
//	window.parent.frames[1].GeneralMenu.style.display="none";
	frm.DefectsMenu.style.display="";
	//frm.GeneralMenu.style.display="none";
	//window.top.frames[0].FrmView.a3.src = "images/btn_bullet.jpg";
	//window.top.frames[0].FrmView.a5.src = "images/btn_bullet.jpg";
}

function defectOut(frm)
{
	switchMenu();
//	window.parent.frames[1].DefectsMenu.style.display="none";
//	window.parent.frames[1].GeneralMenu.style.display="none";
	frm.DefectsMenu.style.display="none";
	frm.GeneralMenu.style.display="none";
	//window.top.frames[0].FrmView.a3.src = "images/btn_bullet.jpg";
}

function generalOut(frm)
{
	switchMenu();
//	window.parent.frames[1].DefectsMenu.style.display="none";
//	window.parent.frames[1].GeneralMenu.style.display="none";
	frm.DefectsMenu.style.display="none";
	frm.GeneralMenu.style.display="none";
	//window.top.frames[0].FrmView.a5.src = "images/btn_bullet.jpg";
}

function generalOver(frm)
{
	switchMenu();
//	window.parent.frames[1].DefectsMenu.style.display="none";
//	window.parent.frames[1].GeneralMenu.style.display="";
	//frm.DefectsMenu.style.display="none";
	frm.GeneralMenu.style.display="";
	//window.top.frames[0].FrmView.a5.src = "images/btn_bullet.jpg";
	//window.top.frames[0].FrmView.a3.src = "images/btn_bullet.jpg";
}

function switchMenu() 
{
	el=event.srcElement;
	if (el.className=="menuItem") 
	{
		el.className="highlightItem";
	} 
	else
	{ 
		if (el.className=="highlightItem") 
		{
			el.className="menuItem";
		}
	}
}


