/*****************************************************
*	Open Window Function
*****************************************************/

function openWin (url,width,height,extras) {
	if (width < 0 || height < 0) {
		newWin = window.open(url,"new_win",extras);
	} else {
		newWin = window.open(url,"new_win","width="+ width +",height="+ height +","+ extras);
	}
}

/************************************************************************************************************
* This function is used in the onclick of the a tag to display the external site warning. 
* @param msg - Integer specifying the which message to display.
* @param lk - The a link object
* Usage: <a href="http://wwww.mysite.com" onclick="return displayThirdPartyAlert(1,this);">My Site</a>
**************************************************************************************************************/
function displayThirdPartyAlert(msg,lk,newWin){
	var description = lk.innerHTML;
    var target = (!newWin) ? lk.target : "_blank";
	if(description.indexOf('alt="') != -1){
		var x = description.indexOf('alt="')+5;
		var temp = description.substring(x);
		description = temp.substring(0,temp.indexOf("\""));
	}
	showWarning(lk.href, description, target, msg)
	return false;
}

/************************************************************************************************************
* This function is used in the href of the a tag to display the external site warning. 
* @param lk - The url of the site to be opened
* @param desc - The description of the site to be opened, i.e. the name of the site.
* @param target - Allows for the window to opened in a new window
* @param msg - Integer specifying the which message to display.
* Usage: <a href="javascript:('http://wwww.mysite.com');">My Site</a>
**************************************************************************************************************/
function showWarning(lk, desc, target, msg){
	desc = (desc) ? desc : "Third Party Site";
	target = (target) ? target : "";
	msg = (msg) ? msg : 0;
	
	var messages = new Array(6);
	messages[0] = '<h2>Third Party Site Disclaimer</h2><br/>You are leaving Premier CU\'s website. Links that may be accessed via <strong>' +desc+ '</strong> are for the convenience of informational purposes only. Any products and services accessed through <strong>'+ desc +'</strong> are not provided or guaranteed by Premier CU. The site you are about to visit may have a privacy policy that is different than Premier CU\'s. Please review their privacy policy. Premier CU does not endorse the content contained in these sites, nor the organizations publishing those sites, and hereby disclaims any responsibility for such content.';
	
	messages[1] = '<h2>Third Party Site Disclaimer</h2><br/>You are leaving Premier CU\'s website. Links that may be accessed via <strong>' +desc+ '</strong> are for the convenience of informational purposes only. Any products and services accessed through <strong>'+ desc +'</strong> are not provided or guaranteed by Premier CU. The site you are about to visit may have a privacy policy that is different than Premier CU\'s. Please review their privacy policy. Premier CU does not endorse the content contained in these sites, nor the organizations publishing those sites, and hereby disclaims any responsibility for such content.';
	
	messages[2] = '<h2>Non-Secure Email Disclaimer</h2><br/>As a convenience to you and to provide additional means of communications between you and Premier CU, you can use electronic mail (e-mail) to contact the bank regarding general inquiries and general access and maintenance issues. However communication via e-mail is not considered secure, and you agree that you will not use e-mail to transmit sensitive and/or confidential information such as account numbers, user IDs, or PINs, or to request or authorize any financial transaction.';
	
	var content = new Array();
	var index = 0;
	content[index++] = messages[msg];
	content[index++] = '<br /><br /><br />';
	content[index++] = '<div align="center"><a href="'+lk+'" target="'+target+'" onclick="document.getElementById(\'ex_dis\').style.display = \'none\'">Continue</a>&#160;&#160;<a href="javascript:void(\'0\');" onclick="document.getElementById(\'ex_dis\').style.display = \'none\'">Decline</a></div></div>';	
	document.getElementById("ex_dis").innerHTML = content.join("");
	document.getElementById("ex_dis").style.display = "block";
	scrollTo(0,0);
}

document.write('<div id="ex_dis" style="background-color: #ffffff; font-family: Arial, Helvetica, sans-serif; font-size: 8pt; font-weight: normal; color: #000000; text-align: left; position:absolute; top:125px; left:10px; border: thin solid #1A448E; padding: 15px; display: none; z-index: 100000; width:350px;"></div>');

