	function discPopup(url, name, width, height) {
		var settings = "titlebar=no,toolbar=no,location=no,directories=no,"+
			"status=no,menubar=no,scrollbars=no,"+
			"resizable=no,width="+width+",height="+height;
		window.open(url,name,settings);
	}  
  
   // Get Field from multivalue cookie
   function getCookie(Name,Field) {
		var search = Name + "="
   
		if (document.cookie.length >0) { // if there are any cookies
				offset = document.cookie.indexOf(search) 
				if (offset != -1) { // if cookie exists 
				   offset += search.length 
				   // set index of beginning of value
				   end = document.cookie.indexOf(";", offset) 
				   // set index of end of cookie value
				   if (end == -1) 
				      end = document.cookie.length
				   val = unescape(document.cookie.substring(offset, end))
				
				   if (typeof(Field) != "undefined") {
						arrVal = val.split("&")
						for (i = 0; i < arrVal.length; i++){
							search = Field+"=";
							offset = arrVal[i].indexOf(search);
							if (offset != -1){
								offset += search.length;
								return arrVal[i].substring(offset);
							}
						}
				   } else {
						return val
				   } 
				} 
		   }
		}
	
		function setCookie(name, value) 
		{
		var today = new Date()
		var expires = new Date()
		expires.setTime(today.getTime() + (1000*60*60*24*365)*10) 
		document.cookie = name + "=" + escape(value) + "; path=/; expires=" + expires.toGMTString()
		}
		
		function deleteCookie(name) {
			var today = new Date()
			var expires = new Date()
			expires.setTime(today.getTime() - (1000*60*60*24*365)*10) 
			document.cookie = name + "=; path=/; expires=" + expires.toGMTString()
			
		}

		if (getCookie("loginStatus","status") == "timeout"){

			deleteCookie("loginStatus");
			var cook = document.cookie;
			if (cook.indexOf("UserType=PunchOut") != -1) {
				alert("Your PunchOut Session has ended");
				deleteCookie("UserType");
				window.location = "/Default.aspx"
			} else {
				alert("Your session has timed out. Please login to access your account.\nIf you were in the process of submitting an order, please sign-in\nto complete the process.");
				window.location = "/login/login.aspx";
			}
		}
		
		function NeedLogin() {
		
			alert("You need to login in order to access this feature.");
		
		}
		
		function switchAccount(value) {
			if(value != "") {
				var currPage = window.location.pathname;
				//If currPage = order history append query string
				if(currPage.indexOf("orderHistory.asp") != -1) {
					var qryString = window.location.search;
					var refURL = value + "&referer=" + currPage + qryString;
				} else {
					var refURL = value + "&referer=" + currPage;
				}
				window.location = "/account/switch_account.aspx?" + refURL; 
				//window.location = "/account/switch_account.aspx?" + value;
			}
		}