function initFloaters() {
	//	local function vars
	var tmpVM;
	var scrW = document.body.clientWidth;
	var scrH = document.body.clientHeight-50;
	/*	checking for document bounds in order to make
		new displacement value of the floater */
	if (scrW>706) {
		tmpVM = Math.ceil(scrW / 2 + 124);
	} else {
		tmpVM = Math.ceil(706 / 2 + 124);
	}
	//	the following line - for debugging only
	//	alert (scrW + "/" + scrH);
	allFloaters = new Array();
	//	executing new floater
	floater1 = new floater('floater1Div', 6, 997, 25, tmpVM, 0);
}

/*	++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	new floater execution
	*/
function floater(div, position, width, height, hMargin, vMargin) {
	if (navigator.appName != 'Microsoft Internet Explorer') {
		this.div = eval('document.' + div);
		this.div.visibility = 'hide';
		if (width == -1)
			width = this.div.clip.width;
		if (height == -1)
			height = this.div.clip.height;
	} else {
		this.div = eval(div + '.style');
		this.div.visibility = 'hidden';
		if (width == -1)
			width = eval(div + '.offsetWidth');
		if (height == -1)
			height = eval(div + '.offsetHeight');
	}
	this.position = position;
	this.width = width;
	this.height = height;
	this.div.width = width;
	this.div.height = height;
	this.hMargin = hMargin;
	this.vMargin = vMargin;
	this.float = float;
	this.idNo = allFloaters.length;
	allFloaters[allFloaters.length] = this;
	this.floatTimer = setInterval("allFloaters[" + this.idNo + "].float()", 50);
}

/*	++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	float on scroll
	*/
function float() {
	getwashas();
	var w = winwidth - this.width;
	var h = winheight - this.height;
	if (this.position == 1) {
		var xPos = this.hMargin; var yPos = this.vMargin;
	}
	if (this.position == 2) {
		var xPos = (w/2)-150; var yPos = this.vMargin;
	}
	if (this.position == 3) {
		var xPos = w - this.hMargin; var yPos = this.vMargin;
	}
	if (this.position == 4) {
		var xPos = w - this.hMargin; var yPos = h/2;
	}
	if (this.position == 5) {
		var xPos = w - this.hMargin; var yPos = h - this.vMargin;
	}
	if (this.position == 6) {
		var xPos = w/2; var yPos = h - this.vMargin;
	}
	if (this.position == 7) {
		var xPos = this.hMargin; var yPos = h - this.vMargin;
	}
	if (this.position == 8) {
		var xPos = this.hMargin; var yPos = h/2
	}
	if (this.position == 9) {
		var xPos = w/2; var yPos = h/2;
	}
	if ((isNaN(xPos)) || (isNaN(yPos)))
		return;
	this.div.left = leftscroll + xPos;
	this.div.top = topscroll + yPos;
	if (document.body.scrollTop>0 ) {
		floater1Div.style.visibility='visible'
	} else {
		floater1Div.style.visibility='visible'
	}
}

/*	++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	getting win settings depending on browser
	*/
function getwashas() {
	if (navigator.appName != 'Microsoft Internet Explorer') {
		winwidth = window.innerWidth - 16;
		winheight = window.innerHeight - 16;
		leftscroll = window.pageXOffset;
		topscroll = window.pageYOffset;
	 } else {
		winwidth = document.body.clientWidth;
		winheight = document.body.clientHeight;
		leftscroll = document.body.scrollLeft;
		topscroll = document.body.scrollTop;
	}
}

//window.onerror = stopError;

function DelCartForm(number){
 document.location="cart.asp?erase=yes" + "&num=" + number;
}

function EditCart(number){
 document.location="edit.asp?num=" + number;
}

function Show(obj){
if (obj.style.display=='none')
   {
	obj.style.display = '';
   } else if (obj.style.display=='')
   {
	obj.style.display = 'none'; 
	}   
}

function Hide(obj){
if (obj.style.display=='')
   {
	obj.style.display = 'none'; 
	}
}

function popwin(iname){


var popup=window.open('popwin.asp?imagename='+iname,'bigimage','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=300,height=300');

}

function valbuyform(whichform){
var passed=true
var errmsg='';
 


if (document.buyform.qty.value=="") 
{ 
errmsg=errmsg+'אנא מלא כמות מבוקשת\n';
passed=false
}


if (document.buyform.supdate.value=="") 
{ 
errmsg=errmsg+'בחר תאריך אספקה\n';
passed=false
}



if (passed==false){
alert(errmsg);} else {document.buyform.submit()}

}

// ***** add By Hadar




//***** end add





function valpropform(whichform)
{
var passed=true;
var errmsg='';
 
if (document.buyform.name.value=="") 
	{
	errmsg=errmsg+'מלא את שם המזמין\n';
	passed=false
	}

if (document.buyform.telephone.value=="") 
	{
	errmsg=errmsg+'מלא טלפון ליצירת קשר\n';
	passed=false
	}

if (document.buyform.email.value=="") 
{
errmsg=errmsg + 'מלא את דוא\"ל\n';
passed=false;
}


/*if (document.buyform.supdate.value=="") 
{
errmsg=errmsg+'בחר תאריך אספקה\n';
passed=false
}*/


if (passed==false)
	{
	alert(errmsg);
	}
else
{
document.buyform.submit();
}

}

function searchsubmit()
{
 if ((document.searchform.prd.value=="") && (document.searchform.price.value=="0-10000"))
 {alert('בחר מוצר או טווח מחירים');} else {document.searchform.submit();}
}

function gothere(label) 
{	
	var mov = document.sndmovie;	// getting the flash movie name
	mov.TGotoLabel("/",label);	// making the execution
}
function stopError() 
{
  	return true;
}
function dosnd(label) 
{
	window.parent.bottom.gothere(label);
}
function validateform()
{

if((document.loginform.username.value=="") || (document.loginform.password.value=="")) 
	alert('יש להזין שם משתמש וסיסמא');
else
	document.loginform.submit();
}
