﻿
// functions
$.setNoticesByType = function() {

	if ($("[id$='rblCPK_1']").is(':checked')) {
		$("#CPK-alert").show("slow");
		if ($("[id$='chkForwardContract']").not(':checked')) {
			$("#CPK-info").show("slow");
		}
	} else {
		$("#CPK-info").hide("slow");
		$("#CPK-alert").hide("slow");
	}

	if ($("[id$='chkForwardContract']").is(':checked')) {
		$("#FC-info").show("slow");
		$("#CPK-info").hide("slow");
	} else {
		$("#FC-info").hide("slow");
	}
}

function Count(txt, long) {
	var maxlength = new Number(long); 
	if (txt.value.length > maxlength) {
		txt.value = txt.value.substring(0, maxlength);
		alert(long + " character maximum");
	}
}


// jquery initialize:
$(document).ready(function() {
	$(function() { $(".lavaLamp").lavaLamp({ fx: "easeOutQuad", speed: 500 }) });

	$('A[rel="help"]').click(function() {
		window.open($(this).attr('href'), '_blank', 'status=0, menubar=0, location=0, toolbar=0, scrollbars=1, width=350, height=450');
		return false;
	});

	$('A[rel="external"]').click(function() {
		window.open($(this).attr('href'));
		return false;
	});

	$('ul#fader').innerfade({
		speed: 2000,
		timeout: 5000,
		type: 'random_start',
		containerheight: '157px'
	});

	$('a[href^="http://"]').each(function() {
		$('<img width="10px" height="10px" style="margin-left: 3px;" src="/images/skin/external.png" alt="External Link" />').appendTo(this)
	});

	$('input, textarea').focus(function() {
		$(this).css('border', '1px solid #60bb46');
		$(this).css('background-color', '#e7e7e7');
	});
	$('input, textarea').blur(function() {
		$(this).css('border', '1px solid #aaabad');
		$(this).css('background-color', '#f3f3f3');
	});

	// fancy gradients
	$("h1").prepend("<span></span>");
	$("h2").prepend("<span></span>");


});

