function printVersion(url){
	
}

function hideBlankTRs(table){
	//alert(table.id);
	var rows = table.rows;
	var cells;
	for(r = 0; r < rows.length; r++){
		cells = rows(r).cells;
		if(cells.length > 0){
			if(cells(0).innerHTML == ''){
				rows(r).style.display = 'none';
			}
		}
	} 
}

function openCalendar(e, offsetLeft, offsetTop)
{
	var x;
	var y;
	x = this.event.screenX;
	x2 = x + offsetLeft;
	y = this.event.screenY;
	y2 = y + offsetTop;
			
	var options = "scroll: no; center: no; help: no;status: no;dialogTop: " + y2 + "px;dialogLeft: " + x2 +  "px;dialogWidth: 223px;dialogHeight: 198px";
	var date = window.showModalDialog('/CHS_Admin/Dialogs/Calendar.htm', e, options);

	if(date != null)
	{
		e.focus();
		e.value = date;
	}	
}

function openEmailList(e, offsetLeft, offsetTop, p, n)
{
	var x;
	var y;
	x = this.event.screenX;
	x2 = x + offsetLeft;
	y = this.event.screenY;
	y2 = y + offsetTop;
			
	var options = "scroll: yes; center: no; help: no;status: yes;dialogTop: " + y2 + "px;dialogLeft: " + x2 +  "px;dialogWidth: 350px;dialogHeight: 600px";
	var userData = window.showModalDialog('/CHS_Admin/Views/UserEmails.aspx', e, options);

		e.focus();
		var peices = userData.split(',');
		e.value = peices[0]
		p.value = peices[1]
		n.value = peices[2]
		
}

function openDescription(e, offsetLeft, offsetTop, n)
{
	var x;
	var y;
	x = this.event.screenX;
	x2 = x + offsetLeft;
	y = this.event.screenY;
	y2 = y + offsetTop;
			
	var options = "scroll: yes; center: no; help: no;status: no;dialogTop: " + y2 + "px;dialogLeft: " + x2 +  "px;dialogWidth: 400px;dialogHeight: 200px";
	var userData = window.showModalDialog('/CHS_Admin/Dialogs/TemplateDescription.aspx?id=' + n, e, options);
}

function checkOnBlur(e)
{
	if(e.Validators != null){
		//manually call the onchange event in order to evaluate content against validators
		e.onchange();
	}
}

function goToURL() {
  var i, args=goToURL.arguments; document.returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function headerDate() {
	var mydate=new Date()
	var year=mydate.getYear()
	if (year < 1000)
		year+=1900
	var day=mydate.getDay()
	var month=mydate.getMonth()
	var daym=mydate.getDate()
	if (daym<10)
		daym="0"+daym
	var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
	var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")
	document.write(dayarray[day]+"  "+montharray[month]+" "+daym+", "+year)
}

function populateDropList(dropContext){
			var scenarioType = document.getElementById("ticketData_dropIssueType");
			var scenarioDetail = document.getElementById("ticketData_dropIssueScenario");
			var i = 0;
			
			scenarioDetail.options.length = 0;
			
			if (dropContext == 1) {
				switch(scenarioType.selectedIndex)
				{
					case 1: //CMHC
						scenarioDetail[i++] = new Option("Select an Issue Detail", "Select an Issue Detail", false);
						scenarioDetail[i++] = new Option("Login Problems", "Login Problems", false);
						scenarioDetail[i++] = new Option("Data Entry Issue", "Data Entry Issue", false);
						scenarioDetail[i++] = new Option("Report Request", "Report Request", false);
						scenarioDetail[i++] = new Option("Printer Problem", "Printer Problem", false);
						scenarioDetail[i++] = new Option("How To?", "How To?", false);
						scenarioDetail[i++] = new Option("Other", "Other", false);
						break;
					case 2: //Computer
						scenarioDetail[i++] = new Option("Select an Issue Detail", "Select an Issue Detail", false);
						scenarioDetail[i++] = new Option("Login Problems", "Login Problems", false);
						scenarioDetail[i++] = new Option("Software Request", "Software Request", false);
						scenarioDetail[i++] = new Option("Software Problems", "Software Problems", false);
						scenarioDetail[i++] = new Option("Hardware Problems", "Hardware Problems", false);
						scenarioDetail[i++] = new Option("ABS Problems", "ABS Problems", false);
						scenarioDetail[i++] = new Option("Printer Request", "Printer Request", false);
						scenarioDetail[i++] = new Option("Printer Problems", "Printer Problems", false);
						scenarioDetail[i++] = new Option("Loaner Laptop Request", "Loaner Laptop Request", false);
						scenarioDetail[i++] = new Option("LCD Projector Loaner Request", "LCD Projector Loaner Request", false);
						scenarioDetail[i++] = new Option("How To?", "How To?", false);
						scenarioDetail[i++] = new Option("Other", "Other", false);					
						break;
					case 3: //Essist
						scenarioDetail[i++] = new Option("Select an Issue Detail", "Select an Issue Detail", false);
						scenarioDetail[i++] = new Option("Login Problems", "Login Problems", false);
						scenarioDetail[i++] = new Option("Data Entry Issue", "Data Entry Issue", false);
						scenarioDetail[i++] = new Option("How To?", "How To?", false);
						scenarioDetail[i++] = new Option("Other", "Other", false);					
					
						break;
					case 4: //Miscellaneous
						scenarioDetail[i++] = new Option("Select an Issue Detail", "Select an Issue Detail", false);
						scenarioDetail[i++] = new Option("How To?", "How To?", false);						
						scenarioDetail[i++] = new Option("Other", "Other", false);					
					
						break;
					case 5: //Phone
						scenarioDetail[i++] = new Option("Select an Issue Detail", "Select an Issue Detail", false);
						scenarioDetail[i++] = new Option("Office Phone","Office Phone", false);
						scenarioDetail[i++] = new Option("Cellular", "Cellular", false);
						scenarioDetail[i++] = new Option("Voicemail", "Voicemail", false);
						scenarioDetail[i++] = new Option("How To?", "How To?", false);							
						scenarioDetail[i++] = new Option("Extension Moved/Added", "Extension Moved/Added", false);
						scenarioDetail[i++] = new Option("Other", "Other", false);					
					
						break;
					case 6: //Security
						scenarioDetail[i++] = new Option("Select an Issue Detail", "Select an Issue Detail", false);
						scenarioDetail[i++] = new Option("Suspicious Email", "Suspicious Email", false);						
						scenarioDetail[i++] = new Option("How To?", "How To?", false);						
						scenarioDetail[i++] = new Option("Other", "Other", false);					
					
						break;
					case 7: //Intranet
						scenarioDetail[i++] = new Option("Select an Issue Detail", "Select an Issue Detail", false);
						scenarioDetail[i++] = new Option("Submit new Web Page", "Submit new Web Page", false);
						scenarioDetail[i++] = new Option("Page Not Loading", "Page Not Loading", false);
						scenarioDetail[i++] = new Option("Cannot Log in", "Cannot Log in", false);
						scenarioDetail[i++] = new Option("Other", "Other", false);					
					
						break;
					default:
						scenarioDetail[i++] = new Option("Select an Issue Detail", "Select an Issue Detail", false);
				}		
			} else {
				switch(scenarioType.selectedIndex)
				{
					case 1: //Facilities
						scenarioDetail[i++] = new Option("Select an Issue Detail", "Select an Issue Detail", false);
						scenarioDetail[i++] = new Option("Space Planning", "Space Planning", false);
						scenarioDetail[i++] = new Option("Furniture Request", "Furniture Request", false);
						scenarioDetail[i++] = new Option("Moving", "Moving", false);
						break;
					case 2: //Heating/Cooling
						scenarioDetail[i++] = new Option("Select an Issue Detail", "Select an Issue Detail", false);
						scenarioDetail[i++] = new Option("Tempurature Control", "Tempurature Control", false);
						scenarioDetail[i++] = new Option("Other", "Other", false);
					
						break;
					case 3: //Lighting
						scenarioDetail[i++] = new Option("Select an Issue Detail", "Select an Issue Detail", false);
						scenarioDetail[i++] = new Option("Light Bulb burnt out", "Light Bulb burnt out", false);
						scenarioDetail[i++] = new Option("Other", "Other", false);
					
						break;
					case 4: //Electrical
						scenarioDetail[i++] = new Option("Select an Issue Detail", "Select an Issue Detail", false);
						scenarioDetail[i++] = new Option("Blown Fuse", "Blown Fuse", false);
						scenarioDetail[i++] = new Option("Personal Electronic Device", "Personal Electronic Device", false);
						scenarioDetail[i++] = new Option("Other", "Other", false);
					
						break;
					case 5: //Security
						scenarioDetail[i++] = new Option("Select an Issue Detail", "Select an Issue Detail", false);
						scenarioDetail[i++] = new Option("Building Access", "Building Access", false);
						scenarioDetail[i++] = new Option("Contractor Access", "Contractor Access", false);
						scenarioDetail[i++] = new Option("Other", "Other", false);
					
						break;
					case 6: //Plumbing
						scenarioDetail[i++] = new Option("Select an Issue Detail", "Select an Issue Detail", false);
						scenarioDetail[i++] = new Option("Restroom", "Restroom", false);
						scenarioDetail[i++] = new Option("Break Area", "Break Area", false);
						scenarioDetail[i++] = new Option("Other", "Other", false);
					
						break;
					case 7: //Janitorial
						scenarioDetail[i++] = new Option("Select an Issue Detail", "Select an Issue Detail", false);
						scenarioDetail[i++] = new Option("Office Cleaning", "Office Cleaning", false);
						scenarioDetail[i++] = new Option("Restroom Cleaning", "Restroom Cleaning", false);
						scenarioDetail[i++] = new Option("Break Room Cleaning", "Break Room Cleaning", false);
						scenarioDetail[i++] = new Option("Outdoor Cleaning", "Outdoor Cleaning", false);
						scenarioDetail[i++] = new Option("Other", "Other", false);
					
						break;
					case 8: //Other
						scenarioDetail[i++] = new Option("Select an Issue Detail", "Select an Issue Detail", false);
						scenarioDetail[i++] = new Option("Meeting room setup", "Meeting room setup", false);
						scenarioDetail[i++] = new Option("Office Moves", "Office Moves", false);
						scenarioDetail[i++] = new Option("Vehicles", "Vehicles", false);
						scenarioDetail[i++] = new Option("Other", "Other", false);
						
						break;
					default:
						scenarioDetail[i++] = new Option("Select an Issue Detail", "Select an Issue Detail", false);
						
				}					
			}
	}
