window.addEvent('domready', function()
{
	
	if ($('top_promo'))
	{
		var so = new SWFObject("/images/logo.swf", "sotester", "982", "232", "8", "#FFFFFF");
		so.addParam("scale", "noscale");
		so.addParam("wmode", "transparent");
		so.write("top_promo");

	}
	
	if ($('articles_left'))
	{
		var so = new SWFObject("/images/bannersmall.swf", "sotester", "195", "212", "8", "#FFFFFF");
		so.addParam("scale", "noscale");
		so.addParam("wmode", "transparent");
		so.write("articles_left");
	}
	
	$$('#menu ul li a.f_links').each(function(el)
	{
		$(el).addEvent('click', function()
		{
			$$('#menu .active').set('class', '');			
			this.getParent().set('class', 'active');
		});
	});
	
	if ($('icons'))
	{
		var myEffect = new Fx.Morph('search_box', {duration: '500'});
		$$('#open_search').addEvent('click', function(e)
		{
			new Event(e).stop();
			var height = $$('#search_box').getStyle('height');
			if (height != "0px")
			{
				myEffect.start({
					'height': [123, 0]
				});
			}
			else
			{
				myEffect.start({
					'height': [0, 123]
				});				
			}
		});
	}
	
	if ($('accordion'))
	{
		new Fx.Accordion($('accordion'), '#accordion h2', '#accordion .content');		
	}
	
	if ($('Product'))
	{
		$$('#Product .ProductDirectoryItem').addEvent('mouseenter', function()
		{
			var par_el = this.getChildren('.portfolio_info_text').get('id');
			par_el = new String(par_el);
			par_el = par_el.replace("portfolio_info_", "");
			var myEffect = new Fx.Morph('portfolio_info_' + par_el, {duration: '500', transition: 'back:out'});
			var p_height = this.getChildren('.portfolio_info_text').getStyle('height');
			myEffect.start({
				'height': [p_height, 150]
			});
			
			return false;
		});
		
		$$('#Product .ProductDirectoryItem').addEvent('mouseleave', function()
		{
			var par_el = this.getChildren('.portfolio_info_text').get('id');
			par_el = new String(par_el);
			par_el = par_el.replace("portfolio_info_", "");
			var myEffect = new Fx.Morph('portfolio_info_' + par_el, {duration: '500', transition: 'back:in'});
			var p_height = this.getChildren('.portfolio_info_text').getStyle('height');
			myEffect.start({
				'height': [p_height, 0]
			});
			
			return false;
		});
	}
	
	if ($('inner_text') && Browser.name != "ie")
	{
		/*Cufon.replace('h1 a', { fontFamily: 'Choco' });
		CufonRTL.RTL('h1 a');*/
	}
	
	
	
	$$('a.blank_link').each(function(el)
	{            
		el.setProperty('target', '_blank');
        });


	window.fbAsyncInit = function()
	{
		FB.init({appId: '106242839398814', status: true, cookie: true,
			xfbml: true});
	};
	(function()
	{
		var e = document.createElement('script'); e.async = true;
		e.src = document.location.protocol +
		'//connect.facebook.net/he_IL/all.js';
		document.getElementById('fb-root').appendChild(e);
	}());
	
	
});
