/******************************************************
OpenWindow Function
Input Parameters:
	******************
	REQUIRE PARAMETERS
	******************
	sFileName : 	file name (string)
	wwidth : 		width of the window (int)
	wheight : 		height of the window (int)
	******************
	OPTIONAL PARAMETERS
	******************
	winname: 	    name of the window (string) 
							Default value : "defaultwindowname"
	scrollbars:		  open window whith scrollbar (yes,no) 
							Default value : "yes"
	top:		  		top coordinates of the window ()
						  	Default value :  Center of the screen
						  	Another Integer Value:		Absolute position
	
******************************************************/
function OpenWin(sFileName,wwidth,wheight,winname,sScrollbars,iTop) {
        // open window
		var topvalue = 0;
		
		if(sScrollbars=="" || sScrollbars=="yes" || sScrollbars=="1" || arguments.length<5) 
			sScrollbars="yes";
		else 
			sScrollbars = "no";
		if(winname == "") 
			winname = "defaultwindowname";
		
		 ww = screen.width;
         hh = screen.height;
         if(wwidth > ww) {xx=0;} else {xx=Math.round((ww-wwidth)/2)-5;};
         if(wheight > hh) {yy=0;} else {yy=Math.round((hh-wheight)/2);};
		 if(iTop == "" || arguments.length < 6)   
		 	topvalue = yy;			
		 else
		 	topvalue = iTop;
         options ='location=no, toolbar=no, status=no, left='+xx+', top='+topvalue+', menubar=no, height='+wheight+', width='+wwidth+', scrollbars = '+sScrollbars+'';
         file =sFileName;
         window.open(file,winname,options);		
        }	

function OpenWindow(sFileName,wwidth,wheight,winname,sScrollbars,iTop) {
        // open window
		var topvalue = 0;
		
		if(sScrollbars=="" || sScrollbars=="yes" || sScrollbars=="1" || arguments.length<5) 
			sScrollbars="yes";
		else 
			sScrollbars = "no";
		if(winname == "") 
			winname = "defaultwindowname";
		
		 ww = screen.width;
         hh = screen.height;
         if(wwidth > ww) {xx=0;} else {xx=Math.round((ww-wwidth)/2)-5;};
         if(wheight > hh) {yy=0;} else {yy=Math.round((hh-wheight)/2);};
		 if(iTop == "" || arguments.length < 6)   
		 	topvalue = yy;			
		 else
		 	topvalue = iTop;
         options ='location=no, toolbar=no, status=no, left='+xx+', top='+topvalue+', menubar=no, height='+wheight+', width='+wwidth+', scrollbars = '+sScrollbars+'';
         file =sFileName;
         window.open(file,winname,options);		
        }	
		
function sendsal(id_it,far)
{
var amm=eval("far.amount"+id_it+".value");   // alert(amm);
 
  location.href=="cart.php?ID_ITEMs="+id_it+"&ammount="+amm+"&adsal";
   
}

function display_subjects()
{
	if(document.search.search_word.value.length==0) 
	{alert ("!נא למלא את מילה חיפוש");
	document.search.search_word.focus();
	return false;
	}
	else return true;
}

var dom = document.getElementById
var ns6=dom && !document.all
var ns4=document.layers
var ie4=document.all && !dom
var opr=navigator.userAgent.indexOf("Opera")
function Swap(target) 
{ 
	if (dom) target = document.getElementById(target).style;  
	if (ns4) target = document.eval(target);
	if (ie4) target = eval(target).style;
	target.display = target.display == "none" ? "block" : "none"
}
