/******************************************************
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 print_div(div_title, div_id)
{
	if (document.getElementById != null)
	{
		var html = '<HTML>\n<HEAD>\n';

		if (document.getElementsByTagName != null)
		{
			var headTags = document.getElementsByTagName("head");
			if (headTags.length > 0)
				html += headTags[0].innerHTML;
		}
		
		html += '\n<\/HE' + 'AD>\n<BODY class=\"popup\">\n';
		
		html += "<br ><h1>" + div_title + "</h1>\n";
		
		var print_versionElem = document.getElementById(div_id);
		
		if (print_versionElem != null)
		{
				html += print_versionElem.innerHTML;
		}
		else
		{
			alert("Could not find requested section");
			return;
		}
			
		html += "<hr /><span style=\"font-size: 10px\">&copy; 2006 Reut Sites &amp; Photos &nbsp;|&nbsp; Created by <a href='http://www.reutnet.com/' target='_blank'>Reut Net Ltd.</span></a>"
		html += '\n<\/BO' + 'DY>\n<\/HT' + 'ML>';
		
		var printWin = window.open("","printSpecial");
		printWin.document.open();
		printWin.document.write(html);
		printWin.document.close();
//		if (gAutoPrint)
			printWin.print();
	}
	else
	{
		alert("Sorry, the print ready feature is only available in modern browsers.");
	}
}

function elemShowHide(el_id)
{
	if(el=document.getElementById(el_id))
	{
		el.style.display=el.style.display=="none"?"":"none"
	}
	return false;
}
