function openSecureInstance(){
	var winLocation = "";
	if(arguments[0] != undefined){
		winLocation = arguments[0];
	} 
	else{
		return null;
	}

	var features = "";
	if((arguments[1] != undefined) && (arguments[1] != null)){
		features = arguments[1];
	}
	else{
		w = screen.availWidth-10;
		h = screen.availHeight-28;
		features = "width="+w+",height="+h;
		features += ",left=0,top=0,screenX=0,screenY=0,resizable=1,scrollbars=yes,status=1";
	}

	var winName = "";
	if((arguments[2] != undefined) && (arguments[1] != null)){
		winName = arguments[2];
	}
	else{
		winName = 'newWin';
	}


	return openSecureInstanceWithParam(winLocation, features, winName);
}

function openSecureInstanceWithParam(winLocation, features, winName){
	return window.open(winLocation,winName,features);
}


function startSelfReg(act, cust){
	var targetForm = document.LandingPage;
	
	if(targetForm.bankId){
		var bankId = targetForm.bankId.value;
		var lang = targetForm.Language.value;
		
		if(isBrowserMenuEnabled()){
			features = "";
		}
		else{
			features = null;
		}
		
		openSecureInstance(act + '/dcal/AuthenticationServlet?action=bankSelfRegStart&bankId=' + bankId + '&language=' + lang + '&custom=' + cust, features); 
	}
}