﻿/*All Categories header0921.js*/
var HeaderCategories=function(){
	this.SetOptions();
	this.cButton=$("#"+this.options.cButton);
	this.cContent=$("#"+this.options.cContent);
	this.Initialization();
	this.timer=null;
	this.speed=this.options.speed;
	this.Over();
	this.Out();
	};
HeaderCategories.prototype={
	SetOptions:function(options){
		this.options={cButton:"all",cContent:"lists",speed:300};
			$.extend(this.options,options||{});
	},
	Initialization:function(){
		this.iHeightButton=this.cButton.height();
		this.iWidthButton=this.cButton.width();
		this.iTopButton=this.cButton.offset().top;
		this.iLeftButton=this.cButton.offset().left;
		this.cContent.css({top:this.iHeightButton+this.iTopButton,left:this.iLeftButton});
	},
	Over:function(){
		var _this=this;
		this.cButton.bind("mouseenter",function(event){_this.Initialization();
		if($(event.relatedTarget).parent("div").attr("id")==_this.options.cContent){
			_this.Show();
		}else{
			_this.timer=setTimeout(function(){_this.Show();},_this.speed);}
	});},
	Out:function(){
		var _this=this;
		this.cButton.bind("mouseleave",function(event){if($(event.relatedTarget).parent("div").attr("id")!=_this.options.cContent){_this.Hide();}clearTimeout(_this.timer);});this.cContent.bind("mouseleave",function(){_this.Hide();});},
	Show:function(){this.cButton.removeClass();this.cContent.css({visibility:"visible"});},
	Hide:function(){this.cContent.css({visibility:"hidden"});this.cButton.removeClass();}};


/*Popular Researches header0921.js*/
var PopularResearches=function(){
	this.SetOptions();
	this.pButton=$("#"+this.options.pButton);
	this.pContent=$("#"+this.options.pContent);
	this.Initialization();
	this.timer=null;
	this.speed=this.options.speed;
	this.Over();
	this.Out();
	};
PopularResearches.prototype={
	SetOptions:function(options){
		this.options={pButton:"popular",pContent:"p_lists",speed:300};
			$.extend(this.options,options||{});
	},
	Initialization:function(){
		this.iHeightButton=this.pButton.height();
		this.iWidthButton=this.pButton.width();
		this.iTopButton=this.pButton.offset().top;
		this.iLeftButton=this.pButton.offset().left;
		this.pContent.css({top:this.iHeightButton+this.iTopButton,left:this.iLeftButton});
	},
	Over:function(){
		var _this=this;
		this.pButton.bind("mouseenter",function(event){_this.Initialization();
		if($(event.relatedTarget).parent("div").attr("id")==_this.options.pContent){
			_this.Show();
		}else{
			_this.timer=setTimeout(function(){_this.Show();},_this.speed);}
	});},
	Out:function(){
		var _this=this;
		this.pButton.bind("mouseleave",function(event){if($(event.relatedTarget).parent("div").attr("id")!=_this.options.pContent){_this.Hide();}clearTimeout(_this.timer);});this.pContent.bind("mouseleave",function(){_this.Hide();});},
	Show:function(){this.pButton.removeClass();this.pContent.css({visibility:"visible"});},
	Hide:function(){this.pContent.css({visibility:"hidden"});this.pButton.removeClass();}};


var ToyCategories=function(){
	this.SetOptions();
	this.tButton=$("#"+this.options.tButton);
	this.tContent=$("#"+this.options.tContent);
	this.Initialization();
	this.timer=null;
	this.speed=this.options.speed;
	this.Over();
	this.Out();
	};
ToyCategories.prototype={
	SetOptions:function(options){
		this.options={tButton:"toys_c",tContent:"toy_lists",speed:300};
			$.extend(this.options,options||{});
	},
	Initialization:function(){
		this.iHeightButton=this.tButton.height();
		this.iWidthButton=this.tButton.width();
		this.iTotButton=this.tButton.offset().top;
		this.iLeftButton=this.tButton.offset().left;
		this.tContent.css({top:this.iHeightButton+this.iTotButton,left:this.iLeftButton});
	},
	Over:function(){
		var _this=this;
		this.tButton.bind("mouseenter",function(event){_this.Initialization();
		if($(event.relatedTarget).parent("div").attr("id")==_this.options.tContent){
			_this.Show();
		}else{
			_this.timer=setTimeout(function(){_this.Show();},_this.speed);}
	});},
	Out:function(){
		var _this=this;
		this.tButton.bind("mouseleave",function(event){if($(event.relatedTarget).parent("div").attr("id")!=_this.options.tContent){_this.Hide();}clearTimeout(_this.timer);});this.tContent.bind("mouseleave",function(){_this.Hide();});},
	Show:function(){this.tButton.removeClass();this.tContent.css({visibility:"visible"});},
	Hide:function(){this.tContent.css({visibility:"hidden"});this.tButton.removeClass();}};


var AllCategories=function(){
	this.SetOptions();
	this.aButton=$("#"+this.options.aButton);
	this.aContent=$("#"+this.options.aContent);
	this.Initialization();
	this.timer=null;
	this.speed=this.options.speed;
	this.Over();
	this.Out();
	};
AllCategories.prototype={
	SetOptions:function(options){
		this.options={aButton:"all_cates",aContent:"all_cates_lists",speed:300};
			$.extend(this.options,options||{});
	},
	Initialization:function(){
		this.iHeighaButton=this.aButton.height();
		this.iWidthButton=this.aButton.width();
		this.iToaButton=this.aButton.offset().top;
		this.iLefaButton=this.aButton.offset().left;
		this.aContent.css({top:this.iHeighaButton+this.iToaButton,left:this.iLefaButton});
	},
	Over:function(){
		var _this=this;
		this.aButton.bind("mouseenter",function(event){_this.Initialization();
		if($(event.relatedTarget).parent("div").attr("id")==_this.options.aContent){
			_this.Show();
		}else{
			_this.timer=setTimeout(function(){_this.Show();},_this.speed);}
	});},
	Out:function(){
		var _this=this;
		this.aButton.bind("mouseleave",function(event){if($(event.relatedTarget).parent("div").attr("id")!=_this.options.aContent){_this.Hide();}clearTimeout(_this.timer);});this.aContent.bind("mouseleave",function(){_this.Hide();});},
	Show:function(){this.aButton.removeClass();this.aContent.css({visibility:"visible"});},
	Hide:function(){this.aContent.css({visibility:"hidden"});this.aButton.removeClass();}};
