var addthis_pub				= '[Site name]'; 
var addthis_logo			= '[add_this_logo]';
var addthis_logo_background	= 'ffffff';
var addthis_logo_color		= '201910';
var addthis_brand			= 'IUC';
var addthis_options			= 'favorites, email, delicious, google, digg, reddit, facebook, live, more';

CD3.Behaviors({
	'body': {
		'focus:in': {
			'input[type=text]': function(){
				if (this.getValue() == this.getAttribute('title')) this.setValue('');
			}
		},
		'focus:out': {
			'input[type=text]': function(){
				if (this.getValue().length == 0) this.setValue(this.getAttribute('title') || '');
			}
		}
	},
	'#text_size': function(){
		new CD3.FontSwitcher(this, 'content', {
			reset:	'.reset',
			plus:	'.plus',
			minus:	'.minus'
		});
	},
	'#bookmark': {
		mouseover: function(){
			addthis_open(this, '', location.href, addthis_pub)
		},
		mouseout: addthis_close,
		click: addthis_sendto
	},
	'#categories_menu': function(){
		new CD3.Accordion(this, {
			triggers: 'dd',
			content:  'dt'
		});
	},
	'#controls': function(controls){
		var head = $('product_head');
		
		new CD3.Slider(head, {
			prev: 		controls.down('.up_arrow'), 
			next: 		controls.down('.down_arrow'),
			scrollBy:	105,
			scrollType: 'vertical'
		});
		
		head.delegate('a', 'click', function(e){
			e.stop();
			var index   = this.up('li').previousSiblings().length,
				gallery = $('gallery');
			
			gallery.select('.first').invoke('removeClassName', 'first');
			gallery.down('li', index).addClassName('first');
			
			$('image_title').innerHTML = this.innerHTML;
		});
	},
	'#big_image':function(){
		var FlashVars = {};
		var s = { menu:'false', wmode:"transparent" };
		swfobject.embedSWF("/swf/BMD-header.swf", "big_image", "309", "200", "9.0.0" , "expressInstall.swf" , FlashVars , s );
	}
});
