﻿var browser = '';
var ua = navigator.userAgent;
if (ua.indexOf("MSIE")!=-1){ browser = "MSIE"; } else if (ua.indexOf("Firefox")!=-1){ browser = "FF"; }

var siteFrm = null;
window.onload = PageLoad;
function PageLoad() {
    
    siteFrm = document.forms[0];

   // Lightbox.fShowLoginFrame();
}


function edit_user_validate(email,pass,bPass)
{
    if(email == "" || pass == "" || bPass == "")
    {
         return false;
    }
    if(pass != bPass)
    {
        return false;
    }
    return true;
}

function form_keyDown(event)
{
    if(event.keyCode == 13)
    {
        find_user();
        return false;
    }
    return true;
}


function onOverDiv(_div)
{
    document.getElementById(_div).style.display='inline';
}

function onOutDiv(_div)
{
    document.getElementById(_div).style.display='none';
}
function outTab(tab)
{
    tab=document.getElementById(tab);
    if(browser != "FF")
    {
        var rightDiv=tab.childNodes[0];
        var centerDiv=tab.childNodes[1];
        var leftDiv=tab.childNodes[2];   
    }
    else
    {
       var rightDiv=tab.childNodes[1];
       var centerDiv=tab.childNodes[3];
       var leftDiv=tab.childNodes[5]; 
    }
    rightDiv.className="tabRight tabRightYellow";
    centerDiv.className="tabCenter tabCenterYellow";
    leftDiv.className="tabLeft tabLeftYellow";
}
function overTab(tab)
{
    tab=document.getElementById(tab);
    if(browser != "FF")
    {
        var rightDiv=tab.childNodes[0];
        var centerDiv=tab.childNodes[1];
        var leftDiv=tab.childNodes[2];   
    }
    else
    {
       var rightDiv=tab.childNodes[1];
       var centerDiv=tab.childNodes[3];
       var leftDiv=tab.childNodes[5]; 
    }
    rightDiv.className="tabRight tabRightYellowRo";
    centerDiv.className="tabCenter tabCenterYellowRo";
    leftDiv.className="tabLeft tabLeftYellowRo";
}
function onOverTab(aText,curPage,page,wrapper)
{
    if(curPage=="home.aspx")
    {
        //overTab(wrapper);  
        $(aText).style.color="black";      
    }
    else if(curPage!=page)
    { 
        $(aText).style.color="white";
   }
    
}
function onOutTab(aText,curPage,page,wrapper)
{
    if(curPage=="home.aspx")
    {
        $(aText).style.color="black";
        //outTab(wrapper);        
    }
    else if(curPage!=page)
    {
        $(aText).style.color="black";
    }
}

function onOverMenu(menu,className)
{
    
    menu.className=className;
    
}
function onOutMenu(menu,className)
{
    menu.className=className;
}

function selectText(input,valueToSelect)
{	
    if(!input)return;
	if(input.value.indexOf(valueToSelect)==-1)return;
	if(input.createTextRange)
		input.createTextRange().select(); 			
	else				
		input.setSelectionRange(0,input.value.length); 			
}
function getCookie(c_name)
{
	if (document.cookie.length>0)
	  {
	  c_start=document.cookie.indexOf(c_name + "=");
	  if (c_start!=-1)
		{ 
		c_start=c_start + c_name.length+1; 
		c_end=document.cookie.indexOf(";",c_start);
		if (c_end==-1) c_end=document.cookie.length;
		return unescape(document.cookie.substring(c_start,c_end));
		} 
	  }
	return "";
}



/****************************************************************/

function fIconOver(e, activator, iconName) {
    /*window.status = activator.id;
    var iconDiv = $A("div", iconName, activator.parentNode)[0];
    if (iconDiv == null) return;
    if (activator.parentNode.id == "cell")
        $('dMedia').style.zIndex = "4";
    if (activator.parentNode.id == "dMedia")
        $('cell').style.zIndex = "4";
    var text = $A("div", "bold", activator.parentNode)[0];
    text.style.display = "none";
    iconDiv.style.display = "block";
    activator.style.zIndex = "10";*/
    activator.className = "iconBoxOn " + iconName;
    var bold = $A("div", "bold", activator)[0];
    var text = $A("div", "txt", activator)[0];
   // bold.style.display = "none";
   // text.style.display = "block";
}

var temp=0;
function fIconOut(e, activator, iconName) {
    if (e == null) e = window.event;
  
    if(e.toElement)
        if (e.toElement.className != "leftIconsBar" && fIsToCloseIcon(activator, e.toElement, iconName)) {  return; }
//    if(temp ==0)
//    {
//        temp = 1;
//        window.status = e.toElement.className + "-" + e.toElement.parentNode.className.indexOf(iconName) + "--" + iconName;
//    }
    activator.className = "iconBox " + iconName;
    var bold = $A("div", "bold", activator)[0];
    var text = $A("div", "txt", activator)[0];
    //bold.style.display = "block";
   // text.style.display = "none";

}

function fIsToCloseIcon(activator, toElement, iconName) {

    var toParentClassName = toElement.parentNode.className;
    //window.status = toParentClassName.indexOf(iconName);
    if (toParentClassName.indexOf(iconName) == -1 && toElement.className.indexOf(iconName)==-1) return false;
    
    return true;
    
}
/*function fIconOut(activator, iconName) 
{
    var e = window.event
    window.status += "-" + e.srcElement.className + "-";
    var iconDiv = $A("div", iconName, activator.parentNode)[0];
    var text = $A("div", "bold", activator.parentNode)[0];
    if (text != null) {
        text.style.display = "block";
        iconDiv.style.display = "none";
        activator.style.zIndex = "5";
    }
}*/


/*************************************************
    INNER PAGES
/*************************************************/

/***** ContactUs.aspx *****/
function showInput() 
{
    $('guide').style.display = "none"
    $('addressDiv').style.display = "none"
    if ($('subject').value == "בקשה לקבלת מדריך") 
    {
        $('guide').style.display = "inline";
        $('addressDiv').style.display = "inline";
    }

}

/***** END ContactUs.aspx *****/
