<!--

var winUrl = null;
var childWindow = null;

		function showWin(url, windowName, features)	{
			
			// check to see if width is being predefined in features			
			var iWidth = features.indexOf("width");
			
			if (iWidth >= 0) {
				window.open(url, windowName, features);

			// if width has not been predefined than use then proceed
			} else {
			
			window.name = "mainWin";
			winUrl = url;

		  // Simple Browser Check
			var ns4 = (document.layers) ? 1 : 0;
			var ie4 = (document.all) ? 1 : 0;
			var ns6 = (document.getElementById && !document.all) ? 1 : 0;

			// Browser Window Dimensions
			function windowWid(){
			   return (ns4||ns6) ? window.innerWidth : document.body.clientWidth;
			}
			function windowHei(){
			   return (ns4||ns6) ? window.innerHeight : screen.height;
			}
			
			// Example Use
			var displaywidth = windowWid();
			var displayheight = windowHei();
			
			var percwidth =  Math.round(displaywidth * 0.80);
			var percheight = Math.round(displayheight * 0.50);
		  
		  	var winAttributes= "width=" + percwidth + ", height=" + percheight + ",top=30,left=30," + features;
	 	 
		  //launch the new window and capture a reference to that window
		  childWindow = window.open(url,windowName,winAttributes);
		 	 
		  //bring "focus" to the new window so it appears on top of the window stack
		  childWindow.focus(); }
	 }	 
		
function showBrowserWin(url, windowName)	
{
	showWin(url, windowName, "resizable,scrollbars,menubar,status,toolbar,location");
}

function showPopupWin(url, windowName)	
{
	showWin(url, windowName, "resizable=yes,scrollbars=yes,menubar=no,status=no,toolbar=no,location=no");
}

function showWindow(url, windowName, features)	{
	
// Simple Browser Check
var ns4 = (document.layers) ? 1 : 0;
var ie4 = (document.all) ? 1 : 0;
var ns6 = (document.getElementById && !document.all) ? 1 : 0;

// Browser Window Dimensions
function windowWid(){
return (ns4||ns6) ? window.innerWidth : document.body.clientWidth;}
function windowHei(){
return (ns4||ns6) ? window.innerHeight : screen.height; }

var displaywidth = windowWid();
var displayheight = windowHei();
var percwidth =  Math.round(displaywidth * 0.80);
var percheight = Math.round(displayheight * 0.50);
var winFeatures=features;

if (winFeatures!=undefined) {

//alert("Has Features :"+ winFeatures);
childWindow = window.open(url,windowName,winFeatures);
childWindow.focus(); 

} else {

window.name = "mainWin";
var winFeatures="resizable,scrollbars=yes,menubar=yes,status=yes,toolbar=yes,location=yes"+",width=" + percwidth + ", height=" + percheight + ",top=30,left=30,";

//alert("No Features, Assigning : "+ winFeatures);	
childWindow = window.open(url,windowName,winFeatures);
childWindow.focus();   
}
}

function checkPage(){
	
	var cookieStr = document.cookie;
    if(cookieStr.indexOf("logOut=true")>=0){
			window.location="https://www.discoverpersonalloans.com/dpl/orig/login/logoutForward";
	}
	
}

function SAcheckPage(){
    var cookieStr = document.cookie;
	if(cookieStr.indexOf("saReg=true")>=0){
		window.location="https://www.discoverpersonalloans.com/dpl/svc/view/loadView";
	}
	
}

function SAThankYouCheckPage(){
	var cookieStr = document.cookie;
	if(cookieStr.indexOf("saThankYou=true")>=0){
		window.location="https://www.discoverpersonalloans.com/dpl/svc/view/loadView";
	}
	
}


var counter2 = 0;
function onClickCheckSubmit(){
	counter2++;
	if(counter2==1){
		return true;
	}else{
		return false;
	}
}

// Functions to get UID for ac_main_login.shtml
function get() {	
	  userid = Get_Cookie("dplUserId")
  	  if (userid != null && userid != "DO_NOT_REMEMBER_ID") 
	  {	
	      document.login_box.userid.value = userid;
          document.login_box.rememberid.checked = true;
 		 
      }
	
}


function Get_Cookie(name) 
{		
    var start = document.cookie.indexOf(name+"=");
    var len = start+name.length+1;
    if ((!start) && (name != document.cookie.substring(0,name.length))) 
	{	

		return null;
	}
    if (start == -1) 
	{	
		return null;
	}

    var end = document.cookie.indexOf(";",len);
    if (end == -1)
	{
		end = document.cookie.length;
	}
	
    return unescape(document.cookie.substring(len,end));
}

// end Functions to save UID for ac_main_login.shtml
//-->
