	
function openPopup(webform)
{ 
	window.open(webform, "", "fullscreen=no, addressbar=no, toolbar=no, status=no, menubar=no, scrollbars=no, resizable=yes, directories=no, location=no, width=600, height=450"); 
} 	 

function openWindow(webform)
{ 
	window.open(webform, "", "fullscreen=no, addressbar=no, toolbar=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, directories=no, location=no, width=950, height=650"); 
} 	 

function openMedia(webform)
{ 
	window.open(webform, "", "fullscreen=no, addressbar=no, toolbar=no, status=no, menubar=no, scrollbars=no, resizable=no, directories=no, location=no, width=965, height=608"); 
} 	 

function openPresentation(webform)
{ 
	window.open(webform, "", "fullscreen=no, addressbar=no, toolbar=no, status=no, menubar=no, scrollbars=yes, resizable=yes, directories=no, location=no, width=885, height=650"); 
} 	 

function openCertificate(webform)
{ 
	window.open(webform, "", "fullscreen=no, addressbar=no, toolbar=no, status=no, menubar=yes, scrollbars=yes, resizable=yes, directories=no, location=no, width=1000, height=700"); 
} 	 

function openImage(webform)
{ 
	window.open(webform, "", "fullscreen=no, addressbar=no, toolbar=no, status=no, menubar=no, scrollbars=yes, resizable=yes, directories=no, location=no, width=1000, height=700"); 
} 	 

function openScrollablePopup(webform)
{ 
	window.open(webform, "", "fullscreen=no, addressbar=no, toolbar=no, status=no, menubar=no, scrollbars=yes, resizable=yes, directories=no, location=no, width=600, height=400"); 
} 	 

function trapMouseKeyEvents() 
{
	var browser = navigator.appName.substring(0, 9);
	document.onmousedown = disableRightClick;
	if (browser == "Microsoft")
	{
		document.onkeydown = disableKey;
	}
	else
	{
		document.captureEvents(Event.MOUSEDOWN);
	}
}

function disableRightClick(e) 
{
	var browser = navigator.appName.substring(0, 9);
	var eventNumber = 0;
	if (browser == "Microsoft")
	{
		eventNumber = event.button;
	}
	else
	{
		eventNumber = e.which;
	}
	if (eventNumber==2 || eventNumber==3 || eventNumber==4) 
	{
		alert("The pop-up menu is disabled on this page.");
		return (false);
	}
	return (true);
}

function disableKey() 
{
	var menuKey = 93;
	var printKey = 80;
	var copyKey = 67;
	var keycode = event.keyCode;
	switch (keycode) 
	{
		case menuKey:
			alert("The pop-up menu is disabled on this page.");
			break;		
		case printKey:
			alert("The print function is disabled on this page.");
			break;
		case copyKey:
			alert("The copy function is disabled on this page.");
			break;	
	}
} 
	
function setCookie(name, value, expires)
{
	var cookie = name + '=' + value;
	if (expires != "")
	 cookie += '; expires=' + expires.toGMTString();
	 
     document.cookie = cookie;
}

function getCookie(name)
{
	if(name == '')
	return('');

	name_index = document.cookie.indexOf(name + '=');

	if(name_index == -1)
	return('');

	cookie_value =  document.cookie.substr(name_index + name.length + 1, document.cookie.length);

	end_of_cookie = cookie_value.indexOf(';');
	if(end_of_cookie != -1)
	cookie_value = cookie_value.substr(0, end_of_cookie);

	space = cookie_value.indexOf('+');
	while(space != -1)
	{ 
		cookie_value = cookie_value.substr(0, space) + ' ' + 
		cookie_value.substr(space + 1, cookie_value.length);
						
		space = cookie_value.indexOf('+');
	}

	return(cookie_value);
}

function clearCookie(name)
{                  
	expires = new Date();
	expires.setYear(expires.getYear() - 1);

	document.cookie = name + '=null' + '; expires=' + expires; 		 
}
         
function clearCookies()
{
	Cookies = document.cookie;
	Cookie = Cookies;
	expires = new Date();
	expires.setYear(expires.getYear() - 1);

	while(Cookie.length > 0)
	{
		Cookie = Cookies.substr(0, Cookies.indexOf(';'));
		Cookies = Cookies.substr(Cookies.indexOf(';') + 1, Cookies.length);

		if(Cookie != '')
			document.cookie = Cookie + '; expires=' + expires;
		else
			document.cookie = Cookies + '; expires=' + expires;			  			  	  
	}		 		 
}

function checkPopups()
{
	if (getCookie("popups") != "enabled")
	{
		window_handle = window.open("/sm/PopUp.htm", "", "left=100000, top=100000");
		if (!window_handle)
		{
			alert('To use the NTQR Website Pop-up Windows must be enabled.');
		}
		else
		{
			window.focus();
			setCookie("popups", "enabled", "");
		}
	}
}
//--- Delete Confirmation for C1WebGrid
//--- Parameters:	location = grid location,wucName+gridName (ex. 'wucPracticeGrid_practiceGrid')
//---				rowIndex = index of row (e.Item.ItemIndex from ItemCreatedEvent)
//---				columnIndex = index of column with practiceName (depends on grid layout)
								
function confirmDelete(location,rowIndex,columnIndex)
{
	var row = parseInt(rowIndex);
	var col = parseInt(columnIndex);
	var practiceName = document.getElementById(location+'_R'+row).cells[col].innerText;
	if (practiceName.substr(0, 1) == "*")
	{
		alert('Your primary practice location may not be deleted.');
		return false;
	}
	else
	{
		return confirm('Are you sure you want to remove '+practiceName+' from your list?');
	}
}

function CheckDate(mon, day, year) 
{
	var monName = MonthName(mon);
	var usDateString = day + ' ' + monName + ' ' + year;
	var usDate = new Date(usDateString);
	var newDateString = usDate.toGMTString();
	var dateArray = newDateString.split(' ');
	
	if ( dateArray[2] != monName ) 
	{
		return false;
	}
	return true;
}

function MonthName(mon)
{
	switch (mon)
	{
		case ('1'):
		case ('01'):
			return 'Jan';
			break;
		case ('2'):
		case ('02'):
			return 'Feb';
			break;
		case ('3'):
		case ('03'):
			return 'Mar';
			break;
		case ('4'):
		case ('04'):
			return 'Apr';
			break;
		case ('5'):
		case ('05'):
			return 'May';
			break;
		case ('6'):
		case ('06'):
			return 'Jun';
			break;
		case ('7'):
		case ('07'):
			return 'Jul';
			break;
		case ('8'):
		case ('08'):
			return 'Aug';
			break;
		case ('9'):
		case ('09'):
			return 'Sep';
			break;
		case ('10'):
			return 'Oct';
			break;
		case ('11'):
			return 'Nov';
			break;
		case ('12'):
			return 'Dec';
			break;
		default:
			return '';
	}
}

