$(document).ready(function() {
    $.fn.qtip.styles.paladin2 = { // Last part is the name of the style
	width: 438,
	padding: 0,
	background: '#FFF',
	color: '#454545',
	tip: { size: { x: 25, y: 25 },corner:'topRight'} ,
	border: {
	    width: 7,
	    radius: 6,
	    color: '#1a5d89'
	},
	textAlign:'left',
	name: 'blue' // Inherit the rest of the attributes from the preset dark style
    }

    $.fn.qtip.styles.paladin3 = { // Last part is the name of the style
	width: 438,
	padding: 0,
	background: '#FFF',
	color: '#454545',
	tip: { size: { x: 25, y: 25 },corner:'bottomLeft'} ,
	border: {
	    width: 7,
	    radius: 6,
	    color: '#1a5d89'
	},
	textAlign:'left',
	name: 'blue' // Inherit the rest of the attributes from the preset dark style
    }
    
    $.fn.qtip.styles.paladin4 = { // Last part is the name of the style
	width: 438,
	padding: 0,
	background: '#FFF',
	color: '#454545',
	tip: { size: { x: 25, y: 25 },corner:'bottomRight'} ,
	border: {
	    width: 7,
	    radius: 6,
	    color: '#1a5d89'
	},
	textAlign:'left',
	name: 'blue' // Inherit the rest of the attributes from the preset dark style
    }


    $("#masthead-icons-kiplinger").qtip({
	content:$("#tooltip3_content"),
	show:"mouseover",
	hide:"mouseout",
	position: {
	    corner: {
		target: "bottomMiddle",
		tooltip:"topRight"
	    }
	},
	style:"paladin2"
    });

    $("#footer-icons-kiplinger").qtip({
	content:$("#tooltip3_content"),
	show:"mouseover",
	hide:"mouseout",
	position: {
	    corner: {
		target: "topMiddle",
		tooltip:"bottomRight"
	    }
	},
	style:"paladin4"
    });

    $("#fivestar_tip").qtip({
	content:$("#tooltip1_content"),
	show:"click",
	hide:"unfocus",
	position: {
	    corner: {
		target: "topMiddle",
		tooltip:"bottomLeft"
	    }
	},
	style:"paladin3"
    });

    $("#privacy_tip").qtip(
    {
	content: {
	    title: {
		text: $("#tooltip_privacy_content .tooltip_title").html(),
		button: 'Close'
	    },
	    text: $("#tooltip_privacy_content .tooltip_content").html()
	},
	position: {
	    target: $(document.body), // Position it via the document body...
	    corner: 'center' // ...at the center of the viewport
	},
	show: {
	    when: 'click', // Show it on click
	    solo: true // And hide all other tooltips
	},
	hide: false,
	style: {
	    width: { max: 400 },
	    padding: '10px',
	    border: {
		width: 6,
		radius: 6,
		color: '#1a5d89'
	    },
	    name: 'light'
	}
    });

    $("#landing-form").validationEngine({
	"telephone" : {
	    "regex":"/^\(\d{3}\)\d{9}$/",
	    "alertText":"* Invalid phone number"
	}
    });

    $("#telephone_code").autotab({ target: "telephone_number", format: "numeric" });
    $("#telephone_number").autotab({ target: "telephone_number_2", format: "numeric", previous: "telephone_code" });
    $("#telephone_number_2").autotab({ previous: "telephone_number", format: "numeric" });
    
    $("select[name='asset_amount']").selectbox();
    $("#asset_amount_input").addClass("validate[required,exemptString[Select the range that applies to you]]");
});
