﻿// JScript File

var ie=document.all
var ns=document.layers
var ns6=document.getElementById&&!document.all

function enlarge(which,e){
//Render image code for IE 4+ and NS6
if (ie||ns6){
crossobj=document.getElementById? document.getElementById("showimage") : document.all.showimage
if (crossobj.style.visibility=="hidden"){
crossobj.style.left=ns6? pageXOffset+e.clientX +50: document.body.scrollLeft+event.clientX+50
//crossobj.style.top=ns6? pageYOffset+e.clientY : document.body.scrollTop+event.clientY
//crossobj.style.left=150;
crossobj.style.top=document.body.scrollTop+200;
crossobj.innerHTML='<div align=right id=drag dir=ltr><table cellpadding=0 cellspacing=0 border=0><tr style=background-color:#3A6EA5;><td align=left width=50% class=white10pt style=font-weight:bold;>www.nfc.co.il</td><td align=right width=50%><b onClick=closepreview()>&nbsp;<a style="font-family: David; font-size: 10pt; color: #FFFFFF; text-decoration: none; font-weight: bold"  href=javascript:void(0);>X</a>&nbsp;</b></td></tr></table></div><img onClick=closepreview() src="'+which+'" style="border: 25px solid #FFFFFF">'
crossobj.style.visibility="visible"
}
else
crossobj.style.visibility="hidden"
return false
}
//Render image code for NS 4
else if (document.layers){
if (document.showimage.visibility=="hide"){
document.showimage.document.write('<a href="#" onMouseover="drag_dropns(showimage)"><img src="'+which+'" border=0></a>')
document.showimage.document.close()
document.showimage.left=e.x
document.showimage.top=e.y
document.showimage.visibility="show"
}
else
document.showimage.visibility="hide"
return false
}
//if NOT IE 4+ or NS 4, simply display image in full browser window
else
return true
}

function closepreview(){
crossobj.style.visibility="hidden"
}



//drag drop function for NS 4////
/////////////////////////////////

var nsx,nsy,nstemp

function drag_dropns(name){
temp=eval(name)
temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
temp.onmousedown=gons
temp.onmousemove=dragns
temp.onmouseup=stopns
}

function gons(e){
temp.captureEvents(Event.MOUSEMOVE)
nsx=e.x
nsy=e.y
}
function dragns(e){
temp.moveBy(e.x-nsx,e.y-nsy)
return false
}

function stopns(){
temp.releaseEvents(Event.MOUSEMOVE)
}

//drag drop function for IE 4+ and NS6////
/////////////////////////////////

function drag_drop(e){
if (ie&&dragapproved){
crossobj.style.left=tempx+event.clientX-offsetx
crossobj.style.top=tempy+event.clientY-offsety
}
else if (ns6&&dragapproved){
crossobj.style.left=tempx+e.clientX-offsetx
crossobj.style.top=tempy+e.clientY-offsety
}
return false
}

function initializedrag(e){
if (ie&&event.srcElement.id=="drag"||ns6&&e.target.id=="drag"){
offsetx=ie? event.clientX : e.clientX
offsety=ie? event.clientY : e.clientY

tempx=parseInt(crossobj.style.left)
tempy=parseInt(crossobj.style.top)

dragapproved=true
//document.onmousemove=drag_drop
}
}

//document.onmousedown=initializedrag
//document.onmouseup=new Function("dragapproved=false")
    	
    	
    	function IsLegalDigits(str)
		{
  		var legal = 1;
  		var i;
  		for (i=0; i<str.length; i++) 
  		{
    	  ch = str.substring(i,i+1)
    	  if (i==0 && ch=="0")
    	  {
    	  	legal=0
    	  	break
    	  }	
    	 	if (ch !="0" && ch !="1" && ch !="2" && ch !="3" && ch !="4" && ch !="5" && ch !="6" && ch !="7" && ch !="8" && ch !="9") 
    			{
      			legal = 0
      			break
    			}
  	    }
  		 return legal
		} //end function
		
    	function islegaldata(form)
    	{
    		if(form.BasketQty.value=="")
    		{
    			alert("òìéê ìöééï ëîåú ìîåöø ùáøöåðê ìäæîéï")
    			form.BasketQty.focus()
    			return false;
    		}
    		if(!IsLegalDigits(form.BasketQty.value))
  			{
    			alert("äòøê ùäöáú áëîåú àéðå çå÷é- îñôø âãåì î-0 áìáã")
   				form.BasketQty.focus()
 			    return false;
  			}
  		form.submit()
  		return false;
	
    	} //end function
    	
    	
    	
function IsLegalEmail(form)
{
   if (form.email.value == ""){
    alert("éù ìäæéï àéîééì")
    form.email.focus()
    return false
 }
 ok = 0
  email = form.email.value
  for (i=0; i<email.length; i++) {
    ch = email.substring(i,i+1)
    if (ch == "@" && i!=0 && i!=email.length-1) {
      ok = 1
    }
    if((ch>="à" && ch<="ú")) {
      ok = 0
      break
    }
  }
  if(ok == 0) {  
    alert("ëúåáú ãåàø àì÷èøåðé àéðä çå÷éú")
    form.email.focus()
    return false;
  } 
 form.submit()
  return false
}

///////////////////////////////////////////////////////////////////////////////////////////////////
/******************************************************************* 
* File    : JSFX_Layer.js  © JavaScript-FX.com
* Created : 2001/04/11 
* Author  : Roy Whittle  (Roy@Whittle.com) www.Roy.Whittle.com 
* Purpose : To create a cross browser dynamic layers.
* History 
* Date         Version        Description 
* 2001-03-17	3.0		Completely re-witten for use by javascript-fx
***********************************************************************/ 
if(!window.JSFX)
	JSFX=new Object();

JSFX.layerNo=0; 
/**********************************************************************************/
JSFX.createElem = function(htmlStr, x, y)
{
	var elem = null;

 	if(document.layers) 
	{
		elem=new Layer(2000); 
		elem.document.open(); 
		elem.document.write(htmlStr); 
		elem.document.close(); 
		elem.moveTo(x,y);
		elem.innerHTML = htmlStr;
	}
	else 
	if(document.all) 
	{
		var xName = "xLayer" + JSFX.layerNo++; 
		var txt = "<DIV ID='" + xName 
			+ "' STYLE=\"position:absolute;" 
			+ "left:"  + x + ";" 
			+ "top:"   + y + ";" 
			+ "visibility:hidden\">" 
			+ htmlStr 
			+ "</DIV>"; 

			document.body.insertAdjacentHTML("BeforeEnd",txt); 

		elem = document.all[xName]; 
	} 
	else 
	if (document.getElementById)
	{
		var xName="xLayer" + JSFX.layerNo++;
		var txt = ""
			+ "position:absolute;"
			+ "left:"  + x + "px;"
			+ "top:"   + y + "px;"
			+ "visibility:hidden";

		var newRange = document.createRange();

		elem = document.createElement("DIV");
		elem.setAttribute("style",txt);
		elem.setAttribute("id", xName);

		document.body.appendChild(elem);

		newRange.setStartBefore(elem);
		strFrag = newRange.createContextualFragment(htmlStr);	
		elem.appendChild(strFrag);
	}

	return elem;
}
/**********************************************************************************/
JSFX.Layer = function(newLayer, x, y) 
{
	if(!newLayer)
		return;

	if(x==null)x=0; 
	if(y==null)y=0; 

	if(typeof newLayer == "string")
		this.elem = JSFX.createElem(newLayer, x, y);
	else
		this.elem=newLayer;

	if(document.layers)
	{
		this.images=this.elem.document.images; 
		this.style = this.elem;
 	} 
	else 
	{
		this.images  = document.images; 
		this.style   = this.elem.style; 
	} 
} 
/**********************************************************************************/
JSFX.findLayer = function(theDiv, d)
{
	if(document.layers)
	{
		var i;
		if(d==null) d = document;
		var theLayer = d.layers[theDiv];
		if(theLayer != null)
			return(theLayer);
		else
			for(i=0 ; i<d.layers.length ; i++)
			{
				theLayer = JSFX.findLayer(theDiv, d.layers[i].document);
				if(theLayer != null)
					return(theLayer);
			}
		return("Undefined....");
	}
	else 
	if(document.all)
		return(document.all[theDiv]);
	else 
	if(document.getElementById)
		return(document.getElementById(theDiv));
	else
		return("Undefined.....");
}
var ns4 = (navigator.appName.indexOf("Netscape") != -1 && !document.getElementById);

/**********************************************************************************/
/*** moveTo (x,y) ***/
JSFX.Layer.prototype.moveTo = function(x,y)
{
	this.style.left = x+"px";
	this.style.top = y+"px";
}
if(ns4)
	JSFX.Layer.prototype.moveTo = function(x,y) { this.elem.moveTo(x,y); }
/**********************************************************************************/
/*** show()/hide() Visibility ***/
JSFX.Layer.prototype.show		= function() 	{ this.style.visibility = "visible"; } 
JSFX.Layer.prototype.hide		= function() 	{ this.style.visibility = "hidden"; } 
JSFX.Layer.prototype.isVisible	= function()	{ return this.style.visibility == "visible"; } 
if(ns4)
{
	JSFX.Layer.prototype.show		= function() 	{ this.style.visibility = "show"; }
	JSFX.Layer.prototype.hide 		= function() 	{ this.style.visibility = "hide"; }
	JSFX.Layer.prototype.isVisible 	= function() 	{ return this.style.visibility == "show"; }
}
/**********************************************************************************/
/*** zIndex ***/
JSFX.Layer.prototype.setzIndex	= function(z)	{ this.style.zIndex = z; } 
JSFX.Layer.prototype.getzIndex	= function()	{ return this.style.zIndex; }
/**********************************************************************************/
/*** BackGround Color ***/
JSFX.Layer.prototype.setBgColor	= function(color) { this.style.backgroundColor = color==null?'transparent':color; } 
if(ns4)
	JSFX.Layer.prototype.setBgColor 	= function(color) { this.elem.bgColor = color; }
/**********************************************************************************/
/*** BackGround Image ***/
JSFX.Layer.prototype.setBgImage	= function(image) { this.style.backgroundImage = "url("+image+")"; }
if(ns4)
	JSFX.Layer.prototype.setBgImage 	= function(image) { this.style.background.src = image; }
/**********************************************************************************/
/*** set Content***/
JSFX.Layer.prototype.setContent   = function(xHtml)	{ this.elem.innerHTML=xHtml; } 
if(ns4)
	JSFX.Layer.prototype.setContent   = function(xHtml)
	{
		this.elem.document.open();
		this.elem.document.write(xHtml);
		this.elem.document.close();
	}

/**********************************************************************************/
/*** Clipping ***/
JSFX.Layer.prototype.clip = function(x1,y1, x2,y2){ this.style.clip="rect("+y1+" "+x2+" "+y2+" "+x1+")"; }
if(ns4)
	JSFX.Layer.prototype.clip = function(x1,y1, x2,y2)
	{
		this.style.clip.top	=y1;
		this.style.clip.left	=x1;
		this.style.clip.bottom	=y2;
		this.style.clip.right	=x2;
	}
/**********************************************************************************/
/*** Resize ***/
JSFX.Layer.prototype.resizeTo = function(w,h)
{ 
	this.style.width	=w + "px";
	this.style.height	=h + "px";
}
if(ns4)
	JSFX.Layer.prototype.resizeTo = function(w,h)
	{
		this.style.clip.width	=w;
		this.style.clip.height	=h;
	}
/**********************************************************************************/
/*** getX/Y ***/
JSFX.Layer.prototype.getX	= function() 	{ return parseInt(this.style.left); }
JSFX.Layer.prototype.getY	= function() 	{ return parseInt(this.style.top); }
if(ns4)
{
	JSFX.Layer.prototype.getX	= function() 	{ return this.style.left; }
	JSFX.Layer.prototype.getY	= function() 	{ return this.style.top; }
}
/**********************************************************************************/
/*** getWidth/Height ***/
JSFX.Layer.prototype.getWidth		= function() 	{ return this.elem.offsetWidth; }
JSFX.Layer.prototype.getHeight	= function() 	{ return this.elem.offsetHeight; }
if(!document.getElementById)
	JSFX.Layer.prototype.getWidth		= function()
 	{ 
		//Extra processing here for clip
		return this.elem.scrollWidth;
	}

if(ns4)
{
	JSFX.Layer.prototype.getWidth		= function() 	{ return this.style.clip.right; }
	JSFX.Layer.prototype.getHeight	= function() 	{ return this.style.clip.bottom; }
}

///////////////////////////////////////////////////////////////////////////////////////////////////

/******************************************************************* 
* 
* File    : JSFX_Browser.js © JavaScript-FX.com
* 
* Created : 2000/07/15 
* 
* Author  : Roy Whittle www.Roy.Whittle.com 
* 
* Purpose : To create a cross browser "Browser" object.
*		JSFX.Browser library will allow scripts to query parameters
*		about the current browser window.
* 
* History 
* Date         Version        Description 
* 2001-03-17	2.0		Converted for javascript-fx
***********************************************************************/  
if(!window.JSFX)
	JSFX=new Object();

if(!JSFX.Browser)
	JSFX.Browser = new Object();

if(navigator.appName.indexOf("Netscape") != -1)
{
	JSFX.Browser.getCanvasWidth	= function() {return innerWidth;}
	JSFX.Browser.getCanvasHeight	= function() {return innerHeight;}
	JSFX.Browser.getWindowWidth 	= function() {return outerWidth;}
	JSFX.Browser.getWindowHeight	= function() {return outerHeight;}
	JSFX.Browser.getScreenWidth 	= function() {return screen.width;}
	JSFX.Browser.getScreenHeight	= function() {return screen.height;}
	JSFX.Browser.getMinX		= function() {return(pageXOffset);}
	JSFX.Browser.getMinY		= function() {return(pageYOffset);}
	JSFX.Browser.getMaxX		= function() {return(pageXOffset+innerWidth);}
	JSFX.Browser.getMaxY		= function() {return(pageYOffset+innerHeight);}

}
else 	if(document.all) 	{
	JSFX.Browser.getCanvasWidth	= function() {return document.body.clientWidth;}
	JSFX.Browser.getCanvasHeight	= function() {return document.body.clientHeight;}
	JSFX.Browser.getWindowWidth 	= function() {return document.body.clientWidth;}
	JSFX.Browser.getWindowHeight	= function() {return document.body.clientHeight;}
	JSFX.Browser.getScreenWidth	= function() {return screen.width;}
	JSFX.Browser.getScreenHeight	= function() {return screen.height;}
	JSFX.Browser.getMinX		= function() {return(document.body.scrollLeft);}
	JSFX.Browser.getMinY		= function() {return(document.body.scrollTop);}
	JSFX.Browser.getMaxX		= function() {
		return(document.body.scrollLeft
			+document.body.clientWidth);
	}
	JSFX.Browser.getMaxY		= function() {
			return(document.body.scrollTop
				+document.body.clientHeight);
	}
} 
/*** End  ***/ 

///////////////////////////////////////////////////////////////////////////////////////////////////

/*******************************************************************
*
* File    : JSFX_FloatingLayer.js © JavaScript-FX.com
*
* Created : 2001/03/16
*
* Author  : Roy Whittle www.Roy.Whittle.com
*           
* Purpose : To make and positional div float to
*		one plave on the page and stay there.
*
* History
* Date         Version        Description
*
* 2001-03-17	2.0		Converted for javascript-fx
***********************************************************************/
JSFX.FloatingLayer = function(theDiv, x, y)
{
	//Call the superclass constructor
	this.superC = JSFX.Layer;
	this.superC(JSFX.findLayer(theDiv), x, y);

	this.baseX = x;
	this.baseY = y;
	this.x = x;
	this.y = y;
	this.moveTo(x,y);
	this.show();

}
JSFX.FloatingLayer.prototype = new JSFX.Layer;

JSFX.FloatingLayer.prototype.animate = function()
{
	var targetX;
	var targetY;
	if(this.baseX > 0)
		targetX = JSFX.Browser.getMinX() + this.baseX;
	else
		targetX = JSFX.Browser.getMaxX() + this.baseX;

	if(this.baseY > 0)
		targetY = JSFX.Browser.getMinY() + this.baseY;
	else
		targetY = JSFX.Browser.getMaxY() + this.baseY;

	var dx = (targetX - this.x)/8;
	var dy = (targetY - this.y)/8;
	this.x += dx;
	this.y += dy;

	this.moveTo(this.x, this.y);
}
JSFX.MakeFloatingLayer = function(theDiv, x, y)
{
	JSFX.MakeFloatingLayer.floaters[JSFX.MakeFloatingLayer.floaters.length] = new JSFX.FloatingLayer(theDiv, x, y);
}
JSFX.MakeFloatingLayer.floaters = new Array();
JSFX.MakeFloatingLayer.animate = function()
{
	var i;
	for(i=0 ; i<JSFX.MakeFloatingLayer.floaters.length ; i++)
		JSFX.MakeFloatingLayer.floaters[i].animate();
}
setInterval("JSFX.MakeFloatingLayer.animate()", 30);


///////////////////////////////////////////////////////////////////////////////////////////////////

function showFloatBanner() {
var sw=document.body.offsetWidth; 
if(sw >= 980)
{
 divBanner.style.display=''; 
 JSFX.MakeFloatingLayer("divBanner",   2,   5);
 }
 else
 {
 divBanner.style.display='none'; 
 }
}

//var timerID;
//var pointAtX;
//function startSlideInhomepageAd() {
//    var w1=screen.width;
//    var strLeft1;
//    strLeft1=(w1/2)-200;
//    document.getElementById('homepageAd').style.left = strLeft1;
//    pointAtX = -250;
//    document.getElementById("homepageAd").style.visibility = "visible";
//    timerID = setInterval("slideInhomepageAd()", 80);
//}
//function slideInhomepageAd() {
//    pointAtX += 40;
//    document.getElementById("homepageAd").style.top = pointAtX;
//    if ( pointAtX >= 200 ) {
//        clearTimeout(timerID);
//    }
//}
var xmlHttp = null; 

function RetrieveTabInfo(page, span, leftImage, rightImage, midBack, lnkCss) {

   document.getElementById(leftImage).src = '/Tabs/tab_on_left.gif';
   document.getElementById(rightImage).src = '/Tabs/tab_on_right.gif'; 
   document.getElementById(midBack).style.backgroundImage = "url('/Tabs/tab_on_mid.gif')";
   document.getElementById(lnkCss).className = 'TabSelected' 
  
   xmlHttp = null;
  
    if (window.ActiveXObject) {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    else if (window.XMLHttpRequest) {
    xmlHttp = new XMLHttpRequest();
    }
    else {
    /*NOP*/
    }
   
    if (xmlHttp != null) {
            xmlHttp.Open("GET", page, true);
            xmlHttp.onreadystatechange = function pageUpdate()
{
if(xmlHttp.readyState == 4)
document.getElementById(span).innerHTML = xmlHttp.ResponseText;
}
            xmlHttp.send(null);
            //document.getElementById(span).innerHTML = objHTTP.ResponseText;
            }
  
   //var objHTTP = new ActiveXObject("Microsoft.XMLHTTP");
   //objHTTP.Open("post", page , false);
   //objHTTP.send();
   //document.getElementById(span).innerHTML = objHTTP.ResponseText;
  

} 
