﻿

$DL(
	function(){
		if(screen.width<=800){
			$(document.documentElement).setStyles({'overflow-x':'hidden'});	
			document.documentElement.scrollLeft=50;
		}		
		
		if(Config.IsHomePage){
			  var myMenu = new ImageMenu($$('#imageMenu .Slash'),{open:null ,openWidth:300, border:0 });
		}
		else BrandManu.Init();				
		
		$$(".view-more").each(function(item){
			item.setStyles({opacity:.7});
		});
		//Progress.Init();
		if($("products-list")){
			var next=$("products-list").getElement(".next");			
			
			if(next){
				next.setStyles({opacity:.7});
				next.addEvent("mouseenter",function(){
				next.setStyles({opacity:1});
				});
				next.addEvent("mouseleave",function(){
					next.setStyles({opacity:.7});
				});
			}
			
			var prev=$("products-list").getElement(".prev");
			if(prev){
				prev.setStyles({opacity:.7});						
							
				prev.addEvent("mouseenter",function(){
					prev.setStyles({opacity:1});
				});
				prev.addEvent("mouseleave",function(){
					prev.setStyles({opacity:.7});
				});
			}	
		}
	}
);

var Config={
	SiteUrl:null,
	UploadPath:null,
	IsHomePage:null
};

var BrandManu={	
	Init: function(){		
		$$("#brandlist .list li.item").each(function(li,index){			
			li.setOpacity(.4);
			if(typeof brandName!="undefined"){
				if(li.id==brandName) li.setOpacity(1);
				else this.CreateOver(li, index)
			}
			else this.CreateOver(li, index)
		}, this);
	},
	CreateOver: function(el, i){		
		var fx = new Fx.Styles(el, {'duration': 200, wait: false});		
		el.addEvent("mouseenter",function(){			
			fx.start({opacity: 1});			
		});
		el.addEvent("mouseleave",function(){			
			fx.start({opacity: .4});			
		});
	}
};

function hideContents() {
	BrandHp.InProgress = true;
}

function revealContents() {
	BrandHp.InProgress = false;
}

 
var Progress={
	El:null,
	Fx:null,
	Init:function(){
		this.El=$("body").getElement(".progress");
		if(this.El){
			this.El.setStyles({opacity:.7});			
			this.Fx = new Fx.Styles(this.El, {"duration": 500, wait: false,transition: Fx.Transitions.Quart.easeOut});		
		}		
	},
	Show:function(){		
		if(this.Fx) Progress.Fx.start({height: 30});
	},
	Hide:function(){
		if(this.Fx) Progress.Fx.start.delay(1000,this.Fx,{height: 0});
	}
}

var Resources={
	RegisterCssFile:function(href){
		var headID = document.head;
		var cssNode = document.createElement("link");
		cssNode.type = "text/css";
		cssNode.rel = "stylesheet";
		cssNode.href = href;	
		headID.appendChild(cssNode);
	}
};


      function Add2Favorites(){
            var title = "תותחני אינווסטמנט  - מוצרי יוקרה למטבח";
            var url = 'http://www.tothani.co.il';
            if (window.sidebar){
                // Mozilla Firefox Bookmark
                window.sidebar.addPanel(title, url,"");}
            else if( window.external ){
                // IE Favorite
                window.external.AddFavorite(url, title);}}
                
