﻿        function SwitchImg()
        { //start
          var rem, keep=0, store, obj, switcher=new Array, history=document.Data;
            for (rem=0; rem < (SwitchImg.arguments.length-2); rem+=3) {
	            store = SwitchImg.arguments[(navigator.appName == 'Netscape')?rem:rem+1];
            if ((store.indexOf('document.layers[')==0 && document.layers==null) ||
                (store.indexOf('document.all[')==0 && document.all==null))
                 store = 'document'+store.substring(store.lastIndexOf('.'),store.length);
                 obj = eval(store);
            if (obj != null) {
               switcher[keep++] = obj;
              switcher[keep++] = (history==null || history[keep-1]!=obj)?obj.src:history[keep];
              obj.src = SwitchImg.arguments[rem+2];
          } }
          document.Data = switcher;
        } //end

        function RestoreImg()
        { //start
          if (document.Data != null)
            for (var rem=0; rem<(document.Data.length-1); rem+=2)
              document.Data[rem].src=document.Data[rem+1];
        } //end

        function SavePosition(pics_id)
        { //start
              if (document.frames['ScrollImages'] != null)
              {
                if(document.ScrollImagesForm.ScrollTopPosition){
                    document.ScrollImagesForm.ScrollTopPosition.value = document.frames['ScrollImages'].scrollTop;
                }   
                if(document.ScrollImagesForm.ScrollLeftPosition){ 
                    document.ScrollImagesForm.ScrollLeftPosition.value = document.frames['ScrollImages'].scrollLeft;
                }
                document.ScrollImagesForm.pics_id.value     = pics_id;
                document.ScrollImagesForm.docid.value       = document.getElementById('ai'+pics_id).value; 
                document.ScrollImagesForm.submit();
              }
        } //end

        function SaveLeftPosition(pics_id)
        { //start
              if (document.getElementById('ScrollImages'))
              {
                document.ScrollImagesForm.ScrollLeftPosition.value = document.getElementById('ScrollImages').scrollLeft;
                document.ScrollImagesForm.pics_id.value     = pics_id;
                document.ScrollImagesForm.docid.value       = document.getElementById('ai'+pics_id).value; 
                document.ScrollImagesForm.submit();
              }
        } //end
        
        function SaveTopPosition(pics_id)
        { //start
              if (document.getElementById('ScrollImages'))
              {
                document.ScrollImagesForm.ScrollTopPosition.value = document.getElementById('ScrollImages').scrollTop;
                document.ScrollImagesForm.pics_id.value     = pics_id;
                document.ScrollImagesForm.docid.value       = document.getElementById('ai'+pics_id).value;
                document.ScrollImagesForm.submit();
              }
        } //end
        
        var ImageNet = new Image;
        ImageNet.src = "/pics/net.gif";
        var win=null;
        
        function NewWindow(mypage,myname,w,h,scroll,pos){
        if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
        if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
        else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
        settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
        win=window.open(mypage,myname,settings);}

