   var pup;
   var win_num=1;
   function ShowPopup(URL,w,h,xpos,ypos){
      win_num=win_num+1;
      if (h==0){
         window.open(URL, win_num, 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=720,height=430,left = 250,top = 134');   
      }
      else{
         window.open(URL, win_num, 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width='+w+',height='+h+',left = '+xpos+',top = '+ypos);
      }
   }
   
    function showPop(URL,w,h,xpos,ypos){
      win_num=win_num+1;
      if (h==0){
         window.open(URL, win_num, 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=720,height=430,left = 250,top = 134');   
      }
      else{
         window.open(URL, win_num, 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=0,width='+w+',height='+h+',left = '+xpos+',top = '+ypos);
      }
   }
   
   function ShowPopupWin(URL,w,h,xpos,ypos,win_name){
      win_num=win_num+1;
      if (h==0){
         window.open(URL, win_name, 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,resizable=0,width=720,height=430,left = 175,top = 134');   
      }
      else{
         window.open(URL, win_name, 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,resizable=1,width='+w+',height='+h+',left = '+xpos+',top = '+ypos);
      }
   }

   function check_cancel() {
      window.close();   
   }
   
   function bumpIt(dir,ID) {
		if (document.getElementById(ID)){
				var holder=document.getElementById(ID).className;
				if(dir=='up'){
					switch (holder){
						case 'copy' :
							document.getElementById(ID).className="copyM";
							break;
						case 'copyM':
							document.getElementById(ID).className="copyL";
							break;
					}
				}
				else if(dir=='dn') {
					switch (holder){
						case 'copyL' :
							document.getElementById(ID).className="copyM";
							break;
						case 'copyM':
							document.getElementById(ID).className="copy";
							break;
					}
				}
		}
   }

function submitForm(cont) {
   document.gan_form.cont.value=cont;
   document.gan_form.submit();   
}

   function printStyle(page,query,status,keywords,date2) {
//      var header=confirm("Do you wish to print this page with your name and address header?\n\nChoosing Cancel will print the page without the header.");
//      if (header) {
//               ShowPopup(page+'?qprint=1&header=1&date_show='+date_set+'&date1='+date1+'&date2'+date2+'&'+query,800,600)
   //      ShowPopup(page+'?qprint=1&header=1&date_show='+date+'&date1='+date1+'&date2'+date2+'&'+query,800,600)
//      }
//      else {
//               ShowPopup(page+'?qprint=1&header=0&date_show='+date_set+'&date1='+date1+'&date2'+date2+'&'+query,800,600)
   //      ShowPopup(page+'?qprint=1&header=0&date_show='+date+'&date1='+date1+'&date2'+date2+'&'+query,800,600)
//      }
               ShowPopup(page+'?qprint=1&header=0&status='+status+'&keywords='+keywords+'&date2'+date2+'&'+query,800,600)
   }

   function QuickPrint() {
      bV = parseInt(navigator.appVersion);
      if (bV >= 4) {
         window.print();
      }
   }

function MultiSelector( list_target, max ){
	this.list_target = list_target;
	this.count = 0;
	this.id = 0;
	if( max ){
		this.max = max;
	} else {
		this.max = -1;
	};
	this.addElement = function( element ){
		if( element.tagName == 'INPUT' && element.type == 'file' ){
			element.name = 'file_' + this.id++;
			element.multi_selector = this;
			element.onchange = function(){
				var new_element = document.createElement( 'input' );
				new_element.type = 'file';
				this.parentNode.insertBefore( new_element, this );
				this.multi_selector.addElement( new_element );
				this.multi_selector.addListRow( this );
				this.style.position = 'absolute';
				this.style.left = '-1000px';
			};
			if( this.max != -1 && this.count >= this.max ){
				element.disabled = true;
			};
			this.count++;
			this.current_element = element;
		} else {
			alert( 'Error: not a file input element' );
		};
	};
	this.addListRow = function( element ){
		var new_row = document.createElement( 'div' );
		var new_row_button = document.createElement( 'input' );
		new_row_button.type = 'button';
		new_row_button.value = 'Remove';
		new_row.element = element;
		new_row_button.onclick= function(){
			this.parentNode.element.parentNode.removeChild( this.parentNode.element );
			this.parentNode.parentNode.removeChild( this.parentNode );
			this.parentNode.element.multi_selector.count--;
			this.parentNode.element.multi_selector.current_element.disabled = false;
			return false;
		};
		new_row.innerHTML = element.value;
		new_row.appendChild( new_row_button );
		this.list_target.appendChild( new_row );
	};
};


//  End -->
