// JScript File

function autoIframe(frameId){
    try{
    frame = document.getElementById(frameId);
    innerDoc = (frame.contentDocument) ? frame.contentDocument : frame.contentWindow.document;
    objToResize = (frame.style) ? frame.style : frame;
    objToResize.height = innerDoc.body.scrollHeight + 10;
    }
    catch(err){
    window.status = err.message;
    }
}

function testing(sText) {
    alert('testing');
}

function getCookie(){
	var NameOfCookie = 'nifc_splash';
    if (document.cookie.length > 0) {
    begin = document.cookie.indexOf(NameOfCookie+'=');
    if (begin != -1) {
      begin += NameOfCookie.length+1;
      end = document.cookie.indexOf(";", begin);
      if (end == -1) end = document.cookie.length;
        return unescape(document.cookie.substring(begin, end));
    }
  }
  return null;
}

function ProcessCookie() {

//var splashPage = 'splash_page_2010b.html';
var splashPage = 'splash_assessments.html';

	ShowSplash=getCookie('Preference'); //UnComment to Show Splash page

	if (ShowSplash != null) {

		var currentTime = new Date();
		var month = currentTime.getMonth() + 1;
		var day = currentTime.getDate();
		var year = currentTime.getFullYear();
		dNow = month + "/" + day + "/" + year;


		// ShowSplash = value | date-pref-saved

		var aryValues = new Array();
		aryValues = ShowSplash.split('|');


		// Check to see if date last saved = today.

		if (dNow == aryValues[1]) {

//			alert('already have a value stored for today.  do NOT show the splash page');

		} else {
		    
		    // cookie is old, show the splash page again
		    
		    window.location=splashPage;
		
		}



	} else {
		//show the splash page
		window.location=splashPage;
	}

}

function setCookie(value, expiredays) {
	var NameOfCookie = 'nifc_splash';
	var ExpireDate = new Date();
	ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
	var currentTime = new Date();
	var month = currentTime.getMonth() + 1;
	var day = currentTime.getDate();
	var year = currentTime.getFullYear();
	dNow = month + "/" + day + "/" + year;
    document.cookie = escape(NameOfCookie ) + "=" + escape(value+'|'+dNow) + "; expires=" + ExpireDate.toGMTString() + "; path=/";
	window.location='SkillsAssessment_Register.aspx';
}

function setCookie2(value, expiredays) {
	var NameOfCookie = 'nifc_splash';
	var ExpireDate = new Date();
	ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
	var currentTime = new Date();
	var month = currentTime.getMonth() + 1;
	var day = currentTime.getDate();
	var year = currentTime.getFullYear();
	dNow = month + "/" + day + "/" + year;
    document.cookie = escape(NameOfCookie ) + "=" + escape(value+'|'+dNow) + "; expires=" + ExpireDate.toGMTString() + "; path=/";
	window.location='https://www.e7sports2.com/E7/Registration/Soccer/IL_NorthernIllinois_FL10/Player_reg/Reg_start.php';
}

function setCookieII(value, expiredays) {
    setCookie(value, expiredays);
    window.location='chicago_fire.aspx';
}

function openItUp(sThisUrl) {

alert(sThisUrl);

	newWindow = window.open(sThisUrl,'NIFC');
	if (window.focus) {newWindow.focus();}
	return false;
}

