/******************************************************
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 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);		
        }	

