function EnablePopUp() 
{
    document.Form1.ExitPopUpControl.value = 'On';
} //function EnablePopUp()

function DisablePopUp() 
{
    document.Form1.ExitPopUpControl.value = 'Off';    
} //function DisablePopUp()


function init()
{
	var arrLinks = document.getElementsByTagName('a');
	
	for (var i = 0; i < arrLinks.length; i++) 
	{
		if (arrLinks[i].getAttribute('type') == 'confirm') 
		{
			arrLinks[i].onclick = function () 
			{
				return checkAndDoLink(this.href)
			}
		}
	}	
} //function init()

function checkAndDoLink(strURL) 
{
    if (document.Form1.ExitPopUpControl.value == 'On')
    {
		var bolLeave = window.confirm('Are you sure you want to leave the ChoiceStudio?\n\nClick "OK" to exit or click "Cancel" to stay in the application and continue working. We recommend you save your design before exiting.');
		if (!bolLeave)
		{
			//do nothing
		}
		else
		{
			window.location.href = strURL;
		}
    }
    else
    {
		window.location.href = strURL;
    }

	return false;

} //function checkAndDoLink(strURL) 


function closewindow() 
{
	window.close();
} //function closewindow()

function focusme() 
{
	window.focus();
} //function focusme

