var Assignment;
var projects;
var users;

function homeOver(frm)
{
	if(frm != null)
	{
		MM_swapImage('a1','','images/btn_bullet.jpg',1);
		/*
		if ((window.parent.frames[1].AdminMenu + " ") != "undefined ")
		{
			window.parent.frames[1].AdminMenu.style.display="none";
		}	
		*/
		if ((frm.AdminMenu + " ") != "undefined ")
		{
			frm.AdminMenu.style.display="none";
		}	
		document.AdmFrmView.a3.src = "images/btn_bullet.jpg";
	}
}
function imgOver(frm)
{
	if(frm != null)
	{
		if ((frm.AdminMenu + " ") != "undefined ")
		{
			frm.AdminMenu.style.display="none";
		}	
		document.AdmFrmView.a3.src = "images/btn_bullet.jpg";
	}
}
function logoutOver(frm)
{
	if(frm != null)
	{
		MM_swapImage('a4','','images/btn_bullet.jpg',1);
		/*if ((window.parent.frames[1].AdminMenu + " ") != "undefined ")
		{
			window.parent.frames[1].AdminMenu.style.display="none";
		}	*/
		if ((frm.AdminMenu + " ") != "undefined ")
		{
			frm.AdminMenu.style.display="none";
		}	
		document.AdmFrmView.a3.src = "images/btn_bullet.jpg";
	}
}

function homeOverdefects(frm)
{
	if(frm != null)
	{
		MM_swapImage('a1','','images/btn_bullet.jpg',1);
		/*
		if ((window.parent.frames[1].DefectsMenu + " ") != "undefined ")
		{
			window.parent.frames[1].DefectsMenu.style.display="none";
		}	
		if ((window.parent.frames[1].GeneralMenu + " ") != "undefined ")
		{
			window.parent.frames[1].GeneralMenu.style.display="none";
		}
		*/
		if ((frm.DefectsMenu + " ") != "undefined ")
		{
			frm.DefectsMenu.style.display="none";
		}	
		if ((frm.GeneralMenu + " ") != "undefined ")
		{
			frm.GeneralMenu.style.display="none";
		}
		
		document.FrmView.a3.src = "images/btn_bullet.jpg";
		
		if ((document.FrmView.a5 + " ") != "undefined ")
		{
			document.FrmView.a5.src = "images/btn_bullet.jpg";
		}	
	}
}

function imgOverdefects(frm)
{
	if(frm != null)
	{
		if ((frm.DefectsMenu + " ") != "undefined ")
		{
			frm.DefectsMenu.style.display="none";
		}	
		if ((frm.GeneralMenu + " ") != "undefined ")
		{
			frm.GeneralMenu.style.display="none";
		}
		
		document.FrmView.a3.src = "images/btn_bullet.jpg";
		
		if ((document.FrmView.a5 + " ") != "undefined ")
		{
			document.FrmView.a5.src = "images/btn_bullet.jpg";
		}	
	}
}
function logoutOverdefects(frm)
{
	if(frm != null)
	{

		MM_swapImage('a4','','images/btn_bullet.jpg',1);
	/*
		if ((window.parent.frames[1].DefectsMenu + " ") != "undefined ")
		{
			window.parent.frames[1].DefectsMenu.style.display="none";
		}	
		if ((window.parent.frames[1].GeneralMenu + " ") != "undefined ")
		{
			window.parent.frames[1].GeneralMenu.style.display="none";
		}
	*/

		if ((frm.DefectsMenu + " ") != "undefined ")
		{
			frm.DefectsMenu.style.display="none";
		}	
		if ((frm.GeneralMenu + " ") != "undefined ")
		{
			frm.GeneralMenu.style.display="none";
		}
		
		document.FrmView.a3.src = "images/btn_bullet.jpg";
		
		if ((document.FrmView.a5 + " ") != "undefined ")
		{
			document.FrmView.a5.src = "images/btn_bullet.jpg";
		}	
	}
}

function closeWnd()
{
	window.top.location.href = "Login.aspx?IsOut=1";
}

function goToHome()
{
	window.top.frames[1].location.href = "Welcomepage.aspx"
}

function goToAdmHome()
{
	//window.top.frames[1].location.href = "AdmWelcomepage.aspx"
	//window.top.frames[0].SetMenuFrame(window.top.frames[1])
    window.parent.frames[1].frames[0].location.href = "AdmWelcomepage.aspx"
	window.top.frames[0].SetMenuFrame(window.parent.frames[1].frames[0])
}

function showAdminTree()
{
	window.top.frames[1].location.href = "AdmMain.aspx"
}

function isAdminLoaded()
{
	var str1 = new String(parent.window.frames[1].location.href)
	str1=str1.replace("http://","")
	var slash;
	slash=0;
	var finalstring;
	finalstring = str1;
		
	for(slash=0;slash<str1.length;)
	{
		if (slash == -1)
			break;
		if (slash == 0)
		{
			finalstring = finalstring.substring(slash,str1.length);
		}else
		{
			finalstring = finalstring.substring(slash + 1,str1.length);
		}
		slash = finalstring.indexOf("/");
	}
	var s = finalstring.indexOf("?");
	strfinal = finalstring.substring(0,s)
	if (strfinal == "")
		return false;
	else
		return true;
}

/*function RestoreDefectsMenu()
{
	
		obj=window.parent.frames[1];
		if (obj.DefectsMenu.className != "defectsclass")
		{
			obj.DefectsMenu.style.display="none";
		}
		
}*/

function displayDefectsMenu(frm) 
{
	if(frm == null)
		frm = window.top.frames[1]

	if(frm != null)
	{
		MM_swapImage('a3','','images/btn_bullet.jpg',1);
		obj=frm; //window.parent.frames[1];
		defobj = obj.DefectsMenu;
					
		if ((defobj + " ") != "undefined ")
   		{
   			whichDiv=event.srcElement;
	   		
	//   		obj.DefectsMenu.style.pixelTop = window.parent.frames[1].document.body.scrollTop;
   			obj.DefectsMenu.style.pixelTop = frm.document.body.scrollTop;
   			obj.DefectsMenu.style.pixelLeft = window.screen.width-deflabel.width-GeneralLabel.width-SignOutLbl.width-MB4.width-MB5.width-142 	  ;//deflabel.offsetLeft + 500;
			
   			obj.DefectsMenu.style.display = "";
   			obj.GeneralMenu.style.display = "none";
   		}
		//document.FrmView.a5.src = "images/btn_bullet.jpg";
		//obj.GeneralMenu.style.display = "none";
	}

}

function displayGeneralMenu(frm) 
{
	if(frm == null)
		frm = window.top.frames[1]

	if(frm != null)
	{
		MM_swapImage('a5','','images/btn_bullet.jpg',1);
		obj=frm; //window.parent.frames[1];
		generalobj = obj.GeneralMenu
		
		if ((generalobj + " ") != "undefined ")
		{
	   		whichDiv=event.srcElement;
		   	
	//	   	obj.GeneralMenu.style.pixelTop = window.parent.frames[1].document.body.scrollTop;
	   		obj.GeneralMenu.style.pixelTop = frm.document.body.scrollTop;
	   		//obj.GeneralMenu.style.pixelLeft = Screen.width - GeneralLabel.offsetLeft ;
	   		obj.GeneralMenu.style.pixelLeft = window.screen.width-GeneralLabel.width-SignOutLbl.width-MB5.width-130;
	   		obj.GeneralMenu.style.display="";
	   		obj.DefectsMenu.style.display="none";
		}
		//document.FrmView.a3.src = "images/btn_bullet.jpg";
	}
}

function displayAdminMenu(frm) 
{
	if(frm != null)
	{
		MM_swapImage('a3','','images/btn_bullet.jpg',1);
		obj=frm; //window.parent.frames[1];

   		whichDiv=event.srcElement;
   		adminobj = obj.AdminMenu;
   		setobj = obj.set
		
		if ((adminobj + " ") != "undefined ")
		{
	   		obj.AdminMenu.style.pixelTop = adminlabel.offsetTop;
	   		//obj.AdminMenu.style.pixelLeft = adminlabel.offsetLeft + 700;
//"frmAction" 
	   		if(frm.name == "admFrmMain")
	   			obj.AdminMenu.style.pixelLeft = window.screen.width-adminlabel.width-SignOutLbl.width-MB5.width-284;
	   		else
	   			obj.AdminMenu.style.pixelLeft = window.screen.width-adminlabel.width-SignOutLbl.width-MB5.width-(window.screen.width/3)-250;
   		
	   		obj.AdminMenu.style.display="";
	   		obj.AdminMenu.style.zIndex="4";
		}	
		
   		if ((setobj + " ") != "undefined ")
   		{
	   		if(isAdminLoaded() == true)
	   		{ 
	   			obj.set.style.display = ""; 
	   		}else
	   		{
	   			obj.set.style.display = "none" ;
	   		}
		}
			
	}
	
}

function MM_preloadImages() //v3.0
{
	var d=document; 
	if(d.images)
	{ 
		if(!d.MM_p) 
			d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; 
		for(i=0; i<a.length; i++)
		{
			if (a[i].indexOf("#")!=0)
			{ 
				d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];
			}
		}
	}
}

function MM_swapImgRestore()  //v3.0
{
	var i,x,a=document.MM_sr; 
	for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) 
		x.src=x.oSrc;
	
}

function MM_findObj(n, d)  //v4.01
{
	var p,i,x;
	if(!d) 
		d=document;
	if((p=n.indexOf("?"))>0&&parent.frames.length) 
	{
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
	}
	if(!(x=d[n])&&d.all) 
		x=d.all[n];
	for (i=0;!x&&i<d.forms.length;i++)
		x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++)
		x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById)
		x=d.getElementById(n);
	return x;
}

function MM_swapImage()  //v3.0
{
	var i,j=0,x,a=MM_swapImage.arguments;
	document.MM_sr=new Array; 
	for(i=0;i<(a.length-2);i+=3)
	{
		if ((x=MM_findObj(a[i]))!=null)
		{
			document.MM_sr[j++]=x;
			if(!x.oSrc)
				x.oSrc=x.src;
			x.src=a[i+2];
		}
	}
}

