/************************************************************************************************************
* 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){
	var description = lk.innerHTML;
	if(description.indexOf('alt="') != -1){
		var x = description.indexOf('alt="')+5;
		var temp = description.substring(x);
		description = temp.substring(0,temp.indexOf("\""));
	}
	//alert(1k);
	showWarning(lk.href, description, lk.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(1);
	messages[0] = '<h2>Welcome Peoples First customers to the Hancock Bank Family.</h2><br /><span class="style3"><font color="#FF0000"><b>Please note that Peoples First customers cannot enroll for Hancock Bank e-Banking at this time. Until the conversion has been completed, continue to enroll by using Peoples First\'s <a href="http://www.peoplesfirstonline2.com/home/electronic/personal" style="color:#FF0000;" target="_blank">Personal EZ Online Access</a>.</b></font><br /><br />We\'ll keep you informed about the transition and any changes that may affect your account. In the meantime, we want to make the transition as easy as possible. We look forward to serving you. Stay up to date about the merger. <a href="/peoplesfirst" target="_blank">Learn more</a><br /><br />For Hancock Bank customers interested in enrolling in e-Banking now, click on the continue link below to begin the e-Banking enrollment process.</span>';

	messages[1] = '<h2>Welcome Peoples First customers to the Hancock Bank Family.</h2><br /><span class="style3"><font color="#FF0000"><b>Please note that Peoples First customers cannot enroll for Hancock Bank e-Banking at this time. Until the conversion has been completed, continue to enroll by using Peoples First\'s <a href="http://www.peoplesfirstonline2.com/home/electronic/business" style="color:#FF0000;" target="_blank">Business EZ Online Access</a>.</b></font><br /><br />We\'ll keep you informed about the transition and any changes that may affect your account. In the meantime, we want to make the transition as easy as possible. We look forward to serving you. Stay up to date about the merger. <a href="/peoplesfirst" target="_blank">Learn more</a><br /><br />For Hancock Bank customers interested in enrolling in e-Banking now, click on the continue link below to begin the e-Banking enrollment process.</span>';
/*
	messages[0] = '<h2>Third Party Site Disclaimer</h2>By accessing the noted link you will be leaving Peoples First Community Bank\'s website and entering a website hosted by another party. Peoples First Community Bank has not approved this as a partner site.  Please be advised that you will no longer be subject to, or under the protection of, the privacy and security policies of Peoples First Community Bank\'s website. We encourage you to read and evaluate the privacy and security policies of the site you are entering, which may be different than those of your financial institution\'s.';
	
	messages[1] = '<h1 style="margin-left:100px;">Third Party Site Disclaimer</h1><br/>You are leaving Peoples First Community Bank\'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>'+ lk +'</strong> are not provided or guaranteed by Central Valley Bank. The site you are about to visit may have a privacy policy that is different than Central Valley Bank\'s. Please review their privacy policy. Central Valley Bank 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] = '<h1 style="margin-left:100px;">Non-Secure Email Disclaimer</h1><br/>As a convenience to you and to provide additional means of communications between you and Peoples First Community Bank, 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.';
	
	messages[3] = '<h1>Third Party Site Disclaimer</h1><br/>You are leaving Peoples First Community Bank\'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>'+ lk +'</strong> are not provided or guaranteed by Central Valley Bank. The site you are about to visit may have a privacy policy that is different than Central Valley Bank\'s. Please review their privacy policy. Peoples First Community Bank does not endorse the content contained in these sites, nor the organizations publishing those sites, and hereby disclaims any responsibility for such content.';
	
	messages[4] = '<h1>Third Party Site Disclaimer</h1><br/>You are leaving Peoples First Community Bank\'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>'+ lk +'</strong> are not provided or guaranteed by Peoples First Community Bank. The site you are about to visit may have a privacy policy that is different than Peoples First Community Bank\'s. Please review their privacy policy. Peoples First Community Bank does not endorse the content contained in these sites, nor the organizations publishing those sites, and hereby disclaims any responsibility for such content.';
	
	messages[5] = '<h1>Third Party Site Disclaimer</h1><br/>You are leaving Peoples First Community Bank\'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>'+ lk +'</strong> are not provided or guaranteed by Peoples First Community Bank. The site you are about to visit may have a privacy policy that is different than Peoples First Community Bank\'s. Please review their privacy policy. Peoples First Community Bank does not endorse the content contained in these sites, nor the organizations publishing those sites, and hereby disclaims any responsibility for such content.';

	messages[6] = '<h2>Third Party Site Disclaimer</h2>By accessing the noted link you will be leaving Peoples First Community Bank\'s website and entering a website hosted by another party. Please be advised that you will no longer be subject to, or under the protection of, the privacy and security policies of Peoples First Community Bank\'s website. We encourage you to read and evaluate the privacy and security policies of the site you are entering, which may be different than those of your financial institution\'s.';
	*/
	var content = new Array();
	var index = 0;
	content[index++] = messages[msg];
	content[index++] = '<br /><br /><br />';
//	content[index++] = '<div align="center"><a href="javascript:void(\'0\');" onclick="window.open(\''+lk+'\');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>';	
//	content[index++] = '<div align="center"><a href="javascript:void(\'0\');" onclick="'+lk+'document.getElementById(\'ex_dis\').style.display = \'none\'">Continue</a>&#160;&#160;<a href="javascript:void(\'0\');" onclick="document.getElementById(\'ex_dis\').style.display = \'none\'">Close</a></div></div>';	
	content[index++] = '<div align="center"><a href="javascript:void(\'0\');" onclick="window.open(\''+lk+'\');document.getElementById(\'ex_dis\').style.display = \'none\'">Continue</a>&#160;&#160;<a href="javascript:void(\'0\');" onclick="document.getElementById(\'ex_dis\').style.display = \'none\'">Close</a></div></div>';	
	document.getElementById("ex_dis").innerHTML = content.join("");
	document.getElementById("ex_dis").style.display = "block";
	scrollTo(0,0);
}