
	function savePageInfo(pageVar, listTypeVar, sourcePage) {
		var cookieValue;
		if(pageVar) {
			cookieValue = pageVar;
		}  else {
			cookieValue = 'undefined';
		}
		if(listTypeVar) {
			cookieValue += ':' + listTypeVar;
		} else {
			cookieValue += ':' + 'undefined';
		}
		if(sourcePage) {
			cookieValue += ':' + sourcePage;			
		} else {
			cookieValue += ':' + 'undefined';		
		}
		
		setPageCookie(cookieValue);
	}

	function setPageCookie(cookieValue) {
	 var today = new Date();
	 var expire = new Date();
	 expire.setTime(today.getTime() + 300000); // 300 second expire time
	 document.cookie = "pageCookie=" + escape(cookieValue) + ";expires=" + expire.toGMTString() + ";path=" + "/";
	}
	
	function updateFrameUrl(defaultUrl, sourcePage) {
	// the following javascript is to determine the iframe location to open
	// cookie gets saved for 30 seconds so user can navigate away from this page and come back to the same
	// iframe page within the 30 second limit
	// cookie is set from within the iframe
	
	var myPageCookie = getCookie('pageCookie');
	var cookieArray = myPageCookie.split(':');
	var priorSourcePage = cookieArray[2]; // the source page in the cookie
	var listType = cookieArray[1]; // last visited page number
	var pageNum = cookieArray[0]; // live, online, or chatroom
	var liveFrameUrl = defaultUrl;
	var liveFrameParams = '';
	
	if(sourcePage == 'social') {
		if(listType && listType != 'undefined') {
			liveFrameUrl += '?listType=' + listType + '&';
		} else {
			liveFrameUrl += '?listType=' + 'live&'; // default go to live list	
		}
	} else {
		liveFrameParams += '?';
	}
	
	if(pageNum && pageNum != 'undefined' && priorSourcePage == sourcePage) {
			liveFrameParams += 'page=' + pageNum; // if page has been set, go there, otherwise, it will default to page 0
			liveFrameUrl += liveFrameParams;			
	}			 
	
	var liveFrame = document.getElementById('liveFrame');
		liveFrame.src = liveFrameUrl; // set the iframe url for live,online,chatroom listing	
	}