﻿//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
document.onkeypress 	    = document_onEnterPress;
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function document_onEnterPress(e) 
{
	try
	{
	    var code			= (window.event) ? event.keyCode    : e.keyCode;
        var input			= (window.event) ? event.srcElement : e.target;

		if(input && code==13)
		{
			if(input.tagName.toUpperCase()=="TEXTAREA")	return true;
			
            switch(input.id)
            {
				case 'Master_ContentPlaceHolder1_senderName': 
				case 'Master_ContentPlaceHolder1_senderAddress': 
				case 'Master_ContentPlaceHolder1_recipientName': 
				case 'Master_ContentPlaceHolder1_recipientAddress': 
				case 'Master_ContentPlaceHolder1_message2Recipient': 
				case 'Master_ContentPlaceHolder1_sendRecomendation': 

					WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("Master$ContentPlaceHolder1$sendRecomendation", "", true, "ValidationGroup2", "", false, true));
                     
 					return false;
				break; 				
				case 'Master_ContentPlaceHolder1_contactFirst': 
				case 'Master_ContentPlaceHolder1_contactLast': 
				case 'Master_ContentPlaceHolder1_contactEmail': 
				case 'Master_ContentPlaceHolder1_contactTheme': 
				case 'Master_ContentPlaceHolder1_contactDetail': 
				case 'Master_ContentPlaceHolder1_contactPhone': 
				case 'Master_ContentPlaceHolder1_contactPrefix': 
				case 'Master_ContentPlaceHolder1_contactSendButton': 

					WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("Master$ContentPlaceHolder1$contactSendButton", "", true, "ValidationGroup1", "", false, true));
                     
 					return false;
				break; 				
				case 'Master_ContentPlaceHolder1_emailRemoval': 
				case 'Master_ContentPlaceHolder1_removalButton': 

					WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("Master$ContentPlaceHolder1$removalButton", "", true, "ValidationGroup5", "", false, true));
                     
 					return false;
				break; 				
				case 'Master_ucMailingListRegistration_email2reg': 
				case 'Master_ucMailingListRegistration_mailingButton': 

					WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("Master$ucMailingListRegistration$mailingButton", "", true, "ValidationGroup200", "", false, true));
                     
 					return false;
				break; 				
				case 'Master_ContentPlaceHolder1_firstNameML': 
				case 'Master_ContentPlaceHolder1_lastNameML': 
				case 'Master_ContentPlaceHolder1_emailML': 
				case 'Master_ContentPlaceHolder1_addressML': 
				case 'Master_ContentPlaceHolder1_mailinglistButton': 

					WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("Master$ContentPlaceHolder1$mailinglistButton", "", true, "ValidationGroup5", "", false, true)); 					

 					return false;
				case 'Master_ContentPlaceHolder1_emailLogin': 
				case 'Master_ContentPlaceHolder1_passwordLogin': 
				case 'Master_ContentPlaceHolder1_nextButton': 

					WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("Master$ContentPlaceHolder1$nextButton", "", true, "ValidationGroup1", "", false, true));
                     
 					return false;
				break; 
				case 'Master_ContentPlaceHolder1_passwordOld': 
				case 'Master_ContentPlaceHolder1_password': 
				case 'Master_ContentPlaceHolder1_confirm': 
				case 'Master_ContentPlaceHolder1_sendButton': 

					WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("Master$ContentPlaceHolder1$sendButton", "", true, "ValidationGroup1", "", false, true));
                     
 					return false;
				break; 
				case 'Master_ContentPlaceHolder1_emailReminder': 
				case 'Master_ContentPlaceHolder1_reminderButton': 

					WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("Master$ContentPlaceHolder1$reminderButton", "", true, "ValidationGroup1", "", false, true));
                     
 					return false;
				break; 				
				case 'Master_ucHeader_ucSearchBar_searchText': 
				case 'Master_ucHeader_ucSearchBar_searchButton': 

					inputFocus('Master_ucHeader_ucSearchBar_searchText', 'הזן טקסט לחיפוש');
					WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("Master$ucHeader$ucSearchBar$searchButton", "", true, "ValidationGroup100", "", false, true));                   
 					
 					return false;
				break; 				
				default:
 					return false;
				break; 
            }    
		}
    }
    catch(e){ws(e.description);}
    finally
    {
    }
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function brandSearch(o, url)
{
//	alert(url)
	
	window.location.href			= url;

	return false;
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function siteBack(me)
{
	window.history.back();
	
	return false;
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function setUserMode(me, id)
{
	var radio						= document.getElementById(id);

	if(radio)	radio.checked		= true;
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function beforeUnload()
{
	window.onbeforeunload			= null;
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function openRegulationDocument(me, src)
{
	showPopWin(src, 560, 510, '', true, '', 'no', 'popup_class');

	return false;
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function openDeliveryPossibility(me, src)
{
	showPopWin(src, 560, 220, '', true, '', 'yes', 'popup_class');

	return false;
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function openReceiverDetails(me, src)
{
	me.CHECKED				= true;

	showPopWin(src, 790, 510, reNewBasket4, true, '', 'no', 'popup_class');

	return true;
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function closeReceiverDetails(me)
{
	me.CHECKED				= true;
	
	top.hidePopWin(true);
	
	return true;
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function openDeliveryDetails(me, src)
{
	showPopWin(src, 560, 420, '', true, '', 'no', 'popup_class');
	
	return false;
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function openRelatedVariants(me, src, title)
{
	showPopWin(src, 700, 500, reNewBasket3, true, '', 'no', 'popup_class');
	
	return false;
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function closeRelatedVariants(me)
{
	top.reNewBasket3();
	
	top.hidePopWin(false);

	return false;
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function afterAdd2Cart(url, popupurl)
{
	reNewBasket(url);
	
	showPopWin(popupurl, 360, 310, reNewBasket4, true, '', 'no', 'popup_class');
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function closeAfterAdd2Cart()
{
	reNewBasket4();
	
	top.hidePopWin(false);
	
	return false;
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
/*
function add2basketMsgBox()
{
	if(!window.src)					return;
	
	showPopWin(window.src, 360, 250, redir, true, '', 'no', 'popup_class');
	
	return false;
}
*/
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function closeMsgBox()
{
	top.hidePopWin(false);
	
	return false;
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function recommendation(me, src, pid, vid, fid, did)
{
	src								= src + '?pid=' + pid + '&vid=' + vid + '&fid=' + fid + '&did=' + did;

	showPopWin(src, 550, 330, '', true, '', 'no', 'popup_class');
	
	return false;
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function showBranchMap(me, src)
{
	showPopWin(src, 550, 330, '', true, '', 'no', 'popup_class');
	
	return false;
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function moreInfo(me, src, title)
{
	showPopWin(src, 360, 330, '', true, title, 'no', 'popup_class');
	
	return false;
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function faqOnMouse(o, evnt, answerId)
{
    var answer						= document.getElementById(answerId);

	switch(evnt)
	{
		case 'onmouseover':
		
		    if(isNone(answer))          
			{
				o.className			= 'faq_qeustion_h';
			}
		break; 
		case 'onmouseout':
		
		    if(isNone(answer))          
			{
				o.className			= 'faq_qeustion';
			}
		break; 
		case 'onclick':
		
			faqOpenClose(o, answerId);
		break; 
	}
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function faqOpenClose(o, answerId)
{
    var answer						= document.getElementById(answerId);
    
    if(isNone(answer))          
    {
        inline(answer);
        o.className					= 'faq_qeustion_s';
    }
    else
    {
        none(answer);
        o.className					= 'faq_qeustion';
    }
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function inputFocus(id, txt)
{
	try
	{
		var me						= document.getElementById(id);

		if(me.value==txt) 
		{
			me.value				= '';
		}
	}
	catch(e)
	{
	}
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function inputBlur(id, txt)
{
	try
	{
		var me						= document.getElementById(id);

		if(me.value=='') 
		{
			me.value				= txt;
		}
	}
	catch(e)
	{}
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function redir(rtn)
{
	window.location.href			= window.redirect;
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function reNewBasket(url)
{
	window.frames['basketDetails'].frameElement.src	= url;
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function reNewBasket2()
{
	if(document.getElementById("Master_ContentPlaceHolder1_iframeUrl"))
	{
		window.frames['basketDetails'].frameElement.src	= document.getElementById("Master_ContentPlaceHolder1_iframeUrl").value;
	}
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function reNewBasket3()
{
	if(document.getElementById("Master_ContentPlaceHolder1_currentUrl"))
	{
		window.location.href							= document.getElementById("Master_ContentPlaceHolder1_currentUrl").value;
	}
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function reNewBasket4()
{
	top.window.location.reload();
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function reNewPage()
{
	document.forms[0].submit();
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function showImage(me, pic, picAlt, logo, logoAlt)
{
//	alert(pic+' - '+picAlt);
//	alert(logo+' - '+logoAlt);
	
	if(pic!='')
	{
		me.innerHTML		= '<image border="0" class="pic_variant_additional" src="'+pic+'" alt="'+picAlt+'" title="'+picAlt+'" />';
	}
	if(logo!='')
	{
		me.innerHTML		+= '<br/><image border="0" class="pic_logo_additional" src="'+logo+'" alt="'+logoAlt+'" title="'+logoAlt+'" />';
	}
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function setFocus(me, id)
{
	var	o					= document.getElementById(id);
	
	o.focus();
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function msgbox(msg)
{
	alert(msg);

	return false;
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

