function newwin(w,wd,h,s) { winny=window.open(w,'theWindow','toolbar=0,status=0,scrollbars='+s+',resizable=0,width='+wd+',height='+h+'');        
winny.focus();
}

function selectCheck( chk, value)
{
	 for(i=0 ; i<chk.length; i++)
	{
		if( chk.options[i].value == value)
		{
			chk.selectedIndex = i;
			break;
		}
	}
}

function radioCheck( rad, value)
{
	var loop = rad.length;
	 for(i=0 ;i<rad.length; i++)
	{
		if( rad[i].value == value)
		{
			rad[i].checked = true;
			break;
		}
		
	}
}

function imge(w, h)
{
  
	newimg=new Image();
  
	newimg.src=document.frm.uploadfile.value;
 
	resize(newimg, w, h);
 
	document.frm.mainpic.src=document.frm.uploadfile.value;
  
	document.frm.mainpic.width=w;
  
	document.frm.mainpic.height=h;


}


function resize(siz,ww)
{

	if(siz.width>ww || siz.height>ww)
  {


		if(siz.width>siz.height) {
 
			temp=siz.width/ww;
     
			xx=siz.width/temp;
    
			yy=siz.height/temp;
    
		}else{
    
			temp=siz.height/ww;
    
			xx=siz.width/temp;
     
			yy=siz.height/temp;
		}


	}else{
  

		xx=siz.width;
		yy=siz.height;


	}
 
	
	siz.width=xx;
	siz.height=yy;
	
}




function warp(){
window.location='index.php?species='+document.frm.species.options[document.frm.species.selectedIndex].value
}

function Checkall(form){ 
  for (var i = 1; i < form.elements.length; i++){     
    eval("form.elements[" + i + "].checked = form.elements[0].checked");   
  } 
} 