/************************************************************
 _____         _   __  __                  ____
|  ___|_ _ ___| |_|  \/  | ___ _ __  _   _|___ \
| |_ / _` / __| __| |\/| |/ _ \ '_ \| | | | __) |
|  _| (_| \__ \ |_| |  | |  __/ | | | |_| |/ __/
|_|  \__,_|___/\__|_|  |_|\___|_| |_|\__,_|_____|

* FastMenu2 - Dynamic HTML menus by Idan-Hadli
* FastCart2 / FastWeb2 / FastList2 Web application
* The Hebrew E-commerce and web content Solution
* by Idan-Hadli
* ver 2.1.3 11/2006
*
*************************************************************
*    PLEASE NOTE, THIS SOFTWER IS COPYRIGHT PROTECTED!      *
*************************************************************
*
* Copyright (c) 1998-2007 Idan-Hadli
* All rights reserved.
* http://idan-hadli.net   web@idan-hadli.net
*
*************************************************************/

var timer;
var fw2TblWdt=765;
var topOfst=427;
var lftOfst=680;
//===================================
//-----------------------------------------------
function dotimeout(menu){
	if (menu) {
		timer = setTimeout("fmClean('" + menu + "')",150);
	}
}
//-----------------------------------------------
function stoper() {
	clearTimeout(timer);
}
//-----------------------------------------------
function fastmenuClean() {
	if (myHomeMenu[menu]) {
		for (g=0;g<myHomeMenu.length;g++) {
			document.getElementById(myHomeMenu[g]).style.visibility = "hidden";
		}
	}
}
//-----------------------------------------------
function fmClean(menu) {
	if (myHomeMenu[menu]) {
		document.getElementById(menu).style.visibility = "hidden";
	}
}
//-----------------------------------------------
function findPos(obj) {
	var curleft = 0;
	var curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}
//-----------------------------------------------
function buildHomeMenu(menu) {
	var myTopPos = 0;
	var myLeftPos = 0;
	var myTmenu="";

	if (myHomeMenu[menu]) {
		myTmenu = myTmenu + "<div onMouseOut=dotimeout('"+menu+"'); onMouseOver=stoper(); id='dt"+menu+"'><center><table border='0' cellspacing='2' cellpadding='3' width='200' dir='rtl' id='" +menu +"' style='visibility: hidden; ;  padding: 0px 0px 0px 0px; position: absolute; left: " + myLeftPos + "px ; top: " + myTopPos + "px; z-index: 200' bgcolor='#336799'>";
		for (i=0;i<myHomeMenu[menu].length;i++) {
			myTmenu += "<tr><td width='100%' align='right' bgcolor='#E1E6EA' onMouseOver='this.style.background=r=\"#F0D181\"' onMouseOut='this.style.background=\"#E1E6EA\"'>";
			myTmenu += "<a href='" + myHomeMenuUrl[menu][i] + "' style='text-decoration: none'><span class='nav_simania' style='text-decoration: none'>" + myHomeMenu[menu][i]+ "</span></a></td></tr>";
		}
		myTmenu = myTmenu + "</table></center></div>";
		document.write(myTmenu);
	}
}
//-----------------------------------------------
function fastmenu(menu,catid) {
	if (document.getElementById(menu)) {
		document.getElementById(menu).style.left = ((getwSize()-fw2TblWdt)/2) + (lftOfst - document.getElementById(catid).offsetWidth);
		document.getElementById(menu).style.top = document.getElementById(catid).offsetTop + topOfst;
		document.getElementById(menu).style.visibility = "visible";
	}
}
//-----------------------------------------------
function getwSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  return myWidth;
}

