$j(document).ready(function() {
	function externalLinks()
	{
		if (!document.getElementsByTagName) return;
		var anchors = document.getElementsByTagName("a");
		for (var i=0; i<anchors.length; i++)
		{
		 var anchor = anchors[i];
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") anchor.target = "_blank";
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") anchor.className = "outside";
	
		}
	}
	externalLinks();
	// Notice the use of the each() method to acquire access to each elements attributes
	$j('body a[tooltip]').each(function(){
		$j(this).qtip({
			content: $j(this).attr('tooltip'), // Use the tooltip attribute of the element for the content
			position: { target: 'mouse' },
			style: {
				padding: 5,
				background: '#ffffff',
				color: '#000000',
				textAlign: 'left',
				
				border: {
					width: 5,
					radius: 5,
					color: '#fff'
				}
				
			}
		});
	});
	
	
	// Notice the use of the each() method to acquire access to each elements attributes
	$j('body a.tooltip_try').each(function(){
		$j(this).qtip({
			content: $j(this).attr('tooltip_try'), // Use the tooltip attribute of the element for the content
			position: {
				corner: {
				   target: 'center'
				},
				target: 'mouse',
				adjust: { 
					mouse: true,
					screen: true,
					resize: true
				}
			},
			style: {
				padding: 5,
				background: '#fff',
				color: '#000',
				textAlign: 'left',
				border: {
					width: 5,
					radius: 5,
					color: '#fff'
				}
			},
			show: {
				delay: 50
			}
		});
	});
	
	$j('#box_fiu img').each(function(){
	var item  =$j(this).attr("title");
		var content = '/_scripts/make_tt_slideshow.php?img='+item+'&w=fiu';
		// Setup
		$j(this).qtip(
			{
			content: {
				url : content
			} ,
			position: {
				corner: {
				   target: 'center'
				},
				adjust: {
					screen: true,
					resize: true
				},
			},
			style: {
				width: 480,
				height:420,
				padding: 0,
				background: '#000',
				color: 'black',
				textAlign: 'center',
				border: {
					width: 5,
					radius: 0,
					color: '#000'
				},
				tip: {
					corner: 'rightMiddle',
					color: '#000',
					size: {
						x: 25,
						y : 25
					}
				}
			},
			show: {
			delay: 300,
			effect: { type: 'fade', length: 150 } },
			hide: { 
				fixed: true,
				effect: { 
					type: 'fade', length: 150 } 
				}
		});
		$j(this).maxZIndex({ inc: 10 });
	});
});



