
if(!Array.indexOf){
	Array.prototype.indexOf = function(obj){
		for(var i=0; i<this.length; i++){
			if(this[i]==obj){
				return i;
			}
		}
		return -1;
	}
}

function GoTo(p_uri, p_target){
	if ( p_target ) {
		window.open( p_uri, p_target);
	}
	else {
		document.location.href=p_uri;
	}
}

function GoMail(){
	var email = "ma"
			  +"ilt"
			  +"o:"
			  +"supportfyahbwoy"
			  +"@"
			  +"gmail.com"
			  ;
	document.location.href = email;
}

MenuBottom = new function(){
	var _ClassNameItems="menuBottomItem";

	this.Init = function () {
		$("."+_ClassNameItems).bind('mouseenter mouseleave'
			, function() {
				$(this).toggleClass('menuBottomOn');
			}
		);
		$("."+_ClassNameItems).bind('click'
			, function() {
				GoTo( $(this).children(":first-child").children(":first-child").attr("href"), $(this).children(":first-child").children(":first-child").attr("target"));
			}
		);
	}

	this.Selected = function (p_className){
		$("."+p_className).parent().toggleClass('menuBottomOn');
	}

}

MenuTags = new function(){
	var _ClassNameItems="menuTagsItem";

	this.Init = function () {
		$("."+_ClassNameItems).bind('mouseenter mouseleave'
			, function() {
				$(this).toggleClass('menuTagsOn');
			}
		);
		$("."+_ClassNameItems).bind('click'
			, function() {
				GoTo( $(this).children(":first-child").children(":first-child").attr("href"), $(this).children(":first-child").children(":first-child").attr("target"));
			}
		);
	}
}

MenuSocial = new function(){
	var _ClassNameItems="menuSocialItem";

	this.Init = function () {
		$("."+_ClassNameItems).bind('mouseenter mouseleave'
			, function() {
				$(this).toggleClass('menuSocialOn');
			}
		);
		$("."+_ClassNameItems).bind('click'
			, function() {
				GoTo( $(this).children(":first-child").children(":first-child").attr("href"), $(this).children(":first-child").children(":first-child").attr("target"));
			}
		);
	}
}

$(document).ready(
	function() {
		MenuSocial.Init();
		MenuBottom.Init();
		MenuTags.Init();
	}
);
