function dblclickhandler(e){
	var ref = {div:$(e.target).parent().parent().parent().parent().attr('id'),row:$(e.target).parent().index(),col:$(e.target).index()};
	if(typeof $('input[name=assemblieselector]:checked').val()!='undefined'){
		switch(ref.div){
			case "secoct":
				if(octantarray[arrPos(ref.div,ref.row,ref.col)].newassembly!=0){
					octantarray[arrPos(ref.div,ref.row,ref.col)].newassembly=0;
				}
				else{
					octantarray[arrPos(ref.div,ref.row,ref.col)].newassembly = $('input[name=assemblieselector]:checked').val();
				}
				break;
			case "secangle":
				if(angarray[arrPos(ref.div,ref.row,ref.col)].newassembly!=0){
					angarray[arrPos(ref.div,ref.row,ref.col)].newassembly=0;
				}
				else{
					angarray[arrPos(ref.div,ref.row,ref.col)].newassembly = $('input[name=assemblieselector]:checked').val();
				}
				break;
			case "secvert":
				if(vertarray[arrPos(ref.div,ref.row,ref.col)].newassembly!=0){
					vertarray[arrPos(ref.div,ref.row,ref.col)].newassembly=0;
				}
				else{
					vertarray[arrPos(ref.div,ref.row,ref.col)].newassembly = $('input[name=assemblieselector]:checked').val();
				}
				break;
			default:
				if(centarray[arrPos(ref.div,ref.row,ref.col)].newassembly!=0){
					centarray[arrPos(ref.div,ref.row,ref.col)].newassembly=0;
				}
				else{
					centarray[arrPos(ref.div,ref.row,ref.col)].newassembly = $('input[name=assemblieselector]:checked').val();
				}
				break;
		}
	}
	else{
		Output(
			"<p>"+now()+"</p><p class=\"indent\" style=\"color:red;\">	<strong>New assembly type not selected<strong></p>"
		);
	}
	recolor(ref.div,ref.row,ref.col,getMoveableAssembly(ref).exposure,getMoveableAssembly(ref).newassembly);
	repaint();
	$('#freshassembs').html("<strong>"+totnewassemblies()+"</strong> / <strong>"+numbernewassemblies(0)+"</strong> / <strong>"+(Number(totnewassemblies())+Number(numbernewassemblies(0)))+"</strong>");
}
//handles assembly type deletions, ensure all assemblies of that type are set to newassembly 0
handles assembly type deletions, ensure all assemblies of that type are set to newassembly 0
handles assembly type deletions ensure all assemblies of that type are set to newassembly 0
function dblclickhandler(e){
	var ref = {div:$(e.target).parent().parent().parent().parent().attr('id'),row:$(e.target).parent().index(),col:$(e.target).index()};
	if(typeof $('input[name=assemblieselector]:checked').val()!='undefined'){
		switch(ref.div){
			case "secoct":
				if(octantarray[arrPos(ref.div,ref.row,ref.col)].newassembly!=0){
					octantarray[arrPos(ref.div,ref.row,ref.col)].newassembly=0;
				}
				else{
					octantarray[arrPos(ref.div,ref.row,ref.col)].newassembly = $('input[name=assemblieselector]:checked').val();
				}
				break;
			case "secangle":
				if(angarray[arrPos(ref.div,ref.row,ref.col)].newassembly!=0){
					angarray[arrPos(ref.div,ref.row,ref.col)].newassembly=0;
				}
				else{
					angarray[arrPos(ref.div,ref.row,ref.col)].newassembly = $('input[name=assemblieselector]:checked').val();
				}
				break;
			case "secvert":
				if(vertarray[arrPos(ref.div,ref.row,ref.col)].newassembly!=0){
					vertarray[arrPos(ref.div,ref.row,ref.col)].newassembly=0;
				}
				else{
					vertarray[arrPos(ref.div,ref.row,ref.col)].newassembly = $('input[name=assemblieselector]:checked').val();
				}
				break;
			default:
				if(centarray[arrPos(ref.div,ref.row,ref.col)].newassembly!=0){
					centarray[arrPos(ref.div,ref.row,ref.col)].newassembly=0;
				}
				else{
					centarray[arrPos(ref.div,ref.row,ref.col)].newassembly = $('input[name=assemblieselector]:checked').val();
				}
				break;
		}
	}
	else{
		Output(
			"<p>"+now()+"</p><p class=\"indent\" style=\"color:red;\">	<strong>New assembly type not selected<strong></p>"
		);
	}
	recolor(ref.div,ref.row,ref.col,getMoveableAssembly(ref).exposure,getMoveableAssembly(ref).newassembly);
	repaint();
	$('#freshassembs').html("<strong>"+totnewassemblies()+"</strong> / <strong>"+numbernewassemblies(0)+"</strong> / <strong>"+(Number(totnewassemblies())+Number(numbernewassemblies(0)))+"</strong>");
}
function dblclickhandler ( e ) { var ref = { div : $ ( e . target ) . parent ( ) . parent ( ) . parent ( ) . parent ( ) . attr ( 'id' ) , row : $ ( e . target ) . parent ( ) . index ( ) , col : $ ( e . target ) . index ( ) } ; if ( typeof $ ( 'input[name=assemblieselector]:checked' ) . val ( ) != 'undefined' ) { switch ( ref . div ) { case "secoct" : if ( octantarray [ arrPos ( ref . div , ref . row , ref . col ) ] . newassembly != 0 ) { octantarray [ arrPos ( ref . div , ref . row , ref . col ) ] . newassembly = 0 ; } else { octantarray [ arrPos ( ref . div , ref . row , ref . col ) ] . newassembly = $ ( 'input[name=assemblieselector]:checked' ) . val ( ) ; } break ; case "secangle" : if ( angarray [ arrPos ( ref . div , ref . row , ref . col ) ] . newassembly != 0 ) { angarray [ arrPos ( ref . div , ref . row , ref . col ) ] . newassembly = 0 ; } else { angarray [ arrPos ( ref . div , ref . row , ref . col ) ] . newassembly = $ ( 'input[name=assemblieselector]:checked' ) . val ( ) ; } break ; case "secvert" : if ( vertarray [ arrPos ( ref . div , ref . row , ref . col ) ] . newassembly != 0 ) { vertarray [ arrPos ( ref . div , ref . row , ref . col ) ] . newassembly = 0 ; } else { vertarray [ arrPos ( ref . div , ref . row , ref . col ) ] . newassembly = $ ( 'input[name=assemblieselector]:checked' ) . val ( ) ; } break ; default : if ( centarray [ arrPos ( ref . div , ref . row , ref . col ) ] . newassembly != 0 ) { centarray [ arrPos ( ref . div , ref . row , ref . col ) ] . newassembly = 0 ; } else { centarray [ arrPos ( ref . div , ref . row , ref . col ) ] . newassembly = $ ( 'input[name=assemblieselector]:checked' ) . val ( ) ; } break ; } } else { Output ( "<p>" + now ( ) + "</p><p class=\"indent\" style=\"color:red;\">	<strong>New assembly type not selected<strong></p>" ) ; } recolor ( ref . div , ref . row , ref . col , getMoveableAssembly ( ref ) . exposure , getMoveableAssembly ( ref ) . newassembly ) ; repaint ( ) ; $ ( '#freshassembs' ) . html ( "<strong>" + totnewassemblies ( ) + "</strong> / <strong>" + numbernewassemblies ( 0 ) + "</strong> / <strong>" + ( Number ( totnewassemblies ( ) ) + Number ( numbernewassemblies ( 0 ) ) ) + "</strong>" ) ; }
handles assembly type deletions, ensure all assemblies of that type are set to newassembly 0
handles assembly type deletions ensure all assemblies of that type are set to newassembly 0