function changecss(state) 
{
	
	if (!document.styleSheets) return;
	var thecss = new Array();
	if (document.styleSheets[0].cssRules)  // Standards Compliant
	{
		thecss = document.styleSheets[0].cssRules;
	}
	else
	{         
		thecss = document.styleSheets[0].rules;  // IE 
	}
	for (i=0;i<thecss.length;i++)
	{
		if ((thecss[i].selectorText.toLowerCase()=='.arrowopenoff'))
		{
			if (state == 0)
			{
				thecss[i].style.backgroundImage="url(../img/arrowOpenOff.gif)";
			}
			if (state == 1)
			{
				thecss[i].style.backgroundImage="url(../img/arrowCloseOff.gif)";
			}
		}
		
	}
}
function showClever(name,id)
{
	identity=document.getElementById(id);
	
	if (document.getElementById(name).style.display == "block")
	{
		document.getElementById(name).style.display = "none";
		identity.className="arrowOpenOff";
	}
	else
	{
		document.getElementById(name).style.display = "block";
		identity.className="arrowCloseOff";
	}
}
function AlterWidth(x,y,obj)
{
	document.getElementById(obj).style.width=x;
	document.getElementById(obj).style.height=y;
	alert(document.getElementById(obj).style.width);
}

function redirectTo(form)
{
 for (i=0; i < document.forms[0].moreActions.options.length; i++)
 {
  if (document.forms[0].moreActions.options[i].selected)
  {
   paramVal = document.forms[0].moreActions.options[i].value;
   document.location.href='Main.php?do='+paramVal;
  }
 }
}

function show(name)
{
	document.getElementById(name).style.display = "block";
}
function hide(name)
{
	document.getElementById(name).style.display = "none";
}
function submitter()
{
	document.forms['pageForm'].submit();
}
function actionChanger(action)
{
	switch(action)
	{
		case 0:
			document.forms['pageForm'].action = 'Main.php?do=RetrieveEmails';
			document.forms['pageForm'].submit();
			break;
		case 1:
			document.forms['pageForm'].action = 'Main.php?do=AddBug';
			document.forms['pageForm'].submit();
			break;			
		case 2:
			document.forms['pageForm1'].action = 'Main.php?do=PreviewChoice&choice=1';
			document.forms['pageForm1'].submit();
			break;
		default:
			break;
	}
}

function setFocusColor(strIn)
{
	if 	(document.forms[0] != null)
	{
		document.forms[0][strIn].style.backgroundColor = "#FFFFFF";
	}
}

function setBlurColor(strIn)
{
	if 	(document.forms[0] != null)
	{
		document.forms[0][strIn].style.backgroundColor = "#FFFFFF";
	}
}

function CheckAll(frm)
{
	for (i=0; i < document.forms[frm].elements.length; i++)
	{
		document.forms[frm].elements[i].checked=true;
	}
}

function AddContactsToEmail()
{
	var strEmails = "";
	for (i=0; i < document.forms['AddressBook'].elements.length; i++)
	{
		if (document.forms['AddressBook'].elements[i].checked==true)
		{
			strEmails += document.forms['AddressBook'].elements[i].value + ",";
		}
	}
	var len = strEmails.length;
	document.forms['pageForm']['email_to'].value = strEmails.substring(0,len-1);

}

function styleHandler()
{
	if (navigator.appName == "Netscape")
	{
		document.getElementById("right").style.width = "797px"; 
	}
}

function checkAll(form, field)
{
	for (i = 0; i < document.forms[form].elements.length; i++)
		document.forms[form].elements[field][i].checked = true ;
}

function uncheckAll(form,field)
{
	for (i = 0; i < document.forms[form].elements.length; i++)
		document.forms[form].elements[field][i].checked = false ;
}