Ah. so something like this?


PHP Code:
if(
    (
$tiles[$l].getAttribute('class').match('tcl-0F')) ||
    ((
        
$tiles[$l].getAttribute('class').match('tcl-0C') ||
        
$tiles[$l].getAttribute('class').match('tcl-12')
    ) && (
        
$tiles[$l].parentNode.id=='Tile_Row-07' ||
        
$tiles[$l].parentNode.id=='Tile_Row-09'
    
)) ||
    ((
        
$tiles[$l].getAttribute('class').match('tcl-09') ||
        
$tiles[$l].getAttribute('class').match('tcl-15')
    ) && (
        
$tiles[$l].parentNode.id=='Tile_Row-06' ||
        
$tiles[$l].parentNode.id=='Tile_Row-0A'
    
)) ||
    ((
            
$tiles[$l].getAttribute('class').match('tcl-06') ||
            
$tiles[$l].getAttribute('class').match('tcl-18')
        ) && (
            
$tiles[$l].parentNode.id=='Tile_Row-05' ||
            
$tiles[$l].parentNode.id=='Tile_Row-0B'
    
))
){
$tiles[$l].setAttribute('piece''legal');}