function Tip1(){
	Tip('<em><h5>Hot Topics in cbanc</h5></em> These are some of the "hot" issues bankers are facing. Click to see all the relevant resources on the topic that cbanc members get access to including content from banks, consulting services, webinars, articles, commentary and much more.', BGCOLOR, '#deedf6', BORDERCOLOR, '#046da9', WIDTH, '-275', PADDING, '9', FONTCOLOR, '#5f5f62', STICKY, '1', CLICKCLOSE, 'true', ABOVE, 'true');
}

function Tip2(){
	Tip('<em><h5>New Content in cbanc</h5></em> This is a list of some new content community banks have posted and are exchanging online in the cbanc network.', BGCOLOR, '#deedf6', BORDERCOLOR, '#046da9', WIDTH, '-275', PADDING, '9', FONTCOLOR, '#5f5f62', STICKY, '1', CLICKCLOSE, 'true', ABOVE, 'true')
}

function checkAba(){
	if (Get_Cookie('Aba')){
		document.login.Aba.value = Get_Cookie('Aba');
	}
}

function Set_Cookie( name, value, expires, path, domain, secure )
{
// set time, it's in milliseconds
var today = new Date();
today.setTime( today.getTime() );

/*
if the expires variable is set, make the correct
expires time, the current script below will set
it for x number of days, to make it for hours,
delete * 24, for minutes, delete * 60 * 24
*/
if ( expires )
{
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );

document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
( ( path ) ? ";path=" + path : "" ) +
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}

function Get_Cookie( check_name ) {
	// first we'll split this cookie up into name/value pairs
	// note: document.cookie only returns name=value, not the other components
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false; // set boolean t/f default f

	for ( i = 0; i < a_all_cookies.length; i++ )
	{
		// now we'll split apart each name=value pair
		a_temp_cookie = a_all_cookies[i].split( '=' );


		// and trim left/right whitespace while we're at it
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');

		// if the extracted name matches passed check_name
		if ( cookie_name == check_name )
		{
			b_cookie_found = true;
			// we need to handle case where cookie has no value but exists (no = sign, that is):
			if ( a_temp_cookie.length > 1 )
			{
				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
			}
			// note that in cases where cookie is initialized but no value, null is returned
			return cookie_value;
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
	}
	if ( !b_cookie_found )
	{
		return null;
	}
}

function Delete_Cookie( name, path, domain ) {
if ( Get_Cookie( name ) ) document.cookie = name + "=" +
( ( path ) ? ";path=" + path : "") +
( ( domain ) ? ";domain=" + domain : "" ) +
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

function validateDataSimple(t){
	for (i=0; i<t.length; i++) {
		if (t[i].alt == undefined){
			Alt = "0";
		} else {
			Alt = t[i].alt;
		}
		if(Alt.indexOf("num") != -1 && !t[i].value.match(/^\d+$/)){
			showMessage(t[i].id, "Please enter a number with no text.");
			return false;
		}
		if(Alt.indexOf("jpg") != -1 && t[i].value != "" && t[i].value.indexOf(".jpg") == -1){
			alert(t[i].value + "Please use .jpg photo files.");
			return false;
		}
		if(t[i].value == "" && Alt.indexOf("req") != -1 && t[i].type != "checkbox"){
			alert("Please verify that you have entered all required information.");
			return false;
		} else if(t[i].type == "checkbox" && Alt.indexOf("req") != -1){
			if(!t[i].checked){
				alert("Please verify that you have entered all required information.");
				return false;
			}
		} else if(t[i].value == "" && t[i].type == "textarea" && t[i].title.indexOf("req") != -1){
			alert("Please verify that you have entered all required information.");
			return false;
		} else if(t[i].value == "0" && t[i].type == "select-one" && t[i].title.indexOf("req") != -1){
			alert("Please verify that you have entered all required information.");
			return false;
		} else if(t[i].value == "" && t[i].type == "select-multiple" && t[i].title.indexOf("req") != -1){
			alert("Please verify that you have entered all required information.");
			return false;
		}
	}
	return true;
}

function sameAsAbove(t){
	if(t.checked == false){
		document.form1.AccountingFullName.value = "";
		document.form1.AccountingEmailAddress.value = "";
		document.form1.AccountingPhoneNumber.value = "";
	} else {
		document.form1.AccountingFullName.value = document.form1.FullName.value;
		document.form1.AccountingEmailAddress.value = document.form1.EmailAddress.value;
		document.form1.AccountingPhoneNumber.value = document.form1.YourPhoneNumber.value;
	}
}

function PromoRedirect(url){
	location.href=url;
}

function WebinarLink(){
	var qs = new Querystring();
	var CorrelationID = qs.get('_kt','');
	var CorrelationData = qs.get('_kk','');
	var CampaignID = qs.get('CampaignID','');
	document.write("<a href=\"default.aspx?v=1d0d9e72-10c6-41d1-895c-ac7a634d14c6&CampaignID=" + CampaignID + "&CorrelationID=" + CorrelationID + "&CorrelationData=" + CorrelationData +"\"><strong>Upcoming Webinars</strong></a>");
}

function NewsletterLink(){
	var qs = new Querystring();
	var Keywords = qs.get('Keywords','');
	var Policy = qs.get('Policy','');
	document.write("<a href=\"default.aspx?v=0f6dac24-fdf2-49db-8ce0-85d26f8a0084&Keywords=" + Keywords +"&Policy=" + Policy + "\"><strong>CLICK HERE TO GET YOUR FREE POLICY</strong></a>");
}

function WebinarHidden(){
	var qs = new Querystring();
	var CorrelationID = qs.get('CorrelationID','');
	var CorrelationData = qs.get('CorrelationData','');
	var CampaignID = qs.get('CampaignID','');
	document.write("<input type=\"hidden\" name=\"Campaign_ID\" value=\"" + CampaignID + "\" />");
	document.write("<input type=\"hidden\" name=\"00N80000002bKsH\" value=\"" + CorrelationID + "\" />");
	document.write("<input type=\"hidden\" name=\"00N80000002bKsI\" value=\"" + CorrelationData + "\" />");
}

function NewsletterHidden(){
	var qs = new Querystring();
	var Keywords = qs.get('Keywords','');
	var Policy = qs.get('Policy','');
	document.write("<input type=\"hidden\" name=\"Keywords\" value=\"" + Keywords + "\" />");
	document.write("<input type=\"hidden\" name=\"Policy\" value=\"" + Policy + "\" />");
}

function RetUrl(){
	document.form1.retURL.value = "http://www.cbancnetwork.com/webinar/webinar.aspx?WebinarID=" + document.form1.WebinarID.value + "&company=" + document.form1.company.value + "&first_name=" + document.form1.first_name.value + "&last_name=" + document.form1.last_name.value + "&email=" + document.form1.email.value + "&phone=" + document.form1.email.value + "&JobTitle=" + document.form1.JobTitle.value + "&Address_City=" + document.form1.Address_City.value + "&Address_State=" + document.form1.Address_State.value;
}


function Querystring(qs) {
// optionally pass a querystring to parse
	this.params = {};
	
	if (qs == null) qs = location.search.substring(1, location.search.length);
	if (qs.length == 0) return;

// Turn <plus> back to <space>
// See: http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13.4.1
	qs = qs.replace(/\+/g, ' ');
	var args = qs.split('&'); // parse out name/value pairs separated via &
	
// split out each name=value pair
	for (var i = 0; i < args.length; i++) {
		var pair = args[i].split('=');
		var name = decodeURIComponent(pair[0]);
		
		var value = (pair.length==2)
			? decodeURIComponent(pair[1])
			: name;
		
		this.params[name] = value;
	}
}

Querystring.prototype.get = function(key, default_) {
	var value = this.params[key];
	return (value != null) ? value : default_;
}

Querystring.prototype.contains = function(key) {
	var value = this.params[key];
	return (value != null);
}