// set to true to enable hit box tracking
var hitboxEnabled = true;

// ACCOUNT NUMBER(S)
// should be something like: 'DM570627ECNC38EN3;DM57050997CW38EN3' 
var hitboxAccountNumber = "DM570628OHDD38EN3;DM57050997CW38EN3";          

// MULTI-LEVEL CONTENT CATEGORY
// should be something like: '/creativeservicestestacct;/Test+Do+Not+Use/creativeservicestestacct' 
var hitboxMultiLevelContentCategory = "/digiornoforone;/Food+Bev+Candy/digiornoforone";     


//LIGHTBOX Code

var win = null;
var index = 1;
function openDialog(id,w,h) {
    Dialog.alert($(id).innerHTML, {className: "alphacube",  width:w, height:h, id: "d" + index})
    index++;
	document.getElementById('introHolder').style.display = 'none';
	document.getElementById('flash').style.display = 'none';
}

function lastDialog(id) {
    Dialog.confirm($(id).innerHTML, {className: "alphacube",  width: 250, okLabel: "Close All", ok: closeAllModalWindows})
}

function closeAllModalWindows() {
    Windows.closeAllModalWindows();
    //return true;
	document.getElementById('introHolder').style.display = 'inline';
	document.getElementById('flash').style.display = 'inline';
}

function copyit(theField) {
	var tempval=eval("document."+theField)
	tempval.focus()
	tempval.select()
	therange=tempval.createTextRange()
	therange.execCommand("Copy")
}


//Field Check
function CheckTextFieldLength(textField, numberOfCharactersUsedElement, numberOfCharactersRemainingElement, maximumLength) {
// only allow the text to be as long as the specified maximum length
if (textField.value.length > maximumLength)
textField.value = textField.value.substring(0,maximumLength);

// set characters used and characters remaining
document.getElementById(numberOfCharactersUsedElement).innerHTML = textField.value.length;
document.getElementById(numberOfCharactersRemainingElement).innerHTML = maximumLength - textField.value.length;
}

/************************************************************
* Opens a page if the user is logged in.  Otherwise, redirects
* them to the myspace login page. 
* Assumes that the isLoggedIn variable is defined on a page.
************************************************************/
function GetPopupWithLoginCheck()
{
	if (isLoggedIn > 0)
	    openDialog('contestPop', '550', '550');
	else
		document.location = 'http://login.myspace.com/index.cfm?fuseaction=login';
}