Shadowbox.init({
	modal: true,
	skipSetup: true,
	overlayOpacity: 0.8
});
var photos = new Array();
var sfeatures = new Array();
jQuery(function($){
	$('#gallery img').each(function(i){
		var photo = new Object();
		photo.player = 'img';
		photo.title = $(this).attr('alt')+'<a target="_blank" href="http://www.facebook.com/sharer.php?u='+escape(propertyURL+$(this).attr('src'))+'&t=' + escape(propertyTitle)+'"><img src="/magnetglobal/images/share_img.gif" width="85" height="18" class="fb_share_img" /></a>';
		photo.content = $(this).attr('src');
		photos[photos.length] = photo;
	});
	if ($('#home_ent_special_features img').length)
	{
		$('#home_ent_special_features img').each(function(i){
			var photo = new Object();
			photo.player = 'img';
			photo.title = $(this).attr('alt')+'<a target="_blank" href="http://www.facebook.com/sharer.php?u='+escape(propertyURL+$(this).attr('src'))+'&t=' + escape(propertyTitle)+'"><img src="/magnetglobal/images/share_img.gif" width="85" height="18" class="fb_share_img" /></a>';
			photo.content = $(this).attr('src');
			sfeatures[sfeatures.length] = photo;
		});
	}
	$('#quotes').cycle({ 
    	prev:   '#prev', 
    	next:   '#next', 
    	timeout: 8000,
		speed: 1000 
	});
	$('#photo_gallery').live('click',function(){
		Shadowbox.open(photos);
	});
	if ($('#special_features').length)
	{
		$('#special_features').live('click',function(){
			Shadowbox.open(sfeatures);
		});
	}
	$('a[rel=external],area[class=external]').click(function(){
		this.target = '_blank';
	});
	$('#share_facebook a').attr('href','http://www.facebook.com/sharer.php?u='+escape(propertyURL)+'&t=' + escape(propertyTitle));
	$('#share_twitter a').attr('href','http://twitter.com/home?status='+escape(propertyTitle));
	$('#share_stumble a').attr('href','http://www.stumbleupon.com/submit?url='+escape(propertyURL)+'&title='+escape(propertyTitle));
	$('#share_digg a').attr('href','http://digg.com/submit?phase=2&url='+escape(propertyURL)+'&title='+escape(propertyTitle));
	$('#share_email a').attr('href','http://www.addtoany.com/email?linkurl='+escape(propertyURL)+'&linkname='+escape(propertyTitle));
	$('#share_buzz a').attr('href','http://www.google.com/reader/link?url='+escape(propertyURL)+'&title='+escape(propertyTitle));
	$('#share_add a').attr('href','http://www.addtoany.com/share_save?linkname='+escape(propertyTitle)+'&linkurl='+escape(propertyURL));
});
