jQuery (document).ready(function(){


	jQuery(".Details:not(.FullDescription):not(.Hardware):not(.RHP)").each(
		function(){
			jQuery(this).qtip({
				content: jQuery(jQuery(this).attr('details')),
				style: {color:"#737373",
				padding: "1px", 
				border: { 
					width: 3, 
					radius: 0,
					color:"#c0bfbf" 
				}, 
				width: { max: 350 } 
			},
			position : {
				corner: { target: "topLeft", tooltip: "bottomLeft" },
				adjust: { screen: true }
			}
		})
	});

	jQuery(".Details.Hardware").each(
		function(){
			jQuery(this).qtip({
				content: jQuery(jQuery(this).attr('details')),
					style: {color:"#737373",
					padding: "1px",
					lineHeight : "120%",
					backgroundColor:"#E7E7E7",
					border: { 
						width: 0, 
						radius: 0,
						color:"#c0bfbf" 
					}, 
					width: { max: 260 } ,
				classes: {
					tooltip: 'qtip-hardware'
				}
				},
			position : {
				corner: { target: 'topRight', tooltip: 'bottomRight' },
				adjust: { screen: true }
			},
			show: { when: {  /* event: 'click' */ } },
			hide: { when: {  /* event: 'unfocus' */ }, fixed: false },
			api: {
				beforeShow: function(){
					jQuery(this.elements.target).addClass('active');

				},
				onHide: function(){
					jQuery(this.elements.target).removeClass('active');
				}
			}
		})
	});

	jQuery('.FullDescription, .RHP').each (function(){
		
			var width = 475;
		    if (jQuery(this).hasClass('RHP')) {
				width = {min: 250};
			}
		
			jQuery(this).qtip({
				content: jQuery(jQuery(this).attr('details')),
				style: {padding: "1px",
				backgroundColor:"#E7E7E7",
				width: width,
				classes: {
					tooltip: 'qtip-details'
				},
				border: {
					width: 0,
					radius: 0,
					color:"#c0bfbf"
				}
			},
			position : {
				corner: {
					target: 'bottomRight',
					tooltip: 'topRight'
				}
			},
			show: { when: {  /* event: 'click' */ } },
			hide: { when: {  /* event: 'unfocus' */ }, fixed: false },

			api: {
				beforeShow: function(){
					jQuery(this.elements.target).addClass('active');

				},
				onHide: function(){
					jQuery(this.elements.target).removeClass('active');
				}
			}
		});
		
		
	});

	jQuery("span.free span.val").each(
		function(){
			var ctxt = jQuery(this)
			var amt = jQuery.trim(ctxt.text());
			var arrAmt = amt.split(amt.indexOf('$') == 0 ? "." : ",");
			var cents = arrAmt[1] ? arrAmt[1]: "00";
			var mo = ctxt.next('.month');
			
			ctxt.html("<span class='dollars'>"+arrAmt[0]+"<span class='cents'>"+cents+ "</span></span>");
			
			ctxt.find('.cents').append(mo);
			ctxt.find('.cents').append(ctxt.parent().next('sup'));

		}
	);

	jQuery(".priceDisplay").each(
		function(){
			var arrAmt = jQuery(this).text().split(".");
			var cents = parseInt(arrAmt[1]);
			cents = cents ? cents : "00";
			var dollars = arrAmt[0];
			jQuery(this).html("<span class='dollars'>"+dollars+"</span><span class='cents'>"+cents+"</span>");
		}
	);
	

});


