var theWinInst;

//--------------------------------------------------------------------------------------------------------------
//Function to open a popup window with passed name  use theWinInst 
//--------------------------------------------------------------------------------------------------------------
function openReWinName(winDocFile,windowName) {
    var agt=navigator.userAgent.toLowerCase();            
    var is_ie=(agt.indexOf("msie") != -1);
    if((!theWinInst)) {  				//||(theWinInst.closed==true)
        features = 'toolbar,location,menubar,scrollbars,resizable,status=yes,directories=no,width=550,height=450,top=15,left=40';
				theWinInst = window.open("",windowName,features);
        theWinInst.location.href = winDocFile;
        theWinInst.focus();
    }	 
    else  {
				if(theWinInst.document!=winDocFile) {
			           theWinInst = window.open(winDocFile,windowName)
			           theWinInst.focus();
				 }
    }
 		// cover all remaining cases
    theWinInst.focus();
}
//--------------------------------------------------------------------------------------------------------------

function openSmallWin(href)
         { 
                 var winInst=null;
                 var agt=navigator.userAgent.toLowerCase();            
                 var is_ie=(agt.indexOf("msie") != -1);
                 winInst = window.open("","name1","scrollbars,menubar,resizable,width=450,height=300,top=15,left=40");
                 winInst.location.href = href;
                 winInst.focus();
         }
		 
		 
function openVerySmallWin(href)
         { 
                 var winInst=null;
                 var agt=navigator.userAgent.toLowerCase();            
                 var is_ie=(agt.indexOf("msie") != -1);
                 winInst = window.open("","name1","scrollbars,menubar,resizable,width=350,height=350,top=15,left=40");
                 winInst.location.href = href;
                 winInst.focus();
         }
		 
function openMedWin(href)
         { 
                 var winInst=null;
                 var agt=navigator.userAgent.toLowerCase();            
                 var is_ie=(agt.indexOf("msie") != -1);
                 winInst = window.open("","name1","scrollbars,menubar,resizable,width=550,height=350,top=15,left=40");
                 winInst.location.href = href;
                 winInst.focus();
         }
		 
function openBigWin(href) {
                 var winInst=null;
                 var agt=navigator.userAgent.toLowerCase();
                 var is_ie=(agt.indexOf("msie") != -1);            
     						 winInst = window.open("","name1","scrollbars,menubar,resizable,width=550,height=450,top=15,left=40");
                 winInst.location.href = href;
                 winInst.focus();
         }
function openBigName2Win(href) {
			           var winInst=null;
			           var agt=navigator.userAgent.toLowerCase();
			           var is_ie=(agt.indexOf("msie") != -1);            
								 winInst = window.open("","name2","scrollbars,menubar,resizable,width=650,height=600,top=40,left=490");
			           winInst.location.href = href;
			           winInst.focus();
         }

function openBig1Win(href) {
		             var winInst=null;
		             var agt=navigator.userAgent.toLowerCase();
		             var is_ie=(agt.indexOf("msie") != -1);            
		 						 winInst = window.open("","name1","scrollbars,menubar,resizable,width=650,height=570,top=15,left=20");
		             winInst.location.href = href;
		             winInst.focus();
         }
		 
function openBig1bWin(href) {
		             var winInst=null;
		             var agt=navigator.userAgent.toLowerCase();
		             var is_ie=(agt.indexOf("msie") != -1);            
		 						 winInst = window.open("","name1","scrollbars,menubar,resizable,width=625,height=500,top=15,left=40");
		             winInst.location.href = href;
		             winInst.focus();
         }
		 
function openBig2Win(href) {
			           var winInst=null;
			           var agt=navigator.userAgent.toLowerCase();
			           var is_ie=(agt.indexOf("msie") != -1);            
								 winInst = window.open("","name1","scrollbars,menubar,resizable,width=600,height=450,top=15,left=40");
			           winInst.location.href = href;
			           winInst.focus();
         }

function openBig3Win(href) {
								var winInst=null;
								var agt=navigator.userAgent.toLowerCase();
								var is_ie=(agt.indexOf("msie") != -1);            
								winInst = window.open("","name1","scrollbars,menubar,resizable,width=500,height=550,top=15,left=40");
								winInst.location.href = href;
								winInst.focus();
         }
		 
function openBig4Win(href) {
	             var winInst=null;
	             var agt=navigator.userAgent.toLowerCase();
	             var is_ie=(agt.indexOf("msie") != -1);            
	 						 winInst = window.open("","name1","scrollbars,menubar,resizable,width=575,height=710,top=15,left=40");
	             winInst.location.href = href;
	             winInst.focus();
         }
function openBigName4Win(href) {
	             var winInst=null;
	             var agt=navigator.userAgent.toLowerCase();
	             var is_ie=(agt.indexOf("msie") != -1);            
	 						 winInst = window.open("","name4","toolbar,scrollbars,menubar,resizable,width=1250,height=650,top=15,left=5");
	             winInst.location.href = href;
	             winInst.focus();
         }
		 
function openBig5Win(href) {
                 var winInst=null;
                 var agt=navigator.userAgent.toLowerCase();
                 var is_ie=(agt.indexOf("msie") != -1);            
     						 winInst = window.open("","name1","scrollbars,menubar,resizable,width=500,height=600,top=15,left=40");
                 winInst.location.href = href;
                 winInst.focus();
         }

function openTicket(href)
         { 
							var winInst=null;
							var agt=navigator.userAgent.toLowerCase();            
							var is_ie=(agt.indexOf("msie") != -1);
							features = 'toolbar,menubar=yes,scrollbars,resizable,status=yes,directories=no';
							features += ',width=' + xlen + ',height=' + ylen ; 
							features += ',top=' + y + ',left=' + x ; 
							winInst = window.open("","order",features);
							// orig ok:
							//winInst = window.open("","name1","scrollbars,menubar=no,resizable,width=650,height=700,top=15,left=450");
							winInst.location.href = href;
							winInst.focus();
         }

function openTicket2Input(href)
         { 
                var winInst=null;
                var agt=navigator.userAgent.toLowerCase();            
                var is_ie=(agt.indexOf("msie") != -1);
                features = 'toolbar,menubar=yes,scrollbars,resizable,status=yes,directories=no';        //
                features += ',width=' + x2len + ',height=' + y2len ; 
								features += ',top=' + y2 + ',left=' + x2 ; 
                winInst = window.open("","input_order",features);
                // orig ok:          //winInst = window.open("","name1","scrollbars,menubar=no,resizable,width=650,height=700,top=15,left=450");
                winInst.location.href = href;
                winInst.focus();
         }

