//Function to jump to another forum
function ForumJump(URL) {
	
	if (URL.options[URL.selectedIndex].value != "") self.location.href = URL.options[URL.selectedIndex].value;	
	return true;
}

//Function to open pop up window
function openWin(theURL,winName,features) {
  	window.open(theURL,winName,features);
}


//Function to open preview post window
function OpenPreviewWindow(targetPage, formName){
	
	now = new Date  
	
	//Open the window first 	
   	openWin('','preview','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=680,height=400')
   		
   	//Now submit form to the new window
   	formName.action = targetPage + "?ID=" + now.getTime();	
	formName.target = "preview";
	formName.submit();
}

function openpicwin(urlname1,xsize,ysize)
  {
    picwin=window.open(urlname1,"Pic_Window","channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=yes,width=" + eval(xsize) + ",height=" + eval(ysize) + ",top=30,left=100'")
    xsize=0; ysize=0;
  }

// Function to open a Pic window and resize it !
function PopupPic(sPicURL) { 
     window.open( "/includes/popup.asp?"+sPicURL, "_PopUp",  
     "resizable=0,HEIGHT=1,WIDTH=1,,top=10,left=10"); 
} 

// Function to open a Pic window and resize it and allow scroling thru many pics!
function PopupPicScroll(sPicURL,picNumber,totalPics) { 
     window.open( "/includes/popupscroll.asp?URL="+sPicURL+"&PNUM="+picNumber+"&PTOT="+totalPics, "_PopUp",  
     "resizable=0,location=0, HEIGHT=1,WIDTH=1"); 
} 



function checkText() 
     { 
          if (document.images.length > 0)          //Has images, validate sizes 
          { 
               var imgHeight; 
               var imgWidth; 
               for (var loop = 0; loop < document.images.length; loop++) 
               { 
                   if (document.images[loop].name.substring(0,6) == 'chkImg') 
                    { 
                         imgWidth = document.images[loop].width; 
                         imgHeight = document.images[loop].height; 
                                           
                         if (imgWidth > 140) 
                         { 
                              document.images[loop].src = "avatars/wrongsize.jpg";       
                         } 
                    }

		   if (document.images[loop].name.substring(0,6) == 'chkPos') 
                    { 
                         imgWidth = document.images[loop].width; 
                         imgHeight = document.images[loop].height; 

                         if (imgWidth > 450) 
                         { 
                              document.images[loop].width = 450;
                              document.images[loop].alt = "התמונה הוקטנה, לחץ כדי לראות אותה בגודל מלא בחלון נפרד";    
                         } 
                    } 
               } 
          }  
     } 
